summaryrefslogtreecommitdiff
path: root/util/genprof/log2dress
blob: c901a81d78a625d411a890d720f781e0c4c1c776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/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/coreboot_ram.debug "$FROM" | tr -d "\n"
echo -n " calls "
addr2line -e ../../build/cbfs/fallback/coreboot_ram.debug "$TO"
else
echo "$line"
fi

done