coreboot-libre-fam15h-rdimm/util/genprof/log2dress

21 lines
552 B
Plaintext
Raw Normal View History

2024-03-04 11:14:53 +01:00
#!/usr/bin/env bash
#Parse a log and get back the function names and line numbers
#Provide a log file as first argument
#Please rewrite to something more saner !
cat $1 | while read line ; do
A=`echo $line | cut -c 1`
if [ "$A" = '~' ] ; then
FROM=`echo $line | tr \~ \( | tr \) \( | awk -F\( '{print $3}'`
TO=`echo $line | tr \~ \( | tr \) \(|awk -F\( '{print $2}'`
addr2line -e ../../build/cbfs/fallback/ramstage.debug "$FROM" | tr -d "\n"
echo -n " calls "
addr2line -e ../../build/cbfs/fallback/ramstage.debug "$TO"
else
echo "$line"
fi
done