tracing: add RAM backend

If Zephyr is running on a coprocessor we might lack I/O
such as uart or usb to output tracing datas but we might
have gigabytes of RAM available.

This patch allows to output trace datas to a ram buffer, which then
may be retrieved using gdb.

e.g:
(gdb) dump binary memory channel0_0 <ram_tracing_start> \
<ram_tracing_end>

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
This commit is contained in:
Julien Massot 2021-02-26 09:22:16 +01:00 committed by Anas Nashif
commit 80402f7f8b
4 changed files with 68 additions and 0 deletions

View file

@ -165,6 +165,21 @@ config TRACING_BACKEND_POSIX
help
Use posix architecture to output tracing data to file system.
config TRACING_BACKEND_RAM
bool "Enable RAM backend"
help
Use a ram buffer to output tracing data which can
be dumped to a file at runtime with a debugger.
See gdb dump binary memory documentation for example.
config RAM_TRACING_BUFFER_SIZE
int "Ram Tracing buffer size"
default 4096
depends on TRACING_BACKEND_RAM
help
Size of the RAM trace buffer. Trace will be discarded if the
length is exceeded.
endchoice
config TRACING_BACKEND_UART_NAME