ffdc: Enable dreport based ffdc debug data collection

Enabled dreport based debug data collection by default
in the ffdc tool.

Added -D option to disable the dreport based data collection
and switch back to ffdc way.

Change-Id: I429533d3d04495ea3cda2bcb2b1090f1d971d530
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/ffdc b/ffdc
index 6c32abc..3c93fe4 100644
--- a/ffdc
+++ b/ffdc
@@ -9,6 +9,7 @@
 Options:
    -d, --dir <directory>  Specify destination directory. Defaults to /tmp if
                           invalid or unspecified.
+   -D, --disable_dreport  Disable dreport based dump collection
    -h, --help             Display this help text and exit.
 '
 
@@ -38,6 +39,7 @@
 
 dir=$"ffdc_$(date +"%Y-%m-%d_%H-%M-%S")"
 dest="/tmp"
+disable_dreport=false
 
 while [[ $# -gt 0 ]]; do
   key="$1"
@@ -52,6 +54,10 @@
       fi
       shift 2
       ;;
+    -D|--disable_dreport)
+      disable_dreport=true
+      shift
+      ;;
     -h|--help)
       echo "$help"
       exit
@@ -65,6 +71,11 @@
 
 echo "Using destination directory $dest"
 
+if [ $disable_dreport = false ]; then
+  dreport -d $dest -v
+  exit
+fi
+
 mkdir -p "$dest/$dir"
 
 for ((i=0;i<${#arr[@]};i+=2)); do