Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169763
b: refs/heads/master
c: 7707b6b
h: refs/heads/master
i:
  169761: f1292c3
  169759: ddfb577
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Nov 24, 2009
1 parent 7384191 commit 8dcc5c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee3d250446f1c1be4eceab48f3a23794d9a6564c
refs/heads/master: 7707b6b6f8d9188b612f9fc88c65411264b1ed57
18 changes: 10 additions & 8 deletions trunk/tools/perf/builtin-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@ sort_fn_t caller_sort_fn;
static int alloc_lines = -1;
static int caller_lines = -1;

static bool raw_ip;

static char *cwd;
static int cwdlen;

struct alloc_stat {
union {
struct {
char *name;
u64 call_site;
};
u64 call_site;
u64 ptr;
};
u64 bytes_req;
Expand Down Expand Up @@ -323,12 +322,14 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)

if (is_caller) {
addr = data->call_site;
sym = kernel_maps__find_symbol(addr, NULL, NULL);
if (!raw_ip)
sym = kernel_maps__find_symbol(addr,
NULL, NULL);
} else
addr = data->ptr;

if (sym != NULL)
snprintf(bf, sizeof(bf), "%s/%Lx", sym->name,
snprintf(bf, sizeof(bf), "%s+%Lx", sym->name,
addr - sym->start);
else
snprintf(bf, sizeof(bf), "%#Lx", addr);
Expand All @@ -345,9 +346,9 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)
}

if (n_lines == -1)
printf(" ... | ... | ... | ... | ... \n");
printf(" ... | ... | ... | ... | ... \n");

printf(" ------------------------------------------------------------------------------\n");
printf("%.78s\n", graph_dotted_line);
}

static void print_summary(void)
Expand Down Expand Up @@ -558,6 +559,7 @@ static const struct option kmem_options[] = {
OPT_CALLBACK('l', "line", NULL, "num",
"show n lins",
parse_line_opt),
OPT_BOOLEAN(0, "raw-ip", &raw_ip, "show raw ip instead of symbol"),
OPT_END()
};

Expand Down

0 comments on commit 8dcc5c7

Please sign in to comment.