Files
linux-kernel-module-cheat/trace2line
Ciro Santilli f5065183a8 tracing: create trace2line
This lead to a re-factoring of count boot instructions, since trace2line
relies on the same tracing mechanism.

Also, now that we have common factored, I've decided to put the traces on
the out dir, to concentrate all outputs in a single place, and allow
easy switching between archs.
2018-03-28 14:12:03 +01:00

19 lines
445 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
. common
arch=x86_64
while getopts a: OPT; do
case "$OPT" in
a)
arch="$OPTARG"
;;
esac
done
set_common_vars "$arch" false
kernel_dir="${out_dir}/build/linux-custom"
sed -E 's/.*pc=//' "${lkmc_out_dir}/trace.txt" | \
xargs "${out_dir}/host/bin/${arch}-linux-addr2line" -e "${kernel_dir}/vmlinux" -fp | \
sed -E "s|at ${kernel_dir}/(\./\|)||" | \
uniq -c \
> "${lkmc_out_dir}/trace-lines.txt"