]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Convert CONFIG_TRACE_BUFFER_SIZE et al to Kconfig
authorSimon Glass <sjg@chromium.org>
Mon, 8 Apr 2019 19:20:52 +0000 (13:20 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Apr 2019 02:26:43 +0000 (20:26 -0600)
This converts the following to Kconfig:
   CONFIG_TRACE_BUFFER_SIZE
   CONFIG_TRACE_EARLY_SIZE
   CONFIG_TRACE_EARLY
   CONFIG_TRACE_EARLY_ADDR

Signed-off-by: Simon Glass <sjg@chromium.org>
lib/Kconfig
lib/trace.c
scripts/config_whitelist.txt

index a3352a4fa15c42036a1fc571c8030941e01b4932..05f82d4a5025e68c832f11fc901ff22f6f884cee 100644 (file)
@@ -174,6 +174,54 @@ config TRACE
          memory for exporting for analysis (e.g. using bootchart).
          See doc/README.trace for full details.
 
+config TRACE_BUFFER_SIZE
+       hex "Size of trace buffer in U-Boot"
+       depends on TRACE
+       default 0x01000000
+       help
+         Sets the size of the trace buffer in U-Boot. This is allocated from
+         memory during relocation. If this buffer is too small, the trace
+         history will be truncated, with later records omitted.
+
+         If early trace is enabled (i.e. before relocation), this buffer must
+         be large enough to include all the data from the early trace buffer as
+         well, since this is copied over to the main buffer during relocation.
+
+         A trace record is emitted for each function call and each record is
+         12 bytes (see struct trace_call). A suggested minimum size is 1MB. If
+         the size is too small then 'trace stats' will show a message saying
+         how many records were dropped due to buffer overflow.
+
+config TRACE_EARLY
+       bool "Enable tracing before relocation"
+       depends on TRACE
+       help
+         Sometimes it is helpful to trace execution of U-Boot before
+         relocation. This is possible by using a arch-specific, fixed buffer
+         position in memory. Enable this option to start tracing as early as
+         possible after U-Boot starts.
+
+config TRACE_EARLY_SIZE
+       hex "Size of early trace buffer in U-Boot"
+       depends on TRACE_EARLY
+       default 0x00100000
+       help
+         Sets the size of the early trace buffer in bytes. This is used to hold
+         tracing information before relocation.
+
+config TRACE_EARLY_ADDR
+       hex "Address of early trace buffer in U-Boot"
+       depends on TRACE_EARLY
+       default 0x00100000
+       help
+         Sets the address of the early trace buffer in U-Boot. This memory
+         must be accessible before relocation.
+
+         A trace record is emitted for each function call and each record is
+         12 bytes (see struct trace_call). A suggested minimum size is 1MB. If
+         the size is too small then the message which says the amount of early
+         data being coped will the the same as the
+
 source lib/dhry/Kconfig
 
 menu "Security support"
index fb7658b112706989f16bca6f32364dee7289115b..9956442fefe6b422fb5b048f9aa039a0acb44aad 100644 (file)
@@ -296,7 +296,8 @@ int __attribute__((no_instrument_function)) trace_init(void *buff,
                trace_enabled = 0;
                hdr = map_sysmem(CONFIG_TRACE_EARLY_ADDR,
                                 CONFIG_TRACE_EARLY_SIZE);
-               end = (char *)&hdr->ftrace[hdr->ftrace_count];
+               end = (char *)&hdr->ftrace[min(hdr->ftrace_count,
+                                              hdr->ftrace_size)];
                used = end - (char *)hdr;
                printf("trace: copying %08lx bytes of early data from %x to %08lx\n",
                       used, CONFIG_TRACE_EARLY_ADDR,
index 2942c6945bca418f3a6eed1dde432f5316a867b4..3e6bdf81613902dca496719b817b1225950c7a5a 100644 (file)
@@ -4401,10 +4401,6 @@ CONFIG_TMU_TIMER
 CONFIG_TPL_PAD_TO
 CONFIG_TPM_TIS_BASE_ADDRESS
 CONFIG_TPS6586X_POWER
-CONFIG_TRACE_BUFFER_SIZE
-CONFIG_TRACE_EARLY
-CONFIG_TRACE_EARLY_ADDR
-CONFIG_TRACE_EARLY_SIZE
 CONFIG_TRAILBLAZER
 CONFIG_TRATS
 CONFIG_TSEC