mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-08 00:06:59 +02:00
doc: move README.trace to HTML documentation
Convert README.trace to reStructured text and move it to develop/trace.rst. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
d0253f7e5c
commit
dce26c7d56
@ -12,3 +12,4 @@ Develop U-Boot
|
||||
crash_dumps
|
||||
global_data
|
||||
logging
|
||||
trace
|
||||
|
@ -1,6 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (c) 2013 The Chromium OS Authors.
|
||||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
.. Copyright (c) 2013 The Chromium OS Authors.
|
||||
|
||||
Tracing in U-Boot
|
||||
=================
|
||||
@ -33,6 +32,8 @@ this, follow these steps:
|
||||
|
||||
Add the following to include/configs/sandbox.h (if not already there)
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#define CONFIG_TRACE
|
||||
#define CONFIG_CMD_TRACE
|
||||
#define CONFIG_TRACE_BUFFER_SIZE (16 << 20)
|
||||
@ -42,14 +43,17 @@ Add the following to include/configs/sandbox.h (if not already there)
|
||||
|
||||
Build sandbox U-Boot with tracing enabled:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ make FTRACE=1 O=sandbox sandbox_config
|
||||
$ make FTRACE=1 O=sandbox
|
||||
|
||||
Run sandbox, wait for a bit of trace information to appear, and then capture
|
||||
a trace:
|
||||
|
||||
$ ./sandbox/u-boot
|
||||
.. code-block:: console
|
||||
|
||||
$ ./sandbox/u-boot
|
||||
|
||||
U-Boot 2013.04-rc2-00100-ga72fcef (Apr 17 2013 - 19:25:24)
|
||||
|
||||
@ -93,11 +97,15 @@ Environment size: 117/8188 bytes
|
||||
=>reset
|
||||
|
||||
|
||||
Then run proftool to convert the trace information to ftrace format.
|
||||
Then run proftool to convert the trace information to ftrace format
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ ./sandbox/tools/proftool -m sandbox/System.map -p trace dump-ftrace >trace.txt
|
||||
|
||||
Finally run pytimechart to display it:
|
||||
Finally run pytimechart to display it
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ pytimechart trace.txt
|
||||
|
||||
@ -109,22 +117,22 @@ function.
|
||||
CONFIG Options
|
||||
--------------
|
||||
|
||||
- CONFIG_TRACE
|
||||
CONFIG_TRACE
|
||||
Enables the trace feature in U-Boot.
|
||||
|
||||
- CONFIG_CMD_TRACE
|
||||
CONFIG_CMD_TRACE
|
||||
Enables the trace command.
|
||||
|
||||
- CONFIG_TRACE_BUFFER_SIZE
|
||||
CONFIG_TRACE_BUFFER_SIZE
|
||||
Size of trace buffer to allocate for U-Boot. This buffer is
|
||||
used after relocation, as a place to put function tracing
|
||||
information. The address of the buffer is determined by
|
||||
the relocation code.
|
||||
|
||||
- CONFIG_TRACE_EARLY
|
||||
CONFIG_TRACE_EARLY
|
||||
Define this to start tracing early, before relocation.
|
||||
|
||||
- CONFIG_TRACE_EARLY_SIZE
|
||||
CONFIG_TRACE_EARLY_SIZE
|
||||
Size of 'early' trace buffer. Before U-Boot has relocated
|
||||
it doesn't have a proper trace buffer. On many boards
|
||||
you can define an area of memory to use for the trace
|
||||
@ -132,7 +140,7 @@ CONFIG Options
|
||||
relocation. The contents of this buffer are then copied to
|
||||
the real buffer.
|
||||
|
||||
- CONFIG_TRACE_EARLY_ADDR
|
||||
CONFIG_TRACE_EARLY_ADDR
|
||||
Address of early trace buffer
|
||||
|
||||
|
||||
@ -191,19 +199,19 @@ Commands
|
||||
|
||||
The trace command has variable sub-commands:
|
||||
|
||||
- stats
|
||||
stats
|
||||
Display tracing statistics
|
||||
|
||||
- pause
|
||||
pause
|
||||
Pause tracing
|
||||
|
||||
- resume
|
||||
resume
|
||||
Resume tracing
|
||||
|
||||
- funclist [<addr> <size>]
|
||||
funclist [<addr> <size>]
|
||||
Dump a list of functions into the buffer
|
||||
|
||||
- calls [<addr> <size>]
|
||||
calls [<addr> <size>]
|
||||
Dump function call trace into buffer
|
||||
|
||||
If the address and size are not given, these are obtained from environment
|
||||
@ -216,13 +224,13 @@ Environment Variables
|
||||
|
||||
The following are used:
|
||||
|
||||
- profbase
|
||||
profbase
|
||||
Base address of trace output buffer
|
||||
|
||||
- profoffset
|
||||
profoffset
|
||||
Offset of first unwritten byte in trace output buffer
|
||||
|
||||
- profsize
|
||||
profsize
|
||||
Size of trace output buffer
|
||||
|
||||
All of these are set by the 'trace calls' command.
|
||||
@ -231,15 +239,15 @@ These variables keep track of the amount of data written to the trace
|
||||
output buffer by the 'trace' command. The trace commands which write data
|
||||
to the output buffer can use these to specify the buffer to write to, and
|
||||
update profoffset each time. This allows successive commands to append data
|
||||
to the same buffer, for example:
|
||||
to the same buffer, for example::
|
||||
|
||||
trace funclist 10000 e00000
|
||||
trace calls
|
||||
=> trace funclist 10000 e00000
|
||||
=> trace calls
|
||||
|
||||
(the latter command appends more data to the buffer).
|
||||
|
||||
|
||||
- fakegocmd
|
||||
fakegocmd
|
||||
Specifies commands to run just before booting the OS. This
|
||||
is a useful time to write the trace data to the host for
|
||||
processing.
|
||||
@ -250,7 +258,7 @@ Writing Out Trace Data
|
||||
|
||||
Once the trace data is in an output buffer in memory there are various ways
|
||||
to transmit it to the host. Notably you can use tftput to send the data
|
||||
over a network link:
|
||||
over a network link::
|
||||
|
||||
fakegocmd=trace pause; usb start; set autoload n; bootp;
|
||||
trace calls 10000000 1000000;
|
||||
@ -272,6 +280,7 @@ This tool must be given the U-Boot map file and the trace data received
|
||||
from running that U-Boot. It produces a text output file.
|
||||
|
||||
Options
|
||||
|
||||
-m <map_file>
|
||||
Specify U-Boot map file
|
||||
|
||||
@ -280,7 +289,7 @@ Options
|
||||
|
||||
Commands:
|
||||
|
||||
- dump-ftrace
|
||||
dump-ftrace
|
||||
Write a text dump of the file in Linux ftrace format to stdout
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user