PERF-KMEM(1)
π
PERF-KMEM (from the perf Manual, bestie) β¨
Okay so real talk: perf-kmem is the tool that traces and measures kernel memory properties. She's giving observability main character energy and honestly? Obsessed. π
β¨ SYNOPSIS β¨
perf kmem [<options>] {record|stat}
π¦ DESCRIPTION π¦
There are literally two variants of perf kmem, and you gotta pick your fighter:
'perf kmem [<options>] record [<perf-record-options>] <command>'β this one records the kmem events of an arbitrary workload. And yes, you can sneak extraperf recordoptions in afterrecord, like-oto change the output file name. iykyk π'perf kmem [<options>] stat'β this one reports kernel memory statistics. The chill, read-only vibe. π§
πΈ OPTIONS πΈ
-i <file>,--input=<file>β forstat, this picks the input file (default:perf.dataβ unless stdin is a fifo, girl knows how to improvise π«Ά).-f,--forceβ don't do ownership validation. Just vibes. No questions asked.-v,--verboseβ be more verbose (shows symbol address, etc). She will tell you everything. π--callerβ show per-callsite statistics. Who called whom. The receipts. π₯--allocβ show per-allocation statistics. One at a time, bestie.-s <key[,key2...]>,--sort=<key[,key2...]>β sort the output. Default isfrag,hit,bytesfor slab andbytes,hitfor page. Available sort keys areptr,callsite,bytes,hit,pingpong,fragfor slab, andpage,callsite,bytes,hit,order,migtype,gfpfor page. β οΈ Heads up: this option should be preceded by one of the mode selection options β i.e.--slab,--page,--allocand/or--caller. Don't just raw-dog the sort key, it needs context.-l <num>,--line=<num>β printnlines only. Boundaries! We love them. π--raw-ipβ print raw ip instead of symbol. No translation, just the cold hard number.--slabβ analyze SLAB allocator events. π§--pageβ analyze page allocator events. π--liveβ show live page stat. By defaultperf kmemshows total allocation stat, but this option shows live (currently allocated) pages instead. Note: this one works with the--pageoption only, so don't try it solo, it will not slay. π--time=<start>,<stop>β only analyze samples within the given time window:<start>,<stop>. Times have the formatseconds.microseconds. If start is not given (i.e., the time string is,x.y) then analysis starts at the beginning of the file. If stop time is not given (i.e., the time string isx.y,) then analysis goes to end of file. Open-ended queen. π
π SEE ALSO π
Go forth and measure that kernel memory, bestie. The allocations are quaking. π
That was PERF-KMEM(1) β from the perf manual, dated 10/31/2026, and she's PERF-KMEM(1) shaped, periodt. π¦β¨
π¦ where this page comes from
- arch rolling: perf 7.3.1-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms