mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
25 lines
678 B
Bash
Executable File
25 lines
678 B
Bash
Executable File
#!/usr/bin/env bash
|
|
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
|
parsed=$(getopt -o "${common_getopt_flags}" -l "$common_getopt_flags_long" -- "$@")
|
|
eval set -- "$parsed"
|
|
while true; do
|
|
case "$1" in
|
|
*)
|
|
common_getopt_case "$@"
|
|
;;
|
|
esac
|
|
done
|
|
common_setup
|
|
kernel_dir="${common_build_dir}/linux-custom"
|
|
(
|
|
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_host_dir}/bin/${common_arch}-linux-addr2line" -e "${common_vmlinux}" -fp | \
|
|
sed -E "s|at ${kernel_dir}/(\./\|)||" | \
|
|
uniq -c \
|
|
> "${common_run_dir}/trace-lines.txt"
|