[PATCH 01/10] trace: sandbox: Use only the Kconfig options

Simon Glass sjg at chromium.org
Sun Nov 14 04:21:52 CET 2021


At present there are Kconfig options for tracing, but sandbox uses
plain #defines to set them. Correct this and make the tracing command
default to enabled so that this is not needed.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 cmd/Kconfig           |  2 ++
 doc/develop/trace.rst | 14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 5b30b13e438..fd8f0227c89 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2350,6 +2350,8 @@ config CMD_LOG
 
 config CMD_TRACE
 	bool "trace - Support tracing of function calls and timing"
+	depends on TRACE
+	default y
 	help
 	  Enables a command to control using of function tracing within
 	  U-Boot. This allows recording of call traces including timing
diff --git a/doc/develop/trace.rst b/doc/develop/trace.rst
index 7776c484286..34bce5d4677 100644
--- a/doc/develop/trace.rst
+++ b/doc/develop/trace.rst
@@ -30,16 +30,16 @@ Sandbox is a build of U-Boot that can run under Linux so it is a convenient
 way of trying out tracing before you use it on your actual board. To do
 this, follow these steps:
 
-Add the following to include/configs/sandbox.h (if not already there)
+Add the following to config/sandbox_defconfig (if not already there)
 
 .. code-block:: c
 
-    #define CONFIG_TRACE
-    #define CONFIG_CMD_TRACE
-    #define CONFIG_TRACE_BUFFER_SIZE    (16 << 20)
-    #define CONFIG_TRACE_EARLY_SIZE     (8 << 20)
-    #define CONFIG_TRACE_EARLY
-    #define CONFIG_TRACE_EARLY_ADDR     0x00100000
+    CONFIG_TRACE=y
+    CONFIG_TRACE_BUFFER_SIZE=0x01000000
+    CONFIG_TRACE_BUFFER_SIZE=0x01000000
+    CONFIG_TRACE_EARLY_SIZE=0x800000
+    CONFIG_TRACE_EARLY=y
+    CONFIG_TRACE_EARLY_ADDR=0x00100000
 
 Build sandbox U-Boot with tracing enabled:
 
-- 
2.34.0.rc1.387.gb447b232ab-goog



More information about the U-Boot mailing list