zephyr/samples/subsys/tracing
Daniel DeGrasse 99368df6a8 samples: tracing: add usage example for sys_trace_user_event
Add usage example for sys_trace_user_event, to demonstrate how users
could add tracing functionality to their application.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-17 10:46:52 -04:00
..
boards samples/subsys/tracing: Don't test on native_posix 2024-09-25 04:04:36 -04:00
src samples: tracing: add usage example for sys_trace_user_event 2024-10-17 10:46:52 -04:00
CMakeLists.txt
prj_native_ctf.conf services/tracing doc & samples: Replace native_posix w native_sim 2023-11-14 13:06:01 +01:00
prj_percepio.conf
prj_sysview.conf samples/doc: segger: rtt: enhanced tracing/logging 2023-08-06 07:44:06 -04:00
prj_uart_ctf.conf
prj_uart.conf
prj_usb_ctf.conf samples: Explicitly disable boot USB device support init at boot 2023-01-10 12:21:10 +01:00
prj_usb.conf samples: Explicitly disable boot USB device support init at boot 2023-01-10 12:21:10 +01:00
prj_user.conf
prj.conf samples/doc: segger: rtt: enhanced tracing/logging 2023-08-06 07:44:06 -04:00
README.rst doc: samples: tracing: fix dead link to sample overlay 2024-06-12 12:49:00 -04:00
sample.yaml samples/subsys/tracing: Don't test on native_posix 2024-09-25 04:04:36 -04:00

.. zephyr:code-sample:: tracing
   :name: Tracing

   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.

Requirements
************

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:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: mps2/an521
	:conf: "prj_uart.conf"
	:goals: build
	:compact:

or:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: mps2/an521
	:conf: "prj_uart_ctf.conf"
	:goals: build
	:compact:

.. note::
   You may need to set "zephyr,tracing-uart" property under the chosen node in your devicetree.
   See :zephyr_file:`samples/subsys/tracing/boards/mps2_an521_cpu0.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:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: sam_e70_xplained/same70q21
	:conf: "prj_usb.conf"
	:goals: build
	:compact:

or:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: sam_e70_xplained/same70q21
	:conf: "prj_usb_ctf.conf"
	:goals: build
	:compact:

After the serial console has stable output like this:

.. code-block:: console

	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 :zephyr_file:`scripts/tracing/trace_capture_usb.py` script on the host:

.. code-block:: console

	sudo python3 trace_capture_usb.py -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:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: native_sim
	:goals: build
	:compact:

or:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: native_sim
	:conf: "prj_native_ctf.conf"
	:goals: build
	:compact:

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

Usage for USER Tracing Backend
*******************************

Build a USER-tracing image with:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: qemu_x86
	:conf: "prj_user.conf"
	:goals: build
	:compact:

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