Namhyung Kim
0d68bc92c4
perf kmem: Analyze page allocator events also
The perf kmem command records and analyze kernel memory allocation only
for SLAB objects. This patch implement a simple page allocator analyzer
using kmem:mm_page_alloc and kmem:mm_page_free events.
It adds two new options of --slab and --page. The --slab option is for
analyzing SLAB allocator and that's what perf kmem currently does.
The new --page option enables page allocator events and analyze kernel
memory usage in page unit. Currently, 'stat --alloc' subcommand is
implemented only.
If none of these --slab nor --page is specified, --slab is implied.
First run 'perf kmem record' to generate a suitable perf.data file:
# perf kmem record --page sleep 5
Then run 'perf kmem stat' to postprocess the perf.data file:
# perf kmem stat --page --alloc --line 10
-------------------------------------------------------------------------------
PFN | Total alloc (KB) | Hits | Order | Mig.type | GFP flags
-------------------------------------------------------------------------------
4045014 | 16 | 1 | 2 | RECLAIM | 00285250
4143980 | 16 | 1 | 2 | RECLAIM | 00285250
3938658 | 16 | 1 | 2 | RECLAIM | 00285250
4045400 | 16 | 1 | 2 | RECLAIM | 00285250
3568708 | 16 | 1 | 2 | RECLAIM | 00285250
3729824 | 16 | 1 | 2 | RECLAIM | 00285250
3657210 | 16 | 1 | 2 | RECLAIM | 00285250
4120750 | 16 | 1 | 2 | RECLAIM | 00285250
3678850 | 16 | 1 | 2 | RECLAIM | 00285250
3693874 | 16 | 1 | 2 | RECLAIM | 00285250
... | ... | ... | ... | ... | ...
-------------------------------------------------------------------------------
SUMMARY (page allocator)
========================
Total allocation requests : 44,260 [ 177,256 KB ]
Total free requests : 117 [ 468 KB ]
Total alloc+freed requests : 49 [ 196 KB ]
Total alloc-only requests : 44,211 [ 177,060 KB ]
Total free-only requests : 68 [ 272 KB ]
Total allocation failures : 0 [ 0 KB ]
Order Unmovable Reclaimable Movable Reserved CMA/Isolated
----- ------------ ------------ ------------ ------------ ------------
0 32 . 44,210 . .
1 . . . . .
2 . 18 . . .
3 . . . . .
4 . . . . .
5 . . . . .
6 . . . . .
7 . . . . .
8 . . . . .
9 . . . . .
10 . . . . .
Signed-off-by: Namhyung Kim <namhyung@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/1428298576-9785-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-04-13 11:44:52 -03:00
..
2012-10-31 12:17:49 -02:00
2009-06-06 20:33:43 +02:00
2015-02-12 17:53:00 -03:00
2013-07-08 17:37:25 -03:00
2012-08-13 14:55:02 -03:00
2013-10-11 12:18:11 -03:00
2009-06-06 20:33:43 +02:00
2009-06-06 20:33:43 +02:00
2009-06-06 20:33:43 +02:00
2009-06-06 20:33:43 +02:00
2009-06-06 20:33:43 +02:00
2013-03-15 13:06:05 -03:00
2013-12-09 15:21:45 -03:00
2014-06-19 16:13:15 -03:00
2015-02-27 15:52:33 -03:00
2011-12-23 17:01:03 -02:00
2015-02-25 16:13:12 -03:00
2015-03-24 13:01:54 -03:00
2013-01-31 13:07:49 -03:00
2009-06-06 20:33:43 +02:00
2014-07-25 12:08:34 -03:00
2015-04-13 11:44:52 -03:00
2014-10-15 17:39:02 -03:00
2015-04-08 11:00:16 -03:00
2013-10-09 11:24:01 -03:00
2015-01-21 13:24:31 -03:00
2015-02-06 11:46:36 +01:00
2015-04-08 10:04:55 -03:00
2015-03-24 13:02:46 -03:00
2011-12-23 17:01:03 -02:00
2014-10-15 17:39:02 -03:00
2014-10-15 17:39:02 -03:00
2015-03-24 13:02:46 -03:00
2015-01-21 13:24:33 -03:00
2014-10-15 17:39:02 -03:00
2014-07-10 00:22:54 +02:00
2014-09-17 17:08:09 -03:00
2015-02-22 22:22:07 -03:00
2015-02-25 16:13:12 -03:00
2012-05-29 22:06:30 -03:00