Add support for the tracing infastructure in coreboot.

The compiler is forced to emmit special functions on every
entry/exit of the function. Add a compile time option
to support it. Function entries will be printed in
the console. The CONFIG_TRACE has more documentation.

Patch for userspace tools will follow.

Change-Id: I2cbeb3f104892b034c8756f86ed05bf71187c3f3
Signed-off-by: Rudolf Marek <>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <>
diff --git a/src/Kconfig b/src/Kconfig
index f96c903..e9ceed5 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -845,6 +845,15 @@
 	  Put llshell() in your (romstage) code to start the shell.
 	  See src/arch/x86/llshell/ for details.
+config TRACE
+	bool "Trace function calls"
+	default n
+	help
+	  If enabled, every function will print information to console once
+	  the function is entered. The syntax is ~0xaaaabbbb(0xccccdddd)
+	  the 0xaaaabbbb is the actual function and 0xccccdddd is EIP
+	  of calling function. Please note some printk releated functions
+	  are omitted from trace to have good looking console dumps.