Skip to contentSkip to conversation

perf stat: Fix multi-run stats

tip:perfcounters/urgent tip-bot for Ingo Molnar 2 participants 3 messages Jun 27, 2009 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  566747e6298289c5cb02d4939cb3abf1c4fe7e5a
Gitweb:     http://git.kernel.org/tip/566747e6298289c5cb02d4939cb3abf1c4fe7e5a
Author:     Ingo Molnar <[email protected]>
AuthorDate: Sat, 27 Jun 2009 06:24:32 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 27 Jun 2009 06:34:37 +0200

perf stat: Fix multi-run stats

In multi-run (-r/--repeat) printouts, print out the noise of the wall-clock average as well.

Also, fix a bug in printing out scaled counters: if it was not scaled then we should not update the average with -1.

Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/builtin-stat.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
tools/perf/builtin-stat.c +11 -4
index cdcd058..52c176c 100644
@@ -353,8 +353,11 @@ static void calc_avg(void)
 				event_res_avg[j]+1, event_res[i][j]+1);
 			update_avg("counter/2", j,
 				event_res_avg[j]+2, event_res[i][j]+2);
-			update_avg("scaled", j,
-				event_scaled_avg + j, event_scaled[i]+j);
+			if (event_scaled[i][j] != -1)
+				update_avg("scaled", j,
+					event_scaled_avg + j, event_scaled[i]+j);
+			else
+				event_scaled_avg[j] = -1;
 		}
 	}
 	runtime_nsecs_avg /= run_count;
@@ -420,9 +423,13 @@ static void print_stat(int argc, const char **argv)
 
 
 	fprintf(stderr, "\n");
-	fprintf(stderr, " %14.9f  seconds time elapsed.\n",
+	fprintf(stderr, " %14.9f  seconds time elapsed",
 			(double)walltime_nsecs_avg/1e9);
-	fprintf(stderr, "\n");
+	if (run_count > 1) {
+		fprintf(stderr, "   ( +- %7.3f%% )",
+			100.0*(double)walltime_nsecs_noise/(double)walltime_nsecs_avg);
+	}
+	fprintf(stderr, "\n\n");
 }
 
 static volatile int signr = -1;
#1 lore raw
Quoted 20 lines · tip-bot for Ingo Molnar
Commit-ID:  566747e6298289c5cb02d4939cb3abf1c4fe7e5a
Gitweb:     http://git.kernel.org/tip/566747e6298289c5cb02d4939cb3abf1c4fe7e5a
Author:     Ingo Molnar <[email protected]>
AuthorDate: Sat, 27 Jun 2009 06:24:32 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 27 Jun 2009 06:34:37 +0200

perf stat: Fix multi-run stats

In multi-run (-r/--repeat) printouts, print out the noise of the wall-clock average as well.

Also, fix a bug in printing out scaled counters: if it was not scaled then we should not update the average with -1.

Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>

Quoted 7 lines
---
 tools/perf/builtin-stat.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

hmm, why you are keep on changing tools/perf/builtin-stat.c you know my patches are in queue which I prepared on your request and send pull request :

http://git.kernel.org/?p=linux/kernel/git/jaswinder/linux-2.6-tip.git;a=commitdiff;h=4e3340cd3087c4228350af04c2fc8f6502eb6ad6

In spite of adding the patches you keep on changing the original file ??

--
JSR

#2 lore raw
Quoted 30 lines · Jaswinder Singh Rajput
Quoted 20 lines · tip-bot for Ingo Molnar
Commit-ID:  566747e6298289c5cb02d4939cb3abf1c4fe7e5a
Gitweb:     http://git.kernel.org/tip/566747e6298289c5cb02d4939cb3abf1c4fe7e5a
Author:     Ingo Molnar <[email protected]>
AuthorDate: Sat, 27 Jun 2009 06:24:32 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 27 Jun 2009 06:34:37 +0200

perf stat: Fix multi-run stats

In multi-run (-r/--repeat) printouts, print out the noise of the wall-clock average as well.

Also, fix a bug in printing out scaled counters: if it was not scaled then we should not update the average with -1.

Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>

Quoted 7 lines
---
 tools/perf/builtin-stat.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
Quoted 8 lines

hmm, why you are keep on changing tools/perf/builtin-stat.c you know my patches are in queue which I prepared on your request and send pull request:

http://git.kernel.org/?p=linux/kernel/git/jaswinder/linux-2.6-tip.git;a=commitdiff;h=4e3340cd3087c4228350af04c2fc8f6502eb6ad6

In spite of adding the patches you keep on changing the original file ??

Two things:

- My changes and your changes do not conflict - i was able to apply your patches on top of my changes.

- I could have applied all three patches of yours but i only applied the first one because the second and third did not implement the feature you are trying to add in an adequate way.

Also, i do not 'request' things from you, i am not your boss. I review patches and i reject patches i find inadequate. You are free to submit new versions - or you are free to not do so. If you submit new versions i will review them too and will merge them or tell why i didnt merge them.

Ingo