dreport: Implementation of data collection function
Added support for running command in the command array and
save the data into specified location.
Added file level size check function, which helps to cap the
final dreport log based on size provided by user.
Change-Id: I5bb0f2629bf4b4dd7b86b6dd97d205c413af6fcf
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/tools/dreport b/tools/dreport
index 42b9733..03f6e13 100755
--- a/tools/dreport
+++ b/tools/dreport
@@ -305,6 +305,21 @@
fi
}
+# @brief Capture debug data based on the input command array.
+# and stores in to global temporary name specific location.
+# @param $1 Source array
+# @return 0 on success, error code otherwise
+function capture_data()
+{
+ source=("$@")
+
+ for ((i=0;i<${#source[@]};i+=1)); do
+ ${source[i]}
+ done
+
+ return 0
+}
+
# @brief Calculate file or directory compressed size based on input
# and check whether the size in the the allowed size limit.
# Remove the file or directory from the name_dir