scripts/core-collector: Add coredump_filter map to .json
This is done to make clear what data is included with the core dump. Signed-off-by: Michal Berger <michal.berger@intel.com> Change-Id: I67f7da7f342354df4688147eaf56283b33ba2863 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15996 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
9545f9ac49
commit
6d8f483383
@ -18,7 +18,8 @@ core_meta() {
|
|||||||
"PID": $core_pid,
|
"PID": $core_pid,
|
||||||
"signal": "$core_sig ($core_sig_name)",
|
"signal": "$core_sig ($core_sig_name)",
|
||||||
"path": "$exe_path",
|
"path": "$exe_path",
|
||||||
"statm": "$statm"
|
"statm": "$statm",
|
||||||
|
"filter": "$(coredump_filter)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CORE
|
CORE
|
||||||
@ -31,6 +32,30 @@ stderr() {
|
|||||||
set -x
|
set -x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
coredump_filter() {
|
||||||
|
local bitmap bit
|
||||||
|
local _filter filter
|
||||||
|
|
||||||
|
bitmap[0]=anon-priv-mappings
|
||||||
|
bitmap[1]=anon-shared-mappings
|
||||||
|
bitmap[2]=file-priv-mappings
|
||||||
|
bitmap[3]=file-shared-mappings
|
||||||
|
bitmap[4]=elf-headers
|
||||||
|
bitmap[5]=priv-hp
|
||||||
|
bitmap[6]=shared-hp
|
||||||
|
bitmap[7]=priv-DAX
|
||||||
|
bitmap[8]=shared-DAX
|
||||||
|
|
||||||
|
_filter=0x$(< "/proc/$core_pid/coredump_filter")
|
||||||
|
|
||||||
|
for bit in "${!bitmap[@]}"; do
|
||||||
|
((_filter & 1 << bit)) || continue
|
||||||
|
filter=${filter:+$filter,}${bitmap[bit]}
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "$filter"
|
||||||
|
}
|
||||||
|
|
||||||
args+=(core_pid)
|
args+=(core_pid)
|
||||||
args+=(core_sig)
|
args+=(core_sig)
|
||||||
args+=(core_ts)
|
args+=(core_ts)
|
||||||
|
Loading…
Reference in New Issue
Block a user