aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorBrice Goglin <Brice.Goglin@inria.fr>2009-08-10 09:26:32 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-10 09:48:17 -0400
commit9f8666971185b86615a074bcac67c90fdf8af8bc (patch)
tree65ce554d9f7eea0c4458a1051ea1c1469a51a47f /tools/perf/builtin-report.c
parent8d51327090ac025d7f4ce6c059786b5e93513321 (diff)
perf report: Add raw displaying of per-thread counters
If --pretty=raw is given to perf report -T, it now displays one line per-thread per-counter with the raw event id added. We get: # PID TID Name Raw Count 18608 18609 cache-misses 28e 416744 18608 18609 cache-references 28f 6456792 18608 18608 cache-misses 28e 448219 18608 18608 cache-references 28f 7270244 instead of: # PID TID cache-misses cache-references 18608 18609 416744 6456792 18608 18608 448219 7270244 Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr> Acked-by: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <4A802008.5050409@inria.fr> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 41639182fb3f..2357c66fb91d 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -57,6 +57,9 @@ static int show_nr_samples;
57static int show_threads; 57static int show_threads;
58static struct perf_read_values show_threads_values; 58static struct perf_read_values show_threads_values;
59 59
60static char default_pretty_printing_style[] = "normal";
61static char *pretty_printing_style = default_pretty_printing_style;
62
60static unsigned long page_size; 63static unsigned long page_size;
61static unsigned long mmap_window = 32; 64static unsigned long mmap_window = 32;
62 65
@@ -1401,6 +1404,9 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
1401 size_t ret = 0; 1404 size_t ret = 0;
1402 unsigned int width; 1405 unsigned int width;
1403 char *col_width = col_width_list_str; 1406 char *col_width = col_width_list_str;
1407 int raw_printing_style;
1408
1409 raw_printing_style = !strcmp(pretty_printing_style, "raw");
1404 1410
1405 init_rem_hits(); 1411 init_rem_hits();
1406 1412
@@ -1478,7 +1484,8 @@ print_entries:
1478 free(rem_sq_bracket); 1484 free(rem_sq_bracket);
1479 1485
1480 if (show_threads) 1486 if (show_threads)
1481 perf_read_values_display(fp, &show_threads_values); 1487 perf_read_values_display(fp, &show_threads_values,
1488 raw_printing_style);
1482 1489
1483 return ret; 1490 return ret;
1484} 1491}
@@ -2091,6 +2098,8 @@ static const struct option options[] = {
2091 "Show a column with the number of samples"), 2098 "Show a column with the number of samples"),
2092 OPT_BOOLEAN('T', "threads", &show_threads, 2099 OPT_BOOLEAN('T', "threads", &show_threads,
2093 "Show per-thread event counters"), 2100 "Show per-thread event counters"),
2101 OPT_STRING(0, "pretty", &pretty_printing_style, "key",
2102 "pretty printing style key: normal raw"),
2094 OPT_STRING('s', "sort", &sort_order, "key[,key2...]", 2103 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
2095 "sort by key(s): pid, comm, dso, symbol, parent"), 2104 "sort by key(s): pid, comm, dso, symbol, parent"),
2096 OPT_BOOLEAN('P', "full-paths", &full_paths, 2105 OPT_BOOLEAN('P', "full-paths", &full_paths,