aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-kmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-kmem.c')
-rw-r--r--tools/perf/builtin-kmem.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 256d18fa0471..1ef43c212d9a 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -32,15 +32,14 @@ sort_fn_t caller_sort_fn;
32static int alloc_lines = -1; 32static int alloc_lines = -1;
33static int caller_lines = -1; 33static int caller_lines = -1;
34 34
35static bool raw_ip;
36
35static char *cwd; 37static char *cwd;
36static int cwdlen; 38static int cwdlen;
37 39
38struct alloc_stat { 40struct alloc_stat {
39 union { 41 union {
40 struct { 42 u64 call_site;
41 char *name;
42 u64 call_site;
43 };
44 u64 ptr; 43 u64 ptr;
45 }; 44 };
46 u64 bytes_req; 45 u64 bytes_req;
@@ -323,12 +322,14 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)
323 322
324 if (is_caller) { 323 if (is_caller) {
325 addr = data->call_site; 324 addr = data->call_site;
326 sym = kernel_maps__find_symbol(addr, NULL, NULL); 325 if (!raw_ip)
326 sym = kernel_maps__find_symbol(addr,
327 NULL, NULL);
327 } else 328 } else
328 addr = data->ptr; 329 addr = data->ptr;
329 330
330 if (sym != NULL) 331 if (sym != NULL)
331 snprintf(bf, sizeof(bf), "%s/%Lx", sym->name, 332 snprintf(bf, sizeof(bf), "%s+%Lx", sym->name,
332 addr - sym->start); 333 addr - sym->start);
333 else 334 else
334 snprintf(bf, sizeof(bf), "%#Lx", addr); 335 snprintf(bf, sizeof(bf), "%#Lx", addr);
@@ -345,9 +346,9 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)
345 } 346 }
346 347
347 if (n_lines == -1) 348 if (n_lines == -1)
348 printf(" ... | ... | ... | ... | ... \n"); 349 printf(" ... | ... | ... | ... | ... \n");
349 350
350 printf(" ------------------------------------------------------------------------------\n"); 351 printf("%.78s\n", graph_dotted_line);
351} 352}
352 353
353static void print_summary(void) 354static void print_summary(void)
@@ -558,6 +559,7 @@ static const struct option kmem_options[] = {
558 OPT_CALLBACK('l', "line", NULL, "num", 559 OPT_CALLBACK('l', "line", NULL, "num",
559 "show n lins", 560 "show n lins",
560 parse_line_opt), 561 parse_line_opt),
562 OPT_BOOLEAN(0, "raw-ip", &raw_ip, "show raw ip instead of symbol"),
561 OPT_END() 563 OPT_END()
562}; 564};
563 565