aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f3422121d858..430a195b8589 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -51,6 +51,7 @@ static int verbose;
51static int modules; 51static int modules;
52 52
53static int full_paths; 53static int full_paths;
54static int show_nr_samples;
54 55
55static unsigned long page_size; 56static unsigned long page_size;
56static unsigned long mmap_window = 32; 57static unsigned long mmap_window = 32;
@@ -1024,6 +1025,13 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
1024 else 1025 else
1025 ret = fprintf(fp, field_sep ? "%lld" : "%12lld ", self->count); 1026 ret = fprintf(fp, field_sep ? "%lld" : "%12lld ", self->count);
1026 1027
1028 if (show_nr_samples) {
1029 if (field_sep)
1030 fprintf(fp, "%c%lld", *field_sep, self->count);
1031 else
1032 fprintf(fp, "%11lld", self->count);
1033 }
1034
1027 list_for_each_entry(se, &hist_entry__sort_list, list) { 1035 list_for_each_entry(se, &hist_entry__sort_list, list) {
1028 if (se->elide) 1036 if (se->elide)
1029 continue; 1037 continue;
@@ -1361,6 +1369,12 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
1361 fprintf(fp, "#\n"); 1369 fprintf(fp, "#\n");
1362 1370
1363 fprintf(fp, "# Overhead"); 1371 fprintf(fp, "# Overhead");
1372 if (show_nr_samples) {
1373 if (field_sep)
1374 fprintf(fp, "%cSamples", *field_sep);
1375 else
1376 fputs(" Samples ", fp);
1377 }
1364 list_for_each_entry(se, &hist_entry__sort_list, list) { 1378 list_for_each_entry(se, &hist_entry__sort_list, list) {
1365 if (se->elide) 1379 if (se->elide)
1366 continue; 1380 continue;
@@ -1388,6 +1402,8 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
1388 goto print_entries; 1402 goto print_entries;
1389 1403
1390 fprintf(fp, "# ........"); 1404 fprintf(fp, "# ........");
1405 if (show_nr_samples)
1406 fprintf(fp, " ..........");
1391 list_for_each_entry(se, &hist_entry__sort_list, list) { 1407 list_for_each_entry(se, &hist_entry__sort_list, list) {
1392 unsigned int i; 1408 unsigned int i;
1393 1409
@@ -1979,6 +1995,8 @@ static const struct option options[] = {
1979 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"), 1995 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"),
1980 OPT_BOOLEAN('m', "modules", &modules, 1996 OPT_BOOLEAN('m', "modules", &modules,
1981 "load module symbols - WARNING: use only with -k and LIVE kernel"), 1997 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1998 OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples,
1999 "Show a column with the number of samples"),
1982 OPT_STRING('s', "sort", &sort_order, "key[,key2...]", 2000 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
1983 "sort by key(s): pid, comm, dso, symbol, parent"), 2001 "sort by key(s): pid, comm, dso, symbol, parent"),
1984 OPT_BOOLEAN('P', "full-paths", &full_paths, 2002 OPT_BOOLEAN('P', "full-paths", &full_paths,