This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

Send Tracing Formatted Packet To The Host With Supported Backends


This application can be used to demonstrate the tracing feature. The tracing formatted packet will be sent to the host with the currently supported tracing backend under tracing generic infrastructure.


Depends of the boards which you are using, choose one of .conf files for use tracing subsys.

Usage for UART Tracing Backend

Build a UART-tracing image with:

west build -b mps2_an521 samples/subsys/tracing -- -DCONF_FILE="prj_uart.conf"


west build -b mps2_an521 samples/subsys/tracing -- -DCONF_FILE="prj_uart_ctf.conf"


You may need to set “zephyr,tracing-uart” property under the chosen node in your devicetree. See boards/mps2_an521.overlay for an example.

After the application has run for a while, check the trace output file.

Usage for USB Tracing Backend

Build a USB-tracing image with:

west build -b sam_e70_xplained samples/subsys/tracing -- -DCONF_FILE="prj_usb.conf"


west build -b sam_e70_xplained samples/subsys/tracing -- -DCONF_FILE="prj_usb_ctf.conf"

After the serial console has stable output like this:

threadA: Hello World!
threadB: Hello World!
threadA: Hello World!
threadB: Hello World!

Connect the board’s USB port to the host device and run the script on the host:

sudo python3 -v 0x2FE9 -p 0x100 -o channel0_0

The VID and PID of USB device can be configured, just adjusting it accordingly.

Usage for POSIX Tracing Backend

Build a POSIX-tracing image with:

west build -b native_posix samples/subsys/tracing -- -DCONF_FILE="prj_native_posix.conf"


west build -b native_posix samples/subsys/tracing -- -DCONF_FILE="prj_native_posix_ctf.conf"

After the application has run for a while, check the trace output file.