Add support utils for tracing
[coreboot.git] / util / genprof / log2dress
1 #!/bin/bash
2 #Parse a log and get back the function names and line numbers
3 #Provide a log file as first argument
4
5 #Please rewrite to something more saner !
6
7 cat $1 | while read line ; do
8 A=`echo $line | cut -c 1`
9
10 if [ "$A" = '~' ] ; then
11 FROM=`echo $line | tr \~ \( | tr \) \(  | awk -F\( '{print $3}'`
12 TO=`echo $line  | tr \~ \( | tr \) \(|awk -F\( '{print $2}'`
13 addr2line -e ../../build/coreboot_ram.debug "$FROM" | tr -d "\n"
14 echo -n " calls "
15 addr2line -e ../../build/coreboot_ram.debug "$TO"
16 else
17 echo "$line"
18 fi
19
20 done