summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayanth Othayoth <ojayanth@in.ibm.com>2017-09-03 22:34:14 -0500
committerJayanth Othayoth <ojayanth@in.ibm.com>2017-09-12 02:40:57 -0500
commitfa388d0cfc0d6bd50ea4dc1314ccb29e38c350e5 (patch)
tree5722674e9ad64241eb4bcfec351d80018b1250c2
parent2b05adc34fae4d95f4595dd329f3734bd60df724 (diff)
downloadphosphor-debug-collector-fa388d0cfc0d6bd50ea4dc1314ccb29e38c350e5.tar.gz
phosphor-debug-collector-fa388d0cfc0d6bd50ea4dc1314ccb29e38c350e5.zip
dreport: Update pid related variable names
Changed the pid variable name generic instead of type specific Change-Id: Ifc8cec327a68701128c3afe0ee602f53f407d606 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
-rwxr-xr-xtools/dreport12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/dreport b/tools/dreport
index 35f4a9c..e8c32a5 100755
--- a/tools/dreport
+++ b/tools/dreport
@@ -66,7 +66,7 @@ declare -x dreport_log=""
declare -x summary_log=""
declare -x cur_dump_size=0
declare -a command_list=("")
-declare -x core_pid="0"
+declare -x pid="0"
# @brief Initialize user type command array
function runlevel_user()
@@ -155,7 +155,7 @@ function get_journal()
function get_proc_journal()
{
desc="Process Journal log"
- command="journalctl -o verbose _PID=$core_pid"
+ command="journalctl -o verbose _PID=$pid"
copy_loc="proc_journal.log"
run_command "$command" "$copy_loc" "$desc"
}
@@ -317,7 +317,7 @@ function collect_data()
capture_data "${command_list[@]}"
;;
$TYPE_CORE)
- set_pid
+ set_core_pid
runlevel_core
capture_data "${command_list[@]}"
;;
@@ -330,19 +330,19 @@ function collect_data()
esac
}
-# @brief get pid from the file
+# @brief set pid by reading information from the optional path.
# dreport "core" type user provides core file as optional path parameter.
# As per coredump source code systemd-coredump uses below format
# https://github.com/systemd/systemd/blob/master/src/coredump/coredump.c
# /var/lib/systemd/coredump/core.%s.%s." SD_ID128_FORMAT_STR “.
# <process ID>.%s000000"
-function set_pid()
+function set_core_pid()
{
#Escape bash characters in file name
file=$(printf %q "$optional_path")
#matching systemd-coredump core file format.
- core_pid=$(echo $file | awk -F . '{ print $5}')
+ pid=$(echo $file | awk -F . '{ print $5}')
}
# @brief Capture debug data based on the input command array.
OpenPOWER on IntegriCloud