Skip to contentSkip to conversation

iotrace: Finish migrating this to Kconfig

PATCH In review Tom Rini 1 participant 2 messages Oct 1, 2025 – Oct 11, 2025

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 iotrace: Finish migrating this to Kconfig

When I migrated this to Kconfig in commit 68e54040ccc3 ("sandbox: Move CONFIG_IO_TRACE to Kconfig") I didn't look hard enough for other details. As explained in the README, this is valid for ARM too. So start by making this be a prompted question and CMD_IOTRACE depend on IO_TRACE being enabled. Next, migrate the information out of README and in to the appropriate help text for existing options in Kconfig. Finally, make this option be default y on SANDBOX but not selected as it's valid to build without it.

---
 README         | 22 ----------------------
 arch/Kconfig   |  1 -
 cmd/Kconfig    | 11 +++++++++++
 common/Kconfig | 11 ++++++++++-
 4 files changed, 21 insertions(+), 24 deletions(-)
README +0 -22
index 27cde241bef4..20a73bab802c 100644
@@ -300,28 +300,6 @@ The following options need to be configured:
 		Note that if the GPIO device uses I2C, then the I2C interface
 		must also be configured. See I2C Support, below.
 
-- I/O tracing:
-		When CONFIG_IO_TRACE is selected, U-Boot intercepts all I/O
-		accesses and can checksum them or write a list of them out
-		to memory. See the 'iotrace' command for details. This is
-		useful for testing device drivers since it can confirm that
-		the driver behaves the same way before and after a code
-		change. Currently this is supported on sandbox and arm. To
-		add support for your architecture, add '#include <iotrace.h>'
-		to the bottom of arch/<arch>/include/asm/io.h and test.
-
-		Example output from the 'iotrace stats' command is below.
-		Note that if the trace buffer is exhausted, the checksum will
-		still continue to operate.
-
-			iotrace is enabled
-			Start:  10000000	(buffer start address)
-			Size:   00010000	(buffer size)
-			Offset: 00000120	(current buffer offset)
-			Output: 10000120	(start + offset)
-			Count:  00000018	(number of trace records)
-			CRC32:  9526fb66	(CRC32 of all trace records)
-
 - Timestamp Support:
 
 		When CONFIG_TIMESTAMP is selected, the timestamp
arch/Kconfig +0 -1
index 7e05e0c22634..3133f892f945 100644
@@ -202,7 +202,6 @@ config SANDBOX
 	select DM_SPI
 	select DM_SPI_FLASH
 	select GZIP_COMPRESSED
-	select IO_TRACE
 	select LZO
 	select MMC
 	select MTD
cmd/Kconfig +11 -0
index 5e5252ef1347..761b126e3271 100644
@@ -1308,12 +1308,23 @@ config CMD_IO
 
 config CMD_IOTRACE
 	bool "iotrace - Support for tracing I/O activity"
+	depends on IO_TRACE
 	help
 	  Provides an 'iotrace' command which supports recording I/O reads and
 	  writes in a trace buffer in memory . It also maintains a checksum
 	  of the trace records (even if space is exhausted) so that the
 	  sequence of I/O accesses can be verified.
 
+	  Example output from the 'iotrace stats' command is below.
+
+		iotrace is enabled
+		Start:  10000000	(buffer start address)
+		Size:   00010000	(buffer size)
+		Offset: 00000120	(current buffer offset)
+		Output: 10000120	(start + offset)
+		Count:  00000018	(number of trace records)
+		CRC32:  9526fb66	(CRC32 of all trace records)
+
 	  When debugging drivers it is useful to see what I/O accesses were
 	  done and in what order.
 
common/Kconfig +10 -1
index 30bf225362ee..0c25a8fc866e 100644
@@ -1264,4 +1264,13 @@ config VPL_IMAGE_SIGN_INFO
 endif
 
 config IO_TRACE
-	bool
+	bool "Intercept and checksum all I/O accesses"
+	depends on ARM || SANDBOX
+	default y if SANDBOX
+	help
+	  When enabled, U-Boot intercepts all I/O accesses and can checksum
+	  them or write a list of them out to memory. See the 'iotrace' command
+	  for details. This is useful for testing device drivers since it can
+	  confirm that the driver behaves the same way before and after a code
+	  change. To add support for your architecture, add '#include
+	  <iotrace.h>' to the bottom of arch/<arch>/include/asm/io.h and test.
Signature · 1 line
2.43.0
author
#1 lore raw
Quoted 10 lines · Tom Rini

When I migrated this to Kconfig in commit 68e54040ccc3 ("sandbox: Move CONFIG_IO_TRACE to Kconfig") I didn't look hard enough for other details. As explained in the README, this is valid for ARM too. So start by making this be a prompted question and CMD_IOTRACE depend on IO_TRACE being enabled. Next, migrate the information out of README and in to the appropriate help text for existing options in Kconfig. Finally, make this option be default y on SANDBOX but not selected as it's valid to build without it.

[...]

Applied to u-boot/master, thanks!

[1/1] iotrace: Finish migrating this to Kconfig

      commit: 16bbc225fed7931988616ba4e223954ae5ccc06b
Signature · 1 line
Tom