aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index cdcd058fac08..52c176cc683e 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -353,8 +353,11 @@ static void calc_avg(void)
353 event_res_avg[j]+1, event_res[i][j]+1); 353 event_res_avg[j]+1, event_res[i][j]+1);
354 update_avg("counter/2", j, 354 update_avg("counter/2", j,
355 event_res_avg[j]+2, event_res[i][j]+2); 355 event_res_avg[j]+2, event_res[i][j]+2);
356 update_avg("scaled", j, 356 if (event_scaled[i][j] != -1)
357 event_scaled_avg + j, event_scaled[i]+j); 357 update_avg("scaled", j,
358 event_scaled_avg + j, event_scaled[i]+j);
359 else
360 event_scaled_avg[j] = -1;
358 } 361 }
359 } 362 }
360 runtime_nsecs_avg /= run_count; 363 runtime_nsecs_avg /= run_count;
@@ -420,9 +423,13 @@ static void print_stat(int argc, const char **argv)
420 423
421 424
422 fprintf(stderr, "\n"); 425 fprintf(stderr, "\n");
423 fprintf(stderr, " %14.9f seconds time elapsed.\n", 426 fprintf(stderr, " %14.9f seconds time elapsed",
424 (double)walltime_nsecs_avg/1e9); 427 (double)walltime_nsecs_avg/1e9);
425 fprintf(stderr, "\n"); 428 if (run_count > 1) {
429 fprintf(stderr, " ( +- %7.3f%% )",
430 100.0*(double)walltime_nsecs_noise/(double)walltime_nsecs_avg);
431 }
432 fprintf(stderr, "\n\n");
426} 433}
427 434
428static volatile int signr = -1; 435static volatile int signr = -1;