Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269043
b: refs/heads/master
c: 3f2728b
h: refs/heads/master
i:
  269041: 9772a87
  269039: c4de203
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Oct 7, 2011
1 parent d0e2566 commit befdbc7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef9dfe6ec3e409b68e35c05b882d636140bb3fa7
refs/heads/master: 3f2728bdb6a4cad0d18b09d03e2008121c902751
2 changes: 2 additions & 0 deletions trunk/tools/perf/Documentation/perf-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ OPTIONS
-M::
--disassembler-style=:: Set disassembler style for objdump.

--show-total-period:: Show a column with the sum of periods.

SEE ALSO
--------
linkperf:perf-stat[1]
2 changes: 2 additions & 0 deletions trunk/tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ static const struct option options[] = {
OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
"Specify disassembler style (e.g. -M intel for intel syntax)"),
OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
"Show a column with the sum of periods"),
OPT_END()
};

Expand Down
19 changes: 19 additions & 0 deletions trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,13 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size,
ret += snprintf(s + ret, size - ret, "%11" PRIu64, nr_events);
}

if (symbol_conf.show_total_period) {
if (sep)
ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period);
else
ret += snprintf(s + ret, size - ret, " %12" PRIu64, period);
}

if (pair_hists) {
char bf[32];
double old_percent = 0, new_percent = 0, diff;
Expand Down Expand Up @@ -770,6 +777,13 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
fputs(" Samples ", fp);
}

if (symbol_conf.show_total_period) {
if (sep)
ret += fprintf(fp, "%cPeriod", *sep);
else
ret += fprintf(fp, " Period ");
}

if (symbol_conf.show_cpu_utilization) {
if (sep) {
ret += fprintf(fp, "%csys", *sep);
Expand Down Expand Up @@ -834,6 +848,8 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
fprintf(fp, "# ........");
if (symbol_conf.show_nr_samples)
fprintf(fp, " ..........");
if (symbol_conf.show_total_period)
fprintf(fp, " ............");
if (pair) {
fprintf(fp, " ..........");
if (show_displacement)
Expand Down Expand Up @@ -917,6 +933,9 @@ unsigned int hists__sort_list_width(struct hists *hists)
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);
Expand Down
1 change: 1 addition & 0 deletions trunk/tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct symbol_conf {
use_modules,
sort_by_name,
show_nr_samples,
show_total_period,
use_callchain,
exclude_other,
show_cpu_utilization,
Expand Down

0 comments on commit befdbc7

Please sign in to comment.