diff options
Diffstat (limited to 'tools/perf/builtin-kmem.c')
-rw-r--r-- | tools/perf/builtin-kmem.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 513aa8a55db6..db474bbf3322 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c | |||
@@ -351,6 +351,7 @@ static void __print_result(struct rb_root *root, struct perf_session *session, | |||
351 | int n_lines, int is_caller) | 351 | int n_lines, int is_caller) |
352 | { | 352 | { |
353 | struct rb_node *next; | 353 | struct rb_node *next; |
354 | struct kernel_info *kerninfo; | ||
354 | 355 | ||
355 | printf("%.102s\n", graph_dotted_line); | 356 | printf("%.102s\n", graph_dotted_line); |
356 | printf(" %-34s |", is_caller ? "Callsite": "Alloc Ptr"); | 357 | printf(" %-34s |", is_caller ? "Callsite": "Alloc Ptr"); |
@@ -359,10 +360,16 @@ static void __print_result(struct rb_root *root, struct perf_session *session, | |||
359 | 360 | ||
360 | next = rb_first(root); | 361 | next = rb_first(root); |
361 | 362 | ||
363 | kerninfo = kerninfo__findhost(&session->kerninfo_root); | ||
364 | if (!kerninfo) { | ||
365 | pr_err("__print_result: couldn't find kernel information\n"); | ||
366 | return; | ||
367 | } | ||
362 | while (next && n_lines--) { | 368 | while (next && n_lines--) { |
363 | struct alloc_stat *data = rb_entry(next, struct alloc_stat, | 369 | struct alloc_stat *data = rb_entry(next, struct alloc_stat, |
364 | node); | 370 | node); |
365 | struct symbol *sym = NULL; | 371 | struct symbol *sym = NULL; |
372 | struct map_groups *kmaps = &kerninfo->kmaps; | ||
366 | struct map *map; | 373 | struct map *map; |
367 | char buf[BUFSIZ]; | 374 | char buf[BUFSIZ]; |
368 | u64 addr; | 375 | u64 addr; |
@@ -370,8 +377,8 @@ static void __print_result(struct rb_root *root, struct perf_session *session, | |||
370 | if (is_caller) { | 377 | if (is_caller) { |
371 | addr = data->call_site; | 378 | addr = data->call_site; |
372 | if (!raw_ip) | 379 | if (!raw_ip) |
373 | sym = map_groups__find_function(&session->kmaps, | 380 | sym = map_groups__find_function(kmaps, addr, |
374 | addr, &map, NULL); | 381 | &map, NULL); |
375 | } else | 382 | } else |
376 | addr = data->ptr; | 383 | addr = data->ptr; |
377 | 384 | ||