Skip to main content
Glama
walac

perf-mcp

by walac

perf_inject

Enhance perf.data files by injecting build IDs, decoding hardware traces, merging scheduler events, or processing JIT data to enable analysis in perf_report and perf_script.

Instructions

Transform a perf.data file: inject build IDs, decode hardware traces, merge scheduler events, or process JIT data. Writes a new perf.data.

Use this as a preprocessing step before perf_report or perf_script.

Key parameters:

  • input: source perf.data path (required).

  • output: destination perf.data path (required).

  • build_ids: inject build-id headers for symbol resolution.

  • itrace: decode hardware traces. Values: 'i0ns' = synthesize instructions, 'b' = synthesize branches, 'c' = synthesize calls, 'e' = synthesize errors.

  • jit: process JIT-compiled code mappings.

  • sched_stat: merge sched_stat and sched_switch events.

Output: writes a new perf.data file, returns path and size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jitNoProcess JIT data and inject JIT code
forceNoDon't complain, do it
inputYesPath to input perf.data file
stripNoUse with --itrace to strip non-synthesized events
itraceNoDecode Instruction Tracing data and inject synthetic events
outputYesPath to output perf.data file
verboseNoVerbosity level
vmlinuxNovmlinux pathname
kallsymsNokallsyms pathname
build_idsNoInject build IDs into the output file
guest_dataNoInject guest data (path to guest perf.data)
guestmountNoGuest OS root file system mount point
sched_statNoMerge sched_stat and sched_switch events
buildid_allNoInject build IDs for all DSOs
ignore_vmlinuxNoDon't load vmlinux even if found
mmap2_buildidsNoInject build IDs in mmap2 events
known_build_idsNoKnown build IDs
convert_callchainNoConvert callchain to dwarf-based
mmap2_buildid_allNoInject build IDs for all mmap2 events
vm_time_correlationNoCorrelate time between host and guest

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool writes a new perf.data file and returns path and size, and it explains the semantics of the itrace values. However, it does not mention side effects like overwriting existing output or the meaning of the force flag, though these are present in the schema.

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 efficient and well-structured: it leads with the core purpose, then a usage note, then a key-parameter list, and finally the output. Each sentence contributes, with no wasted words.

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 (20 params) and the presence of a full output schema, the description covers the essential context: what it does, when to use it, and what it returns. It does not enumerate every parameter, but the schema fills that gap, and the description provides enough for selection and invocation.

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 coverage is 100%, so the baseline is 3. The description adds significant value by detailing itrace option values ('i0ns', 'b', 'c', 'e') with their meanings, and by summarizing the roles of build_ids, jit, and sched_stat parameters more succinctly than the schema.

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 description clearly identifies the tool as a transformer of perf.data files with a specific verb ('Transform') and resource ('perf.data file'), listing concrete operations like injecting build IDs and decoding hardware traces. It also distinguishes itself from sibling tools by positioning it as a preprocessing step before perf_report or perf_script.

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

Usage Guidelines5/5

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

It explicitly states when to use the tool: 'Use this as a preprocessing step before perf_report or perf_script.' This provides clear context and implies that other perf tools are for downstream analysis, not for this injection/transformation step.

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