coreboot-kgpe-d16/util/genprof
Tom Hiller 8ba9e8cf63 util: Add description.md to each util
Descriptions are taken from the files themselves or READMEs. Description
followed by a space with the language in marked up as code.

Change-Id: I5f91e85d1034736289aedf27de00df00db3ff19c
Signed-off-by: Tom Hiller <thrilleratplay@gmail.com>
Reviewed-on: https://review.coreboot.org/27563
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2018-07-26 13:26:50 +00:00
..
Makefile Add support utils for tracing 2011-09-07 01:27:57 +02:00
README Rename coreboot_ram stage to ramstage 2014-04-26 13:27:09 +02:00
description.md util: Add description.md to each util 2018-07-26 13:26:50 +00:00
genprof.c util/genprof: improve handling of command line arguments 2014-08-12 09:02:44 +02:00
log2dress Rename coreboot_ram stage to ramstage 2014-04-26 13:27:09 +02:00

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.