coreboot-kgpe-d16/util/genprof
Patrick Georgi 8aa087ece6 .gitignore: Ignore .test/.dependencies globally
These were originally ignored only inside util/ but these files
shouldn't be tracked anywhere.

Change-Id: Ie0846bd8bdd6e52f420f9dd2e72a8a922102ff90
Signed-off-by: Patrick Georgi <patrick@georgi.software>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47012
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2020-10-31 18:21:36 +00:00
..
.gitignore
Makefile
README
description.md
genprof.c
log2dress

README

Function tracing
----------------

Enable CONFIG_TRACE in debug menu. Run the compiled image on target. You will get
a log with a lot of lines like:

...
~0x001072e8(0x00100099)
~0x00108bc0(0x0010730a)
...

First address is address of function which was just entered, the second address
is address of functions which call that.

You can use the log2dress to dress the log again:

...
src/arch/x86/lib/c_start.S:85 calls /home/ruik/coreboot/src/boot/selfboot.c:367
/home/ruik/coreboot/src/boot/selfboot.c:370 calls /home/ruik/coreboot/src/device/device.c:325
...

Alternatively, you can use genprof to generate a gmon.out file, which can be used
by gprof to show the call traces. You will need to install uthash library to compile
that.

Great use is:

make
./genprof /tmp/yourlog ;  gprof ../../build/ramstage |  ./gprof2dot.py -e0 -n0 | dot -Tpng -o output.png

Which generates a PNG with a call graph.