Add support utils for tracing
[coreboot.git] / util / genprof / README
1 Function tracing
2 ----------------
3
4 Enable CONFIG_TRACE in debug menu. Run the compiled image on target. You will get
5 a log with a lot of lines like:
6
7 ...
8 ~0x001072e8(0x00100099)
9 ~0x00108bc0(0x0010730a)
10 ...
11
12 First address is address of function which was just entered, the second address
13 is address of functions which call that.
14
15 You can use the log2dress to dress the log again:
16
17 ...
18 src/arch/x86/lib/c_start.S:85 calls /home/ruik/coreboot/src/boot/selfboot.c:367
19 /home/ruik/coreboot/src/boot/selfboot.c:370 calls /home/ruik/coreboot/src/devices/device.c:325
20 ...
21
22 Alternatively, you can use genprof to generate a gmon.out file, which can be used
23 by gprof to show the call traces. You will need to install uthash library to compile
24 that.
25
26 Great use is:
27
28 make
29 ./genprof /tmp/yourlog ;  gprof ../../build/coreboot_ram |  ./gprof2dot.py -e0 -n0 | dot -Tpng -o output.png
30
31 Which generates a PNG with a call graph.