diff options
| author | Zhengyu He <[email protected]> | 2011-06-23 20:45:42 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2011-07-01 10:52:40 +0000 |
| commit | 3ae9a34d747f9abf2bcc85dc0e77b951513ccdf2 (patch) | |
| tree | 592baba4f60e156f9b0d596ade75e282ea21f1ab | |
| parent | Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/fre... (diff) | |
| download | kernel-3ae9a34d747f9abf2bcc85dc0e77b951513ccdf2.tar.gz kernel-3ae9a34d747f9abf2bcc85dc0e77b951513ccdf2.zip | |
perf stat: Add noise output for csv mode
Previously, when you want perf-stat to output the statistics in
csv mode, no information of the noise will be printed out.
For example right now we output this --repeat information:
./perf stat -r3 -x, sleep 1
1.164789,task-clock
8,context-switches
0,CPU-migrations
219,page-faults
3337800,cycles
With this patch, the output will be appended with an additional
entry for the noise value:
./perf stat -r3 -x, sleep 1
1.164789,task-clock,3.75%
8,context-switches,75.00%
0,CPU-migrations,100.00%
219,page-faults,0.00%
3337800,cycles,3.36%
Signed-off-by: Zhengyu He <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Venkatesh Pallipadi <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
| -rw-r--r-- | tools/perf/builtin-stat.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 784ed6d6e0d6..1d08c8084cc4 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -517,7 +517,10 @@ static void print_noise_pct(double total, double avg) if (avg) pct = 100.0*total/avg; - fprintf(stderr, " ( +-%6.2f%% )", pct); + if (csv_output) + fprintf(stderr, "%s%.2f%%", csv_sep, pct); + else + fprintf(stderr, " ( +-%6.2f%% )", pct); } static void print_noise(struct perf_evsel *evsel, double avg) @@ -882,13 +885,13 @@ static void print_counter_aggr(struct perf_evsel *counter) else abs_printout(-1, counter, avg); + print_noise(counter, avg); + if (csv_output) { fputc('\n', stderr); return; } - print_noise(counter, avg); - if (scaled) { double avg_enabled, avg_running; |
