FEATURES · RUNTIME TRACE

See your firmware run.

When do your functions, tasks and interrupts run, which ones cost the most time, and why was this call slow? Recorded on the microcontroller by KymoCore, shown live in KymoStudio.

Runtime trace
Runtime trace of an ESP32 FreeRTOS demo: task lanes grouped by core 0 and core 1, long calls highlighted in red and a selected process_frame call with nested calls

The problem

A loop is sometimes too slow, a task misses its period, and printing timestamps changes the very timing you want to see. Logic analyzer pins run out quickly and show nothing about which function was busy.

What Kymotrace does

Macros in your firmware record function entries and exits, markers, ISRs and task switches into a bounded buffer. KymoStudio turns them into a timeline, a call tree and statistics – on the same link that carries your measurements.

How it works

  1. 1InstrumentEnable tracing in KymoCore and wrap functions or loop iterations with scope macros. Off by default, compiled out when disabled.
  2. 2Watch the timelineScope spans, markers and gaps per task and core. Select a call to open its function flow.
  3. 3Find the causeSwitch to hotspots: self time, spread, timing of one function and what makes slow calls slow.

Timeline and function flow

Runtime trace

Scope spans, markers and recording gaps on a readable time axis. Very dense windows are drawn as call density.

Function flow

The call tree of one selected call – only its subtree and the markers of its task, linked to the trace by selection and time cursor.

Tasks and ISRs per source

Each source lists its tasks and interrupts with call counts. Click one to filter the timeline.

Grouped by core

On multi-core targets lanes are grouped per CPU core; calls that switched cores are marked.

Record and replay

Save a capture, reopen it, change playback speed and step through events. Export as CSV or Chrome Trace JSON.

Gaps stay visible

Lost or skipped events are marked as gaps instead of being hidden.

Function flow
Function flow of a slow process_frame call on an ESP32 with nested calls and markers

Hotspots and timing

Computed from the entries and exits KymoCore already records – no firmware or protocol change.

Hotspots

Every function with calls, self time, share, typical run time and maximum. As a list or grouped by task.

Spread at a glance

A bar from minimum over typical to p95 and maximum. Functions whose p95 is at least twice the typical time are marked.

Timing of one function

Period, frequency, jitter and load of periodic loops; gaps and run-time percentiles for load-dependent workers.

Every call over time

A scatter of every call shows load phases and outliers. Click a point to open that call in the function flow.

Slow versus typical

Compares the slowest calls with typical ones per called function and shows where the extra time comes from.

Long calls in red

Optionally highlights calls that take more than twice as long as typical for their function.

Hotspots
Hotspots of an ESP32 FreeRTOS trace grouped by task, with spread bars and the timing of one function

In the firmware

Trace macros come with KymoCore. Mainloop firmware works without an RTOS; task and interrupt events add context when your platform port supplies them.

ESP32 FreeRTOS trace demo in KymoProbe →

// contexts and symbols come from the generated profile
void process_frame(void)
{
    KYMO_TRACE_SCOPE(&recorder, KYMO_CONTEXT_MAIN, KYMO_SYMBOL_PROCESS_FRAME);
    parse_payload();
    decompress();
}

Key points

  • Functions, tasks and ISRs on one timeline, per CPU core
  • Hotspots and timing without any firmware change
  • Shares one link with your measurements
  • Off by default, compiled out when disabled

Honest limits

  • Times are wall-clock times on the target; interruptions by other tasks or ISRs are included
  • CPU time per task needs scheduler events from your platform port
  • ISR and scheduler coverage depends on the port; no timing or ISR-safety certification is claimed

Flash the ESP32 trace demo and watch it run.

Download KymoStudio 2.7.0 Quick start