Lines Matching +full:start +full:- +full:from +full:- +full:bottom
9 The tracing feature provides hooks that permits you to collect data from
10 your application and allows :ref:`tools` running on a host to visualize the inner-working of
13 Every system has application-specific events to trace out. Historically,
16 1. Determining the application-specific payload,
17 2. Choosing suitable serialization-format,
18 3. Writing the on-target serialization code,
20 5. Writing the PC-side deserializer/parser,
21 6. Writing custom ad-hoc tools for filtering and presentation.
29 In fact, I/O varies greatly from system to system. Therefore, it is
32 (bottom Layer) is generic and efficient enough to model these. See the
57 formats. This enables tool reuse, of which line-textual (babeltrace) and
61 See `CTF - A Flexible, High-performance Binary Trace Format
71 --------------------
74 As seen from *I/O taxonomy* section below, a bottom layer may:
76 - perform actions at transaction-start (e.g. mutex-lock),
77 - process each field in some way (e.g. sync-push emit, concat, enqueue to
78 thread-bound FIFO),
79 - perform actions at transaction-stop (e.g. mutex-release, emit of concat
82 CTF Top-Layer Example
83 ----------------------
94 "hello, I was emitted from function: ",
100 internally and statically at compile-time in the bottom-layer.
127 :figclass: align-center
132 library from your application code. This lets you visualize kernel events and application events
137 ---------------------------------------
142 .. code-block:: cfg
149 * Enable :menuselection:`Subsystems and OS Services --> Tracing Support`
150 * Under :menuselection:`Subsystems and OS Services --> Tracing Support --> Tracing Format`, select
158 * **RTT**: Trace streaming via Segger RTT on J-Link debug probes.
159 * **ITM**: Trace streaming via the ITM function on Arm Cortex-M devices.
163 :menuselection:`Modules --> percepio --> TraceRecorder --> Stream Port`.
167 .. code-block:: cfg
177 under :menuselection:`Modules --> percepio --> TraceRecorder --> (Stream Port) Config`.
181 ------------------------------------------
195 .. code-block:: cfg
205 * Enable :menuselection:`Subsystems and OS Services --> Tracing Support`
206 * Under :menuselection:`Subsystems and OS Services --> Tracing Support --> Tracing Format`, select
208 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Recorder Start Mode`, select
209 :guilabel:`Start`
210 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Stream Port`, select
212 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Ring Buffer Config --> Buffer Si…
219 :menuselection:`Subsystems and OS Services --> Tracing Support --> Tracing Configuration`.
221 To view the trace data, the easiest way is to start your debugger (west debug) and run the
227 specified. Open this file in Tracealyzer by selecting :menuselection:`File --> Open --> Open File`.
230 -------------------------------------
232 Tracealyzer has built-in support for SEGGER RTT to receive trace data using a J-Link probe.
236 .. code-block:: cfg
246 * Enable :menuselection:`Subsystems and OS Services --> Tracing Support`
247 * Under :menuselection:`Subsystems and OS Services --> Tracing Support --> Tracing Format`, select
249 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Recorder Start Mode`, select
250 :guilabel:`Start From Host`
251 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Stream Port`, select
253 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> RTT Config`, set the size of the
258 also on onboard J-Link debuggers (they are not as fast as the stand-alone probes).
259 If you are tight on RAM, you may consider reducing this setting. If using a regular J-Link probe
263 See Creating and Loading Traces -> Percepio TraceRecorder -> Using TraceRecorder v4.6 or later ->
267 ----------------------------------
269 This stream port is for Arm Cortex-M devices featuring the ITM unit. It is recommended to use a
273 .. code-block:: cfg
283 * Enable :menuselection:`Subsystems and OS Services --> Tracing Support`
284 * Under :menuselection:`Subsystems and OS Services --> Tracing Support --> Tracing Format`, select
286 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Recorder Start Mode`, select
287 :guilabel:`Start`
288 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Stream Port`, select
290 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> ITM Config`, set the ITM port to
293 The main setting for the ITM stream port is the ITM port (0-31). A dedicated channel is needed
299 The host-side setup depends on what debug probe you are using. Learn more in the Tracealyzer
301 …menuselection:`Creating and Loading Traces --> Percepio TraceRecorder --> Using TraceRecorder v4.6…
303 Tracealyzer Streaming from QEMU (Semihost)
304 ------------------------------------------
310 .. code-block:: cfg
320 * Enable :menuselection:`General Architecture Options --> Semihosting support for Arm and RISC-V ta…
321 * Enable :menuselection:`Subsystems and OS Services --> Tracing Support`
322 * Under :menuselection:`Subsystems and OS Services --> Tracing Support --> Tracing Format`, select
324 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Recorder Start Mode`, select
325 :guilabel:`Start`
326 * Under :menuselection:`Modules --> percepio --> TraceRecorder --> Stream Port`, select
331 :menuselection:`File --> Open --> Open File`.
333 Recorder Start Mode
334 -------------------
336 You may have noticed the :guilabel:`Recorder Start Mode` option in the Tracealyzer examples above.
337 This decides when the tracing starts. With the option :guilabel:`Start`, the tracing begins directly
341 For streaming via RTT or ITM you may also use :guilabel:`Start From Host` or
342 :guilabel:`Start Await Host`. Both listens for start commands from the Tracealyzer application. The
343 latter option, :guilabel:`Start Await Host`, causes the TraceRecorder initialization to block until
344 the start command is received from the Tracealyzer application.
347 -----------------------------------
350 output the trace data and (optionally) how to read start/stop commands from Tracealyzer.
357 -------------
367 Zephyr provides built-in support for `SEGGER SystemView`_ that can be enabled in
376 :ref:`snippet-rtt-tracing` to your build command:
378 .. zephyr-app-commands::
379 :zephyr-app: samples/synchronization
381 :snippets: rtt-tracing
385 SystemView can also be used for post-mortem tracing, which can be enabled with
388 latest data from the internal RAM buffer can be loaded into SystemView.
393 :figclass: align-center
396 .. _SEGGER SystemView: https://www.segger.com/products/development-tools/systemview/
416 `Advanced Trouble-shooting Of Real-time Systems
420 User-Defined Tracing
428 - simple toggling of GPIO for external scope tracing while minimizing extra cpu load
429 - generating/outputting trace data in a non-standard or proprietary format that can
434 .. code-block:: c
473 .. zephyr-app-commands::
475 :zephyr-app: samples/subsys/tracing
477 :gen-args: -DCONF_FILE=prj_native_ctf.conf
480 You can then run the resulting binary with the option ``-trace-file`` to generate
485 ./build/zephyr/zephyr.exe -trace-file=data/channel0_0
497 Then thanks to a runtime debugger such as gdb this buffer can be fetched from the target
508 Currently, the top-layer provided here is quite simple and bare-bones,
509 and needlessly copied from Zephyr's Segger SystemView debug module.
511 For an OS like Zephyr, it would make sense to draw inspiration from
512 Linux's LTTng and change the top-layer to serialize to the same format.
514 for Linux. Alternatively, LTTng-analyses in TraceCompass could be
516 visibility of Zephyr in a target-agnostic and open source way.
522 - Atomic Push/Produce/Write/Enqueue:
524 - synchronous:
525 means data-transmission has completed with the return of the
528 - asynchronous:
529 means data-transmission is pending or ongoing with the return
533 - buffered:
534 means data-transmissions are copied and grouped together to
536 dequeue) or jitter-mitigation (steady dequeue).
539 - sync unbuffered
544 - sync buffered
546 Blockingly burst the FIFO when its buffer-waterlevel exceeds threshold.
549 - async unbuffered
550 E.g. DMA, or zero-copying in shared memory.
553 - async buffered
558 - Atomic Pull/Consume/Read/Dequeue:
560 - synchronous:
561 means data-reception has completed with the return of the call.
563 - asynchronous:
564 means data-reception is pending or ongoing with the return of
568 - buffered:
569 means data is copied-in in larger chunks than request-size.
570 Usually for amortizing wait-time.
573 - sync unbuffered
574 E.g. Blocking read-call, ``fread()`` or SPI-read, zero-copying in shared
577 - sync buffered
578 E.g. Blocking read-call with caching applied.
581 - async unbuffered
582 E.g. zero-copying in shared memory.
585 - async buffered
593 - The system has non-atomic write and one shared channel
598 - The system has non-atomic write but many channels
599 E.g. Multi-UART. Lock-free if the bottom-layer maps each Zephyr
605 - The system has atomic write but one shared channel
612 - The system has atomic write and many channels
613 E.g. native_sim or board with multi-channel DMA. Lock-free.
635 Those global variables are the head of each list - they can be traversed