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
| Name | Required | Description | Default |
|---|---|---|---|
| line | No | Print N lines only | |
| live | No | Show only live (not-yet-freed) allocations | |
| page | No | Analyze page allocator events | |
| slab | No | Analyze slab allocator events | |
| sort | No | Sort by key(s): ptr,callsite,bytes_req,bytes_alloc,hit,pingpong,frag | |
| time | No | Time span to analyze | |
| alloc | No | Show allocation statistics | |
| force | No | Don't complain, do it | |
| input | Yes | Path to perf.data file | |
| caller | No | Show per-callsite statistics | |
| raw_ip | No | Print raw IP instead of symbol | |
| verbose | No | Verbosity level (0-2) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |