zephyr/samples/subsys/tracing
Johan Hedberg dee64613c2 samples: tracing: Reenable the percepio test case
Update to a fixed percepio tree, which allows the build to pass for valid
version numbers with 0 being one of the version number components.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-10-02 16:17:10 +03:00
..
boards samples: tracing: Replace prj_<board> files with overlays 2023-03-20 10:18:32 +01:00
src kernel: rename z_current_get() to k_sched_current_thread_query() 2023-09-28 16:15:46 +02:00
CMakeLists.txt samples: tracing: Add a sample for tracing_user 2021-09-02 06:54:35 -04:00
prj.conf samples/doc: segger: rtt: enhanced tracing/logging 2023-08-06 07:44:06 -04:00
prj_native_posix_ctf.conf samples: move tracing sample from tests/ 2020-04-29 22:30:19 -04:00
prj_percepio.conf sample: tracing: add a configuration for percepio 2022-11-04 10:00:48 +01:00
prj_sysview.conf samples/doc: segger: rtt: enhanced tracing/logging 2023-08-06 07:44:06 -04:00
prj_uart.conf tracing: Move to DTS for uart device 2022-07-19 16:00:47 -07:00
prj_uart_ctf.conf tracing: Move to DTS for uart device 2022-07-19 16:00:47 -07:00
prj_usb.conf samples: Explicitly disable boot USB device support init at boot 2023-01-10 12:21:10 +01:00
prj_usb_ctf.conf samples: Explicitly disable boot USB device support init at boot 2023-01-10 12:21:10 +01:00
prj_user.conf tracing: Fix tracing_user config 2022-01-11 18:13:18 -05:00
README.rst doc: Migrate subsys/ code samples to new Sphinx extension 2023-09-21 09:28:31 +02:00
sample.yaml samples: tracing: Reenable the percepio test case 2023-10-02 16:17:10 +03: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:`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:

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

or:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: sam_e70_xplained
	: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_posix
	:conf: "prj_native_posix.conf"
	:goals: build
	:compact:

or:

.. zephyr-app-commands::
	:zephyr-app: samples/subsys/tracing
	:board: native_posix
	:conf: "prj_native_posix_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.