2009-11-24 08:27:11 +03:00
perf-kmem(1)
2010-05-05 18:23:27 +04:00
============
2009-11-24 08:27:11 +03:00
NAME
----
2015-04-06 08:36:10 +03:00
perf-kmem - Tool to trace/measure kernel memory properties
2009-11-24 08:27:11 +03:00
SYNOPSIS
--------
[verse]
2021-09-23 00:20:31 +03:00
'perf kmem' [<options>] {record|stat}
2009-11-24 08:27:11 +03:00
DESCRIPTION
-----------
2009-12-10 10:21:57 +03:00
There are two variants of perf kmem:
2009-11-24 08:27:11 +03:00
2021-09-23 00:20:31 +03:00
'perf kmem [<options>] record [<perf-record-options>] <command>' to
record the kmem events of an arbitrary workload. Additional 'perf
record' options may be specified after record, such as '-o' to
change the output file name.
2009-11-24 08:27:11 +03:00
2021-09-23 00:20:31 +03:00
'perf kmem [<options>] stat' to report kernel memory statistics.
2009-11-24 08:27:11 +03:00
OPTIONS
-------
-i <file>::
--input=<file>::
2021-09-23 00:20:31 +03:00
For stat, select the input file (default: perf.data unless stdin is a
fifo)
2009-11-24 08:27:11 +03:00
2018-02-11 23:38:36 +03:00
-f::
--force::
Don't do ownership validation
2015-03-12 10:32:47 +03:00
-v::
--verbose::
Be more verbose. (show symbol address, etc)
2009-12-10 10:21:57 +03:00
--caller::
Show per-callsite statistics
--alloc::
Show per-allocation statistics
2009-11-24 08:27:11 +03:00
-s <key[,key2...]>::
--sort=<key[,key2...]>::
2015-04-21 07:55:03 +03:00
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.
2009-11-24 08:27:11 +03:00
-l <num>::
--line=<num>::
Print n lines only
--raw-ip::
Print raw ip instead of symbol
2015-04-06 08:36:10 +03:00
--slab::
Analyze SLAB allocator events.
--page::
Analyze page allocator events
perf kmem: Add --live option for current allocation stat
Currently 'perf kmem stat --page' shows total (page) allocation stat by
default, but sometimes one might want to see live (total alloc-only)
requests/pages only. The new --live option does this by subtracting freed
allocation from the stat.
E.g.:
# perf kmem stat --page
SUMMARY (page allocator)
========================
Total allocation requests : 988,858 [ 4,045,368 KB ]
Total free requests : 886,484 [ 3,624,996 KB ]
Total alloc+freed requests : 885,969 [ 3,622,628 KB ]
Total alloc-only requests : 102,889 [ 422,740 KB ]
Total free-only requests : 515 [ 2,368 KB ]
Total allocation failures : 0 [ 0 KB ]
Order Unmovable Reclaimable Movable Reserved CMA/Isolated
----- ------------ ------------ ------------ ------------ ------------
0 172,173 3,083 806,686 . .
1 284 . . . .
2 6,124 58 . . .
3 114 335 . . .
4 . . . . .
5 . . . . .
6 . . . . .
7 . . . . .
8 . . . . .
9 . . 1 . .
10 . . . . .
# perf kmem stat --page --live
SUMMARY (page allocator)
========================
Total allocation requests : 988,858 [ 4,045,368 KB ]
Total free requests : 886,484 [ 3,624,996 KB ]
Total alloc+freed requests : 885,969 [ 3,622,628 KB ]
Total alloc-only requests : 102,889 [ 422,740 KB ]
Total free-only requests : 515 [ 2,368 KB ]
Total allocation failures : 0 [ 0 KB ]
Order Unmovable Reclaimable Movable Reserved CMA/Isolated
----- ------------ ------------ ------------ ------------ ------------
0 2,214 3,025 97,156 . .
1 59 . . . .
2 19 58 . . .
3 23 335 . . .
4 . . . . .
5 . . . . .
6 . . . . .
7 . . . . .
8 . . . . .
9 . . . . .
10 . . . . .
#
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Pekka Enberg <penberg@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/1429592107-1807-4-git-send-email-namhyung@kernel.org
[ Added examples to the changeset log ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-04-21 07:55:04 +03:00
--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)
2018-02-11 23:38:36 +03:00
--time=<start>,<stop>::
2016-11-29 20:15:45 +03:00
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 ',x.y') then analysis starts at the beginning of the file. If
stop time is not given (i.e, time string is 'x.y,') then analysis goes
to end of file.
2009-11-24 08:27:11 +03:00
SEE ALSO
--------
linkperf:perf-record[1]