s32trace-analyze-timeline
Analyze an S32DS Timeline view .timeline export together with an optional ELF binary and project source tree to answer questions about execution hotspots, function-level sample distributions, time-win
Files1
View on GitHubSKILL.mdskills/s32trace/s32trace-analyze-timeline/SKILL.md
GitHubS32Trace Timeline Analysis
Answers execution-profile questions from an S32DS Timeline view export using up to three
local inputs: the .timeline file, an optional ELF binary (with DWARF debug info), and
an optional project source tree.
When to use
Trigger this skill when the user wants to:
- load a
.timelinefile and get an overview of CPU time distribution - find which functions consume the most CPU cycles (hotspot analysis)
- understand the execution sequence - which functions were called in what order
- zoom into a specific time window (by tick range) and see what ran there
- drill into a single function: per-address sample breakdown and source location
- view a source snippet annotated with per-line sample counts
- understand inlined function instances (
clamp_i32_0x33d83d24etc.)
Do not use this skill to configure S32Trace (use s32trace-create-configuration),
analyze decoded trace CSV events (use s32trace-analyze-trace),
or analyze code coverage from a Flat Profiler export (use s32trace-analyze-coverage).
Available Capabilities
| Type | Name | Purpose |
|---|---|---|
| MCP tool | search_actions |
discover available actions, their input schemas, and descriptions |
| MCP tool | execute_action |
validated dispatcher -- pass action_name + action-specific params |
All timeline operations are routed through execute_action:
| Action name | Required params | Optional params |
|---|---|---|
timeline.load |
timeline_path |
elf_path, source_root, extra_source_roots, label, snippet_window |
timeline.summary |
session_id |
source_name, top_k |
timeline.hotspots |
session_id |
sort_by (samples/time), top_k, source_name |
timeline.function |
session_id, name |
source_name, include_source |
timeline.window |
session_id |
start_tick, end_tick, source_name, top_k |
timeline.sequence |
session_id |
source_name, limit |
timeline.source |
session_id |
symbol, file_hint, line, source_name, snippet_window |
Call search_actions first (or with a focused query such as "timeline load")
to get the full parameter documentation before calling execute_action.
Typical workflow
timeline.load -> returns session_id + load summary
-> timeline.summary (top functions, total samples, timestamp range)
-> timeline.hotspots (ranked by samples or time)
-> timeline.function (per-function detail + source location)
-> timeline.window (zoom into a tick range)
-> timeline.sequence (ordered list of function transitions)
-> timeline.source (source snippet annotated with samples)
Quickstart
- Call
search_actions(query="timeline load")to confirm the action name and input schema. - Ask the user for the
.timelinepath; ELF and source root are optional but enable richer queries (timeline.functionsource location,timeline.source). - Call
execute_action(action_name="timeline.load", params={...}). Recordsession_id-- it is required by every subsequent call. - Unless the user has a specific question, call
execute_action(action_name="timeline.summary", params={"session_id": ...})and presenttotal_samples,timestamp_range, andtop_functions_by_samples.
Workflow
Identify inputs. Confirm from the user:
- Absolute path to the
.timelinefile (timeline_path). Typically at<workspace>/.AnalysisData/<session>/<name>.timeline. - (Optional) Absolute path to the ELF with DWARF debug info (
elf_path). Required fortimeline.functionsource location andtimeline.source. - (Optional) Absolute path to the project source root (
source_root). Required fortimeline.sourceto return annotated source text.
- Absolute path to the
Load the timeline session. Call:
execute_action( action_name = "timeline.load", params = { "timeline_path": "<absolute path to .timeline>", "elf_path": "<absolute path to .elf>", // optional "source_root": "<absolute path to project src>", // optional "label": "my_timeline_session" } )Verify:
function_count > 0,data_row_count > 0. Recordtimestamp_rangefor later use intimeline.window.Get an overview. Call
timeline.summaryunless the user has a precise question. Key fields to present:total_samplesandtimestamp_rangetop_functions_by_samples-- where the CPU spent the most cycles
Answer specific questions.
User question Action to call Key params "Where does the CPU spend most time?" timeline.hotspotssort_by="samples""Show me the hottest functions by time" timeline.hotspotssort_by="time""How many samples did slow_topget?"timeline.functionname="slow_top""Show all instances of clamp_i32"timeline.functionname="clamp_i32""What ran between tick 1000 and 50000?" timeline.windowstart_tick=1000, end_tick=50000"Show me the execution sequence" timeline.sequencelimit=200"Show slow_topsource with samples"timeline.sourcesymbol="slow_top""Show line 42 of workloads.c" timeline.sourcefile_hint="workloads.c", line=42Inline function handling. The timeline function table lists inlined copies under names like
clamp_i32_0x33d83d24. When the user asks aboutclamp_i32:- Call
timeline.function(name="clamp_i32")-- it matches all instances whose name is exactlyclamp_i32or starts withclamp_i32_0x. - Each instance in the
instanceslist has its ownaddress,size, andtotal_samples. - Note that different instances may have very different sample counts because each is a separate copy of the inlined function placed at a different call site.
- Call
Time-window drill-down. Use
timestamp_rangefromtimeline.summaryto orient the user:- Present
[start, end]range with the unit note that it is raw tick counts (unit depends on board timestamp generator configuration). - Let the user pick a sub-range, then call
timeline.windowwith those bounds. - Compare the per-window hotspot list to the full-trace list to show what changed.
- Present
Guardrails
Scope
- All timeline actions are read-only; no file is written, no project is modified, and no S32 Design Studio process is started.
- Do not call configurator actions (
configurator.*) from this skill.
Destructive actions
- None.
timeline.loadwrites only to an in-memory session cache keyed bysession_id; it does not touch any file.
Secrets
- No secrets or PII are involved; no redaction required.
Refuse-and-escalate
timeline.loadreturnserror: report the message verbatim and ask the user to verify the file path.timeline.functionreturnsfound: false: confirm the exact function name usingtimeline.summaryortimeline.hotspotsfirst.timeline.sourcereturnserrorabout missing ELF or source root: ask the user to reload withelf_pathandsource_rootprovided.- Stale
session_id: if an action returns "Timeline session ... not found", the MCP server was restarted; calltimeline.loadagain and record the newsession_id.
Resource limits
- Default
top_kforhotspotsandsummaryis 10. Increase only when the user explicitly asks for more. timeline.sequencedefaultlimitis 100 transitions. Raise only on request.
Validation loop
- After
timeline.load, verifyfunction_count > 0anddata_row_count > 0. - After
timeline.summary, confirmtotal_samples > 0. - Pass criterion:
session_idis in hand, function count and row count are non-zero, and the timestamp range is plausible.
Out of scope
- Creating or editing S32Trace configuration XML (use
s32trace-create-configuration). - Trace event analysis from a decoded CSV (use
s32trace-analyze-trace). - Code coverage analysis from a Flat Profiler export (use
s32trace-analyze-coverage). - Installing or updating S32 Design Studio.
- Compiling, flashing, or debugging firmware.
See Also
search_actions(query="timeline")-- returns the full parameter schema for all 7timeline.*actions.s32trace-analyze-trace-- sibling skill for trace event / timing analysis from CSV.s32trace-analyze-coverage-- sibling skill for code coverage from Flat Profiler.s32trace-create-configuration-- skill for configuring the trace capture.