Skip to main content
Glama
walac

perf-mcp

by walac

perf_lock_report

Identify the most contended locks in a Linux system by analyzing per-lock statistics like acquired count, contended count, and wait times from perf lock data.

Instructions

Lock statistics: acquired count, contended count, and wait times per lock.

Use this to find the most contended locks in the system.

Key parameters:

  • sort: sort by 'acquired', 'contended', 'avg_wait', 'wait_total', 'wait_max', 'wait_min'.

  • type_filter: filter by lock type -- 'spinlock', 'mutex', 'rwsem:R', 'rwsem:W'.

  • threads: show per-thread breakdown.

  • combine_locks: group locks by caller.

Output: per-lock statistics table. Requires: perf lock record or lock tracepoints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cpuNoCPUs to filter
keyNoSort key for contended locks
pidNoFilter by PID
tidNoFilter by TID
sortNoSort by key(s): acquired,contended,avg_wait,wait_total,wait_max,wait_min
fieldNoOutput field(s)
forceNoDon't complain, do it
inputYesPath to perf.data file
quietNoDo not show any warnings
entriesNoMaximum entries to display
threadsNoShow per-thread stats
verboseNoVerbosity level (0-2)
vmlinuxNovmlinux pathname
kallsymsNokallsyms pathname
lock_filterNoFilter by specific lock addr/name
type_filterNoFilter by lock type
combine_locksNoCombine locks by caller
dump_raw_traceNoDump raw trace in ASCII
field_separatorNoField separator for output

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/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 disclosing behavioral traits. It does mention the output ('per-lock statistics table') and a prerequisite (needs prior lock recording), but it does not explicitly state that the operation is read-only, what happens on missing input, or whether any files are written. This is adequate but leaves some ambiguity.

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 compact and well-structured: it front-loads the primary function, then gives the use case, a few key parameters in bullet-like format, the output shape, and the prerequisite. Each line adds necessary information without unnecessary prose.

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

Completeness5/5

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

Given the tool's complexity (19 parameters, output schema present), the description covers the essential context: what the tool reports, typical use, key parameter options, output format, and required preparatory steps. With an output schema already available, the description need not explain return values, and it provides enough for an agent to select and invoke the 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?

The schema already documents all 19 parameters (100% coverage), so the baseline is 3. The description adds value by highlighting key parameters and giving concrete allowed values for 'sort' (e.g., 'acquired', 'contended', 'avg_wait') and 'type_filter' (e.g., 'spinlock', 'mutex'), plus defining the behavior of 'threads' and 'combine_locks' in plain terms. This goes beyond what the schema states.

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 opens with 'Lock statistics: acquired count, contended count, and wait times per lock,' which clearly names the resource and the metrics reported. The added context 'Use this to find the most contended locks in the system' gives a specific use case that distinguishes it from sibling tools like perf_lock_info or perf_lock_contention.

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 states when to use the tool ('Use this to find the most contended locks in the system') and provides a prerequisite ('Requires: perf lock record or lock tracepoints'). However, it does not explicitly discuss when not to use it or mention alternative tools, so it gets a 4 rather than 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