tools: acrn-crashlog: add usercrash_c in the pipe of core_pattern

This patch adds the usercrash client in the pipe of core_pattern
without affecting default core_pattern program.

In acrnprobe_prepare.sh, core_pattern will be set as usercrash-wrapper
with all of the arguments, which parses the parameters of the default
core_pattern program and the usercrash client, and then invokes them
separately.

Tracked-On: #1024
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: xiaojin2 <xiaojing.liu@intel.com>
Acked-by: Zhang Di <di.zhang@intel.com>
This commit is contained in:
CHEN Gang
2018-08-29 15:46:48 +08:00
committed by lijinxia
parent a4cb3913b3
commit 37fd3871b7
3 changed files with 142 additions and 4 deletions

View File

@@ -4,14 +4,19 @@
# SPDX-License-Identifier: BSD-3-Clause
#
# modify the core_pattern
core_pattern_conf="/proc/sys/kernel/core_pattern"
crashlog_path="/var/log/crashlog"
grep -q "coredump-wrapper" $core_pattern_conf
if [ "$?" -ne "0" ] then
echo "|/usr/bin/usercrash_c %p %e %s" > $core_pattern_conf
if [ ! -d $crashlog_path ]; then
mkdir -p $crashlog_path
fi
# backup the default core_pattern
cat $core_pattern_conf > /var/log/crashlog/default_core_pattern
# update the content of core_pattern, passdown all the parameters
echo "|/usr/bin/usercrash-wrapper %E %P %u %g %s %t %c %h %e %p %i %I %d" > $core_pattern_conf
default_conf="/usr/share/defaults/telemetrics/telemetrics.conf"
user_conf="/etc/telemetrics/telemetrics.conf"