Skip to main content
Glama
walac

perf-mcp

by walac

perf_kmem_stat

Analyze kernel memory allocation from perf.data, breaking down slab and page allocator activity by callsite to detect leaks, excessive allocators, and fragmentation.

Instructions

Kernel memory allocation statistics: slab and page allocator activity with per-callsite breakdown.

Use this to find excessive allocators, fragmentation, or leaks.

Key parameters:

  • slab: analyze slab allocator (kmalloc/kmem_cache).

  • page: analyze page allocator.

  • caller: show per-callsite statistics.

  • live: show only allocations not yet freed (leak detection).

  • sort: 'ptr', 'callsite', 'bytes_req', 'bytes_alloc', 'hit', 'pingpong', 'frag'.

Output: allocation statistics table. Requires: perf kmem record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineNoPrint N lines only
liveNoShow only live (not-yet-freed) allocations
pageNoAnalyze page allocator events
slabNoAnalyze slab allocator events
sortNoSort by key(s): ptr,callsite,bytes_req,bytes_alloc,hit,pingpong,frag
timeNoTime span to analyze
allocNoShow allocation statistics
forceNoDon't complain, do it
inputYesPath to perf.data file
callerNoShow per-callsite statistics
raw_ipNoPrint raw IP instead of symbol
verboseNoVerbosity level (0-2)

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 burden of disclosure. It adds valuable context: the requirement of a prior 'perf kmem record', the output format (allocation statistics table), and the meaning of key parameters like 'live' for leak detection. It implies a read-only analysis, which is consistent with the tool's nature.

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 tightly structured: purpose statement, use case, key parameters, output, and prerequisite. Every sentence adds value, and it is succinct enough to parse quickly without missing important details.

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?

For a stats tool with an output schema and 12 parameters, the description covers the main behaviors, parameter semantics, output format, and a prerequisite. It is sufficiently complete for an agent to decide when to use it and how to invoke it.

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?

Although schema coverage is 100%, the description enriches key parameters: it explains slab as kmalloc/kmem_cache, page as page allocator, caller as per-callsite, live as not-yet-freed allocations, and lists sort keys. This goes beyond the raw schema descriptions.

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 states the tool provides kernel memory allocation statistics with slab and page allocator activity and per-callsite breakdown. This is a specific verb+resource that distinguishes it from sibling perf commands.

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?

It explicitly tells when to use the tool: 'Use this to find excessive allocators, fragmentation, or leaks.' It also notes a prerequisite ('Requires: perf kmem record'), giving context for invocation, though it does not explicitly name alternative tools or when not to use it.

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