summaryrefslogtreecommitdiff
path: root/util/genprof/README
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2011-09-02 23:34:15 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-09-07 01:27:57 +0200
commit8679e52b9632254c247db31020d09e877071366e (patch)
treee86c734a8b11aa60f0f72612b848640ddd51c204 /util/genprof/README
parent7f0e93060e720149bb59023d608a67cfc21542b1 (diff)
Add support utils for tracing
Following patch adds a userspace util genprof which is able to convert the console printed traces to gmon.out file used by gprof & friends. The log2dress will replace the adresses in logfile with a line numbers. Change-Id: I9f716f3ff2522a24fbc844a1dd5e32ef49b540c5 Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Reviewed-on: http://review.coreboot.org/179 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/genprof/README')
-rw-r--r--util/genprof/README31
1 files changed, 31 insertions, 0 deletions
diff --git a/util/genprof/README b/util/genprof/README
new file mode 100644
index 0000000000..3483a2b22b
--- /dev/null
+++ b/util/genprof/README
@@ -0,0 +1,31 @@
+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/devices/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/coreboot_ram | ./gprof2dot.py -e0 -n0 | dot -Tpng -o output.png
+
+Which generates a PNG with a call graph.