Skip to main content
Glama
walac

perf-mcp

by walac

perf_sched_timehist

Generate a timestamped scheduler timeline from perf.data to analyze context switches, runtime, and scheduling delays, revealing when and why tasks were descheduled.

Instructions

Timestamped scheduler timeline showing every context switch with runtime and scheduling delay.

Use this for detailed scheduling analysis -- find when and why tasks were descheduled.

Key parameters:

  • summary: true to show only summary stats (no per-event detail).

  • wakeups: show wakeup events between switches.

  • migrations: show CPU migration events.

  • idle_hist: show idle-time analysis.

  • state: show task state (R/S/D/T) at each switch.

  • call_graph: 'fp' or 'dwarf' for callchain at each switch.

  • with_summary: show both detail and summary.

  • comms: filter to specific task names.

  • time: restrict to time range.

Output: per-event table with timestamp, task, runtime, wait-time, scheduling delay. Requires: perf sched record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nsNoShow times in nanoseconds
cpuNoCPUs to filter
pidNoAnalyze only these PIDs
tidNoAnalyze only these TIDs
nextNoShow next task
timeNoTime span to analyze
commsNoOnly show these comms
forceNoDon't complain, do it
inputYesPath to perf.data file
stateNoShow task state at switch
symfsNoSymbol filesystem root
summaryNoShow summary statistics only
verboseNoVerbosity level (0-2)
vmlinuxNovmlinux pathname
wakeupsNoShow wakeup events
kallsymsNokallsyms pathname
idle_histNoShow idle-related events
max_stackNoMaximum stack depth
show_prioNoShow task priority
call_graphNoCall graph options
cpu_visualNoShow CPU visualization
migrationsNoShow migration events
with_summaryNoShow summary with detailed output
dump_raw_traceNoDump raw trace in ASCII
pre_migrationsNoShow pre-migration events

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the output format ('per-event table with timestamp, task, runtime, wait-time, scheduling delay') and the prerequisite recording command. It also adds nuance to key parameters, such as 'summary: true to show only summary stats (no per-event detail)' and 'call_graph: 'fp' or 'dwarf' for callchain,' providing meaningful behavior beyond what a generic description would offer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: a single-sentence definition, a usage context sentence, a focused bullet list of key parameters, and two short lines for output and requirements. It is front-loaded and avoids redundancy with the schema, making every sentence earn its place without being overly verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (25 parameters) and that the schema fully covers parameter descriptions and an output schema exists, the description provides sufficient context: it identifies the tool's purpose, usage context, key behavioral parameters, output format, and the required perf sched record prerequisite. It could have mentioned direct alternatives, but the 'detailed scheduling analysis' guidance is enough for a capable agent to select this tool appropriately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. However, the description enriches several parameters: summary, wakeups, migrations, idle_hist, state, call_graph, with_summary, comms, and time are each given practical meaning (e.g., 'state: show task state (R/S/D/T) at each switch'). This adds value beyond the schema's brief field descriptions, so a 4 is warranted.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence clearly states the tool produces 'Timestamped scheduler timeline showing every context switch with runtime and scheduling delay,' specifying the resource (context switch timeline) and actions (showing). This distinguishes it from sibling tools like perf_sched_map, perf_sched_latency, and perf_sched_replay, which serve different analysis purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this for detailed scheduling analysis -- find when and why tasks were descheduled,' providing clear context for when to invoke this tool. It also notes the prerequisite 'Requires: perf sched record,' which helps the agent know the required input state, though it does not explicitly call out alternatives or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/walac/perf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server