Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323790
b: refs/heads/master
c: 7e62ef4
h: refs/heads/master
v: v3
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Sep 8, 2012
1 parent d6b2994 commit 3006b9f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 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: 9ffad987ff565999d91fc2783dd77f08094a743b
refs/heads/master: 7e62ef44e89e7b7f2c48090a048f2a5dffa838c7
27 changes: 27 additions & 0 deletions trunk/tools/perf/ui/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,30 @@ int hist_entry__sort_snprintf(struct hist_entry *he, char *s, size_t size,

return ret;
}

/*
* See hists__fprintf to match the column widths
*/
unsigned int hists__sort_list_width(struct hists *hists)
{
struct sort_entry *se;
int i, ret = 0;

for (i = 0; i < PERF_HPP__MAX_INDEX; i++) {
if (!perf_hpp__format[i].cond)
continue;
if (i)
ret += 2;

ret += perf_hpp__format[i].width(NULL);
}

list_for_each_entry(se, &hist_entry__sort_list, list)
if (!se->elide)
ret += 2 + hists__col_len(hists, se->se_width_idx);

if (verbose) /* Addr + origin */
ret += 3 + BITS_PER_LONG / 4;

return ret;
}
33 changes: 0 additions & 33 deletions trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,39 +563,6 @@ void hists__output_resort_threaded(struct hists *hists)
return __hists__output_resort(hists, true);
}

/*
* See hists__fprintf to match the column widths
*/
unsigned int hists__sort_list_width(struct hists *hists)
{
struct sort_entry *se;
int ret = 9; /* total % */

if (symbol_conf.show_cpu_utilization) {
ret += 7; /* count_sys % */
ret += 6; /* count_us % */
if (perf_guest) {
ret += 13; /* count_guest_sys % */
ret += 12; /* count_guest_us % */
}
}

if (symbol_conf.show_nr_samples)
ret += 11;

if (symbol_conf.show_total_period)
ret += 13;

list_for_each_entry(se, &hist_entry__sort_list, list)
if (!se->elide)
ret += 2 + hists__col_len(hists, se->se_width_idx);

if (verbose) /* Addr + origin */
ret += 3 + BITS_PER_LONG / 4;

return ret;
}

static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h,
enum hist_filter filter)
{
Expand Down

0 comments on commit 3006b9f

Please sign in to comment.