CONFIG_PERCEPIO_RECORDER_TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER

Use Separate User Event Buffer

Type: bool

Help

Set TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER to 1 to enable the
separate user event buffer (UB).
In this mode, user events are stored separately from other events,
e.g., RTOS events. Thereby you can get a much longer history of
user events as they don't need to share the buffer space with more
frequent events.

The UB is typically used with the snapshot ring-buffer mode, so the
recording can continue when the main buffer gets full. And since the
main buffer then overwrites the earliest events, Tracealyzer displays
"Unknown Actor" instead of task scheduling for periods with UB data only.

In UB mode, user events are structured as UB channels, which contains
a channel name and a default format string. Register a UB channel using
xTraceRegisterUBChannel.

Events and data arguments are written using vTraceUBEvent and
vTraceUBData. They are designed to provide efficient logging of
repeating events, using the same format string within each channel.

Examples:
  traceString chn1 = xTraceRegisterString("Channel 1");
  traceString fmt1 = xTraceRegisterString("Event!");
  traceUBChannel UBCh1 = xTraceRegisterUBChannel(chn1, fmt1);

  traceString chn2 = xTraceRegisterString("Channel 2");
  traceString fmt2 = xTraceRegisterString("X: %d, Y: %d");
  traceUBChannel UBCh2 = xTraceRegisterUBChannel(chn2, fmt2);

  // Result in "[Channel 1] Event!"
  vTraceUBEvent(UBCh1);

  // Result in "[Channel 2] X: 23, Y: 19"
  vTraceUBData(UBCh2, 23, 19);

  You can also use the other user event functions, like vTracePrintF.
  as they are then rerouted to the UB instead of the main event buffer.
  vTracePrintF then looks up the correct UB channel based on the
  provided channel name and format string, or creates a new UB channel
  if no match is found. The format string should therefore not contain
  "random" messages but mainly format specifiers. Random strings should
  be stored using %s and with the string as an argument.

  // Creates a new UB channel ("Channel 2", "%Z: %d")
  vTracePrintF(chn2, "%Z: %d", value1);

  // Finds the existing UB channel
  vTracePrintF(chn2, "%Z: %d", value2);

Direct dependencies

PERCEPIO_TRC_RECORDER_MODE_SNAPSHOT && PERCEPIO_TRC_RECORDER_MODE_SNAPSHOT && PERCEPIO_TRACERECORDER

(Includes any dependencies from ifs and menus.)

Default

  • n

Kconfig definition

At /home/runner/work/sdk-nrf/sdk-nrf/ncs/modules/debug/TraceRecorder/kernelports/Zephyr/Kconfig:727

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:31<Zephyr>/modules/Kconfig:6<nRF>/doc/_build/kconfig/Kconfig.modules:80

Menu path: (Top) → Modules → TraceRecorder (/home/runner/work/sdk-nrf/sdk-nrf/ncs/modules/debug/TraceRecorder) → Percepio Trace Recorder → Snapshot Configuration

config PERCEPIO_RECORDER_TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER
    bool "Use Separate User Event Buffer"
    default n
    depends on PERCEPIO_TRC_RECORDER_MODE_SNAPSHOT && PERCEPIO_TRC_RECORDER_MODE_SNAPSHOT && PERCEPIO_TRACERECORDER
    help
      Set TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER to 1 to enable the
      separate user event buffer (UB).
      In this mode, user events are stored separately from other events,
      e.g., RTOS events. Thereby you can get a much longer history of
      user events as they don't need to share the buffer space with more
      frequent events.

      The UB is typically used with the snapshot ring-buffer mode, so the
      recording can continue when the main buffer gets full. And since the
      main buffer then overwrites the earliest events, Tracealyzer displays
      "Unknown Actor" instead of task scheduling for periods with UB data only.

      In UB mode, user events are structured as UB channels, which contains
      a channel name and a default format string. Register a UB channel using
      xTraceRegisterUBChannel.

      Events and data arguments are written using vTraceUBEvent and
      vTraceUBData. They are designed to provide efficient logging of
      repeating events, using the same format string within each channel.

      Examples:
        traceString chn1 = xTraceRegisterString("Channel 1");
        traceString fmt1 = xTraceRegisterString("Event!");
        traceUBChannel UBCh1 = xTraceRegisterUBChannel(chn1, fmt1);

        traceString chn2 = xTraceRegisterString("Channel 2");
        traceString fmt2 = xTraceRegisterString("X: %d, Y: %d");
        traceUBChannel UBCh2 = xTraceRegisterUBChannel(chn2, fmt2);

        // Result in "[Channel 1] Event!"
        vTraceUBEvent(UBCh1);

        // Result in "[Channel 2] X: 23, Y: 19"
        vTraceUBData(UBCh2, 23, 19);

        You can also use the other user event functions, like vTracePrintF.
        as they are then rerouted to the UB instead of the main event buffer.
        vTracePrintF then looks up the correct UB channel based on the
        provided channel name and format string, or creates a new UB channel
        if no match is found. The format string should therefore not contain
        "random" messages but mainly format specifiers. Random strings should
        be stored using %s and with the string as an argument.

        // Creates a new UB channel ("Channel 2", "%Z: %d")
        vTracePrintF(chn2, "%Z: %d", value1);

        // Finds the existing UB channel
        vTracePrintF(chn2, "%Z: %d", value2);

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)