mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
perf top: Don't let events to eat up whole header line
Passing multiple events might force out information about pid/tid/cpu. Attached patch leaves 30 characters for this info at the expense of the events' names. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Han Pingtian <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
b9a46bba88
commit
6547250381
1 changed files with 17 additions and 3 deletions
|
|
@ -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, "], ");
|
||||
|
|
|
|||
Loading…
Reference in a new issue