Skip to main content
Glama
walac

perf-mcp

by walac

perf_report

Generate a ranked overhead histogram from perf.data to identify which functions consume the most CPU time and pinpoint performance bottlenecks.

Instructions

Histogram profiling: shows which functions consumed the most CPU time (or other events) as a ranked overhead table.

This is the primary analysis tool. Use it to answer 'where is time spent?'

Key parameters:

  • sort: columns to group by. Default 'comm,dso,symbol'. Use 'srcline' for source lines, 'pid,tid' for threads, 'dso' for libraries.

  • call_graph: enable callchain. Use 'graph,0.5,caller,function,percent' for a standard caller-based call graph with 0.5% threshold.

  • percent_limit: hide entries below N% (e.g. 1.0 to show only >1%).

  • symbols: filter to specific function(s).

  • dsos: filter to specific DSO(s).

  • time: restrict to time range 'start,stop' in seconds.

  • header_only: show file metadata without the histogram.

  • mem_mode: switch to memory access profiling (needs perf record -d).

  • branch_stack: switch to branch profiling (needs perf record -b).

  • latency: show latency-centric view (needs perf record --latency).

  • children: set to false (--no-children) to show self overhead only.

Output: table with columns like '% overhead | command | DSO | symbol'. Works on any perf.data from perf record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nsNoShow times in nanoseconds
cpuNoList of CPUs to filter
pidNoOnly consider symbols in these PIDs
tidNoOnly consider symbols in these TIDs
dsosNoOnly consider symbols in these DSOs (comma-separated)
sortNoSort by key(s): comm,dso,symbol,parent,cpu,socket,srcline,weight,local_weight,addr,data_src,mem,snoop,tlb,locked,blocked,local_ins_lat,global_ins_lat,local_p_stage_cyc,global_p_stage_cyc,cgroup_id,type,typeoff,symoff,pid,tid,latency,parallelism
timeNoTime span of interest (start,stop) in seconds
commsNoOnly consider symbols in these comms (comma-separated)
forceNoDon't complain, do it
groupNoShow event group information together
inputYesPath to perf.data file
mmapsNoDisplay recorded tasks memory maps
quietNoDo not show any warnings or messages
statsNoDisplay event stats
symfsNoSymbol filesystem root for offline analysis
tasksNoDisplay recorded tasks
fieldsNoOutput field(s): overhead,overhead_sys,overhead_us,overhead_children,overhead_guest,sample,period
headerNoShow data header
inlineNoShow inline function
itraceNoInstruction Tracing options
parentNoRegex filter to identify parent
prefixNoAdd prefix to source file path names
prettyNoPretty printing style key: normal raw
sourceNoInterleave source code with assembly (default on)
asm_rawNoDisplay raw encoding of assembly
latencyNoShow latency-centric profile (requires perf record --latency)
modulesNoLoad module symbols
samplesNoNumber of samples to save per histogram entry
symbolsNoOnly consider these symbols
threadsNoShow per-thread event counters
verboseNoVerbosity level (0-2)
vmlinuxNovmlinux pathname
childrenNoAccumulate callchains of children (default on)
demangleNoSymbol demangling (default on)
invertedNoInverted call graph
kallsymsNokallsyms pathname
mem_modeNoMemory access profile
hierarchyNoShow entries in a hierarchy
max_stackNoMaximum stack depth for callchain parsing
raw_traceNoShow raw trace event output
show_infoNoDisplay extended information about perf.data
call_graphNoCall graph: print_type,threshold[,print_limit],order,sort_key[,branch],value (e.g. 'graph,0.5,caller,function,percent')
percentageNoHow to display percentage
skip_emptyNoDo not display empty events
stitch_lbrNoEnable LBR callgraph stitching
header_onlyNoShow only data header
parallelismNoOnly consider these parallelism levels
branch_stackNoUse branch records for per-branch histogram
percent_typeNoPercent type
prefix_stripNoStrip first N entries of source file path
time_quantumNoTime quantum for time sort key (e.g. '100ms')
total_cyclesNoSort all blocks by 'Sampled Cycles%'
column_widthsNoFixed column widths
disable_orderNoDisable raw trace ordering
exclude_otherNoOnly display entries with parent-match
percent_limitNoDon't show entries under this percent
socket_filterNoOnly show processor socket matching filter
symbol_filterNoOnly show symbols matching filter
branch_historyNoAdd last branch records to call history
dump_raw_traceNoDump raw trace in ASCII
group_sort_idxNoSort output by Nth event in group
ignore_calleesNoRegex of callees to ignore in call graphs
ignore_vmlinuxNoDon't load vmlinux even if found
demangle_kernelNoEnable kernel symbol demangling
field_separatorNoSeparator for columns
hide_unresolvedNoOnly display entries resolved to a symbol
show_nr_samplesNoShow column with sample count
full_source_pathNoShow full source file name path for source lines
show_total_periodNoShow column with sum of periods
disassembler_styleNoDisassembler style (e.g. 'intel')
show_ref_call_graphNoShow callgraph from reference event
show_cpu_utilizationNoShow sample % for different CPU modes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses output format ('table with columns like % overhead | command | DSO | symbol'), prerequisites for special modes ('needs perf record -d', '-b', '--latency'), and important caveats like 'Works on any perf.data.' It does not explicitly address whether the command modifies state, but as an analysis/report tool this is not a major gap.

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

Conciseness4/5

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

The description is long, but it is front-loaded with the core purpose and organized into a 'Key parameters' list. Every line conveys useful information for a complex tool with 72 parameters. It is not as tight as a two-sentence description, but it earns its length by preventing common misuse.

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 high complexity (72 parameters) and no annotations, the description provides a solid orientation: it explains what the tool does, what output to expect, which parameters matter most, and what data prerequisites exist for special modes. It could be more complete by naming sibling alternatives for non-CPU analyses, but it is more than sufficient for common use cases.

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

Parameters5/5

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

Although the schema already covers 100% of parameters, the description adds substantial value by explaining key parameters with practical examples: sort default and useful alternatives, call_graph syntax ('graph,0.5,caller,function,percent'), percent_limit semantics, and mode switches (mem_mode, branch_stack, latency). This goes well beyond the schema's one-line definitions and makes the tool significantly more usable.

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?

Opens with a specific verb and resource: 'Histogram profiling: shows which functions consumed the most CPU time... as a ranked overhead table.' It explicitly positions itself as 'the primary analysis tool' for answering 'where is time spent?', which distinguishes it from sibling perf tools like perf_annotate or perf_mem_report.

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?

Clearly identifies the primary use case: answering 'where is time spent?' and states it works on any perf.data from perf record. It does not explicitly name alternatives or exclusion criteria, but the 'primary analysis tool' framing gives clear context compared to sibling tools. Lacks explicit 'use X instead when' guidance, so not a 5.

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