---
name: "perf_4.9-kmem"
section: "1"
platform: "linux"
package: "linux-perf-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/perf_4.9-kmem"
---

# perf\_4.9-kmem(1)

Tool to trace/measure kernel memory properties

## NAME

perf-kmem - Tool to trace/measure kernel memory properties

## SYNOPSIS

```
perf kmem {record|stat} [<options>]
```

## DESCRIPTION

There are two variants of perf kmem:

```
'perf kmem record <command>' to record the kmem events
of an arbitrary workload.
```

```
'perf kmem stat' to report kernel memory statistics.
```

## OPTIONS

- \-i \<file\>, --input=\<file\>

  Select the input file (default: perf.data unless stdin is a fifo)

- \-v, --verbose

  Be more verbose. (show symbol address, etc)

- \--caller

  Show per-callsite statistics

- \--alloc

  Show per-allocation statistics

- \-s \<key\[,key2...\]\>, --sort=\<key\[,key2...\]\>

  Sort the output (default: *frag,hit,bytes* for slab and *bytes,hit* for page). Available sort keys are *ptr, callsite, bytes, hit, pingpong, frag* for slab and *page, callsite, bytes, hit, order, migtype, gfp* for page. This option should be preceded by one of the mode selection options - i.e. --slab, --page, --alloc and/or --caller.

- \-l \<num\>, --line=\<num\>

  Print n lines only

- \--raw-ip

  Print raw ip instead of symbol

- \--slab

  Analyze SLAB allocator events.

- \--page

  Analyze page allocator events

- \--live

  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)

## SEE ALSO

[**perf\_4.9-record**(1)](/perf_4.9-record/1.md)
