2009-11-24 13:27:11 +08:00
|
|
|
perf-kmem(1)
|
2010-05-05 22:23:27 +08:00
|
|
|
============
|
2009-11-24 13:27:11 +08:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2015-04-06 13:36:10 +08:00
|
|
|
perf-kmem - Tool to trace/measure kernel memory properties
|
2009-11-24 13:27:11 +08:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
[verse]
|
2009-12-10 15:21:57 +08:00
|
|
|
'perf kmem' {record|stat} [<options>]
|
2009-11-24 13:27:11 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2009-12-10 15:21:57 +08:00
|
|
|
There are two variants of perf kmem:
|
2009-11-24 13:27:11 +08:00
|
|
|
|
|
|
|
'perf kmem record <command>' to record the kmem events
|
|
|
|
of an arbitrary workload.
|
|
|
|
|
2009-12-10 15:21:57 +08:00
|
|
|
'perf kmem stat' to report kernel memory statistics.
|
2009-11-24 13:27:11 +08:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
-i <file>::
|
|
|
|
--input=<file>::
|
2011-12-07 17:02:54 +08:00
|
|
|
Select the input file (default: perf.data unless stdin is a fifo)
|
2009-11-24 13:27:11 +08:00
|
|
|
|
2015-03-12 15:32:47 +08:00
|
|
|
-v::
|
|
|
|
--verbose::
|
|
|
|
Be more verbose. (show symbol address, etc)
|
|
|
|
|
2009-12-10 15:21:57 +08:00
|
|
|
--caller::
|
|
|
|
Show per-callsite statistics
|
|
|
|
|
|
|
|
--alloc::
|
|
|
|
Show per-allocation statistics
|
2009-11-24 13:27:11 +08:00
|
|
|
|
|
|
|
-s <key[,key2...]>::
|
|
|
|
--sort=<key[,key2...]>::
|
2015-04-21 12:55:03 +08: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 13:27:11 +08:00
|
|
|
|
|
|
|
-l <num>::
|
|
|
|
--line=<num>::
|
|
|
|
Print n lines only
|
|
|
|
|
|
|
|
--raw-ip::
|
|
|
|
Print raw ip instead of symbol
|
|
|
|
|
2015-04-06 13:36:10 +08: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 12:55:04 +08: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)
|
|
|
|
|
2009-11-24 13:27:11 +08:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
linkperf:perf-record[1]
|