give up on trac2line full porting, just call sh script for now

This commit is contained in:
Ciro Santilli
2018-09-06 08:01:58 +01:00
parent df47eba450
commit 24b539f152
4 changed files with 88 additions and 41 deletions

23
trace2line.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eu
common_gem5="$1"
shift
common_trace_txt_file="$1"
shift
common_addr2line="$1"
shift
common_vmlinux="$1"
shift
common_run_dir="$1"
shift
(
if "$common_gem5"; then
sed -r 's/^.* (0x[^. ]*)[. ].*/\1/' "$common_trace_txt_file"
else
sed -r 's/.*pc=//' "$common_trace_txt_file"
fi
) | \
xargs "${common_addr2line}" -e "${common_vmlinux}" -fp | \
sed -E "s|at ${common_vmlinux}/(\./\|)||" | \
uniq -c \
> "${common_run_dir}/trace-lines.txt"