Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169760
b: refs/heads/master
c: 1b145ae
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 23, 2009
1 parent ddfb577 commit 09ed858
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 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: 2890284bcf5c13c10fae8a0c20ad2f575118a092
refs/heads/master: 1b145ae58035f30353d78d25bea665091df9b438
37 changes: 23 additions & 14 deletions trunk/tools/perf/builtin-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,25 +307,34 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)
{
struct rb_node *next;

printf("\n ------------------------------------------------------------------------------\n");
if (is_caller)
printf(" Callsite |");
else
printf(" Alloc Ptr |");
printf(" Total_alloc/Per | Total_req/Per | Hit | Fragmentation\n");
printf(" ------------------------------------------------------------------------------\n");
printf("%.78s\n", graph_dotted_line);
printf("%-28s|", is_caller ? "Callsite": "Alloc Ptr");
printf("Total_alloc/Per | Total_req/Per | Hit | Frag\n");
printf("%.78s\n", graph_dotted_line);

next = rb_first(root);

while (next && n_lines--) {
struct alloc_stat *data;

data = rb_entry(next, struct alloc_stat, node);
struct alloc_stat *data = rb_entry(next, struct alloc_stat,
node);
struct symbol *sym = NULL;
char bf[BUFSIZ];
u64 addr;

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

if (sym != NULL)
snprintf(bf, sizeof(bf), "%s/%Lx", sym->name,
addr - sym->start);
else
snprintf(bf, sizeof(bf), "%#Lx", addr);

printf(" %-16p | %8llu/%-6lu | %8llu/%-6lu | %6lu | %8.3f%%\n",
is_caller ? (void *)(unsigned long)data->call_site :
(void *)(unsigned long)data->ptr,
(unsigned long long)data->bytes_alloc,
printf("%-28s|%8llu/%-6lu |%8llu/%-6lu|%6lu|%8.3f%%\n",
bf, (unsigned long long)data->bytes_alloc,
(unsigned long)data->bytes_alloc / data->hit,
(unsigned long long)data->bytes_req,
(unsigned long)data->bytes_req / data->hit,
Expand Down

0 comments on commit 09ed858

Please sign in to comment.