'\" t
.\"     Title: perf-kmem
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 07/31/2026
.\"    Manual: perf Manual
.\"    Source: perf
.\"  Language: English
.\"
.TH "PERF\-KMEM" "1" "07/31/2026" "perf" "perf Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
perf-kmem \- Tool to trace/measure kernel memory properties
.SH "SYNOPSIS"
.sp
.nf
\fIperf kmem\fR [<options>] {record|stat}
.fi
.SH "DESCRIPTION"
.sp
There are two variants of perf kmem:
.sp
.if n \{\
.RS 4
.\}
.nf
\*(Aqperf kmem [<options>] record [<perf\-record\-options>] <command>\*(Aq to
record the kmem events of an arbitrary workload\&. Additional \*(Aqperf
record\*(Aq options may be specified after record, such as \*(Aq\-o\*(Aq to
change the output file name\&.
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\*(Aqperf kmem [<options>] stat\*(Aq to report kernel memory statistics\&.
.fi
.if n \{\
.RE
.\}
.SH "OPTIONS"
.PP
\-i <file>, \-\-input=<file>
.RS 4
For stat, select the input file (default: perf\&.data unless stdin is a fifo)
.RE
.PP
\-f, \-\-force
.RS 4
Don\(cqt do ownership validation
.RE
.PP
\-v, \-\-verbose
.RS 4
Be more verbose\&. (show symbol address, etc)
.RE
.PP
\-\-caller
.RS 4
Show per\-callsite statistics
.RE
.PP
\-\-alloc
.RS 4
Show per\-allocation statistics
.RE
.PP
\-s <key[,key2\&...]>, \-\-sort=<key[,key2\&...]>
.RS 4
Sort the output (default:
\fIfrag,hit,bytes\fR
for slab and
\fIbytes,hit\fR
for page)\&. Available sort keys are
\fIptr, callsite, bytes, hit, pingpong, frag\fR
for slab and
\fIpage, callsite, bytes, hit, order, migtype, gfp\fR
for page\&. This option should be preceded by one of the mode selection options \- i\&.e\&. \-\-slab, \-\-page, \-\-alloc and/or \-\-caller\&.
.RE
.PP
\-l <num>, \-\-line=<num>
.RS 4
Print n lines only
.RE
.PP
\-\-raw\-ip
.RS 4
Print raw ip instead of symbol
.RE
.PP
\-\-slab
.RS 4
Analyze SLAB allocator events\&.
.RE
.PP
\-\-page
.RS 4
Analyze page allocator events
.RE
.PP
\-\-live
.RS 4
Show live page stat\&. The perf kmem shows total allocation stat by default, but this option shows live (currently allocated) pages instead\&. (This option works with \-\-page option only)
.RE
.PP
\-\-time=<start>,<stop>
.RS 4
Only analyze samples within given time window: <start>,<stop>\&. Times have the format seconds\&.microseconds\&. If start is not given (i\&.e\&., time string is
\fI,x\&.y\fR) then analysis starts at the beginning of the file\&. If stop time is not given (i\&.e, time string is
\fIx\&.y,\fR) then analysis goes to end of file\&.
.RE
.SH "SEE ALSO"
.sp
\fBperf-record\fR(1)
