samples/subsys/tracing/README.html · samples/subsys/tracing/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Tracing

Tracing

Backend별 configuration과 host-side trace capture 절차를 연결합니다.

Official pathsamples/subsys/tracing/README.html
Source filesamples/subsys/tracing/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Tracing generic infrastructure, CTF configuration, Devicetree UART 지정과 USB capture를 설명합니다.

Backends

UART · USB · POSIX · USER

Formats

Generic · CTF

Capture

File · USB script

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 0A040A00885A91519C5F7211BAAC9D99224AC9C80E5702AF7A9A42C5AF6C7D3C
.. 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.

Part 3

한국어 전문 번역

이 application은 Zephyr tracing 기능을 시연합니다. Tracing generic infrastructure가 현재 지원하는 backend를 통해 tracing 형식의 packet을 host로 전송합니다.

요구 사항

사용할 board에 따라 tracing subsystem용 .conf file 가운데 하나를 선택해야 합니다. Backend와 output 형식에 맞는 configuration을 함께 지정합니다.

UART Tracing Backend 사용법

다음과 같이 mps2/an521용 UART tracing image를 build합니다.

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

또는 CTF 형식을 사용하는 UART configuration으로 build합니다.

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

필요하다면 Devicetree의 chosen node 아래에 zephyr,tracing-uart property를 설정해야 합니다. 실제 설정 예시는 samples/subsys/tracing/boards/mps2_an521_cpu0.overlay에서 확인할 수 있습니다.

Application을 잠시 실행한 뒤 생성된 trace output file을 확인합니다.

USB Tracing Backend 사용법

다음과 같이 sam_e70_xplained/same70q21용 USB tracing image를 build합니다.

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

또는 CTF 형식을 사용하는 USB configuration으로 build합니다.

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

Serial console에 다음과 같이 threadA와 threadB의 출력이 안정적으로 반복될 때까지 기다립니다.

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

Board의 USB port를 host에 연결한 다음, host에서 scripts/tracing/trace_capture_usb.py script를 실행해 channel output을 수집합니다.

sudo python3 trace_capture_usb.py -v 0x2FE9 -p 0x100 -o channel0_0

USB device의 VID와 PID는 configuration에서 바꿀 수 있습니다. 값을 변경했다면 capture command의 -v와 -p argument도 실제 값에 맞춰 조정합니다.

POSIX Tracing Backend 사용법

다음과 같이 native_sim target용 POSIX tracing image를 build합니다.

west build -b native_sim samples/subsys/tracing

또는 native CTF configuration을 지정해 build합니다.

west build -b native_sim samples/subsys/tracing -- -DCONF_FILE="prj_native_ctf.conf"

Application을 잠시 실행한 뒤 생성된 trace output file을 확인합니다.

USER Tracing Backend 사용법

다음과 같이 qemu_x86용 user-defined tracing image를 build합니다.

west build -b qemu_x86 samples/subsys/tracing -- -DCONF_FILE="prj_user.conf"

Application을 잠시 실행한 뒤 user backend가 기록한 trace output file을 확인합니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.