Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155716
b: refs/heads/master
c: e3d7e18
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jul 11, 2009
1 parent 0e82333 commit 30b2c77
Show file tree
Hide file tree
Showing 3 changed files with 22 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: a25e46c46311316cd1b3f27f8bb036df1693c032
refs/heads/master: e3d7e183dc276df2fcaf02af173a49ad119ba9f9
3 changes: 3 additions & 0 deletions trunk/tools/perf/Documentation/perf-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ OPTIONS
--dsos=::
Only consider symbols in these dsos. CSV that understands
file://filename entries.
-n
--show-nr-samples
Show the number of samples for each symbol
-C::
--comms=::
Only consider symbols in these comms. CSV that understands
Expand Down
18 changes: 18 additions & 0 deletions trunk/tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static int verbose;
static int modules;

static int full_paths;
static int show_nr_samples;

static unsigned long page_size;
static unsigned long mmap_window = 32;
Expand Down Expand Up @@ -1024,6 +1025,13 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
else
ret = fprintf(fp, field_sep ? "%lld" : "%12lld ", self->count);

if (show_nr_samples) {
if (field_sep)
fprintf(fp, "%c%lld", *field_sep, self->count);
else
fprintf(fp, "%11lld", self->count);
}

list_for_each_entry(se, &hist_entry__sort_list, list) {
if (se->elide)
continue;
Expand Down Expand Up @@ -1361,6 +1369,12 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
fprintf(fp, "#\n");

fprintf(fp, "# Overhead");
if (show_nr_samples) {
if (field_sep)
fprintf(fp, "%cSamples", *field_sep);
else
fputs(" Samples ", fp);
}
list_for_each_entry(se, &hist_entry__sort_list, list) {
if (se->elide)
continue;
Expand Down Expand Up @@ -1388,6 +1402,8 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
goto print_entries;

fprintf(fp, "# ........");
if (show_nr_samples)
fprintf(fp, " ..........");
list_for_each_entry(se, &hist_entry__sort_list, list) {
unsigned int i;

Expand Down Expand Up @@ -1979,6 +1995,8 @@ static const struct option options[] = {
OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"),
OPT_BOOLEAN('m', "modules", &modules,
"load module symbols - WARNING: use only with -k and LIVE kernel"),
OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples,
"Show a column with the number of samples"),
OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
"sort by key(s): pid, comm, dso, symbol, parent"),
OPT_BOOLEAN('P', "full-paths", &full_paths,
Expand Down

0 comments on commit 30b2c77

Please sign in to comment.