Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234532
b: refs/heads/master
c: 6547250
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Mar 10, 2011
1 parent 5490749 commit e02a18b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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: b9a46bba88001504235459c8410f17e6a7e38008
refs/heads/master: 6547250381eb315acff3d52b4872ad775359407c
20 changes: 17 additions & 3 deletions trunk/tools/perf/util/top.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,23 @@ size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size)
if (!top->display_weighted) {
ret += SNPRINTF(bf + ret, size - ret, "%s",
event_name(top->sym_evsel));
} else list_for_each_entry(counter, &top->evlist->entries, node) {
ret += SNPRINTF(bf + ret, size - ret, "%s%s",
counter->idx ? "/" : "", event_name(counter));
} else {
/*
* Don't let events eat all the space. Leaving 30 bytes
* for the rest should be enough.
*/
size_t last_pos = size - 30;

list_for_each_entry(counter, &top->evlist->entries, node) {
ret += SNPRINTF(bf + ret, size - ret, "%s%s",
counter->idx ? "/" : "",
event_name(counter));
if (ret > last_pos) {
sprintf(bf + last_pos - 3, "..");
ret = last_pos - 1;
break;
}
}
}

ret += SNPRINTF(bf + ret, size - ret, "], ");
Expand Down

0 comments on commit e02a18b

Please sign in to comment.