blob: d4159c2fd6bb52a9d0e7a4f96d525c30baa04959 [file] [log] [blame]
Rudolf Marek8679e522011-09-02 23:34:15 +02001Function tracing
2----------------
3
4Enable CONFIG_TRACE in debug menu. Run the compiled image on target. You will get
5a log with a lot of lines like:
6
7...
8~0x001072e8(0x00100099)
9~0x00108bc0(0x0010730a)
10...
11
12First address is address of function which was just entered, the second address
13is address of functions which call that.
14
15You can use the log2dress to dress the log again:
16
17...
18src/arch/x86/lib/c_start.S:85 calls /home/ruik/coreboot/src/boot/selfboot.c:367
Stefan Reinauer8d711552012-11-30 12:34:04 -080019/home/ruik/coreboot/src/boot/selfboot.c:370 calls /home/ruik/coreboot/src/device/device.c:325
Rudolf Marek8679e522011-09-02 23:34:15 +020020...
21
22Alternatively, you can use genprof to generate a gmon.out file, which can be used
23by gprof to show the call traces. You will need to install uthash library to compile
24that.
25
26Great use is:
27
28make
Furquan Shaikh20f25dd2014-04-22 10:41:05 -070029./genprof /tmp/yourlog ; gprof ../../build/ramstage | ./gprof2dot.py -e0 -n0 | dot -Tpng -o output.png
Rudolf Marek8679e522011-09-02 23:34:15 +020030
31Which generates a PNG with a call graph.