.. 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.
Depends of the boards which you are using, choose one of .conf files for use tracing subsys.
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.
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:
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:
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.
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.
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.
Build a SystemView-tracing image with the :ref:`snippet-rtt-tracing`:
.. zephyr-app-commands:: :zephyr-app: samples/subsys/tracing :board: frdm_k64f :snippets: rtt-tracing :goals: build :compact:
After the application has run for a while, check the trace output file.
Build a GPIO-tracing image with:
.. zephyr-app-commands:: :zephyr-app: samples/subsys/tracing :board: native_sim :conf: "prj_gpio.conf" :goals: build :compact:
After the application has run for a while, check the trace output file.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。