Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abc60bad authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

perf stat: Display length strings of each run for --table option



Adding support to display visual aid 'length strings' to easily spot the
biggest difference in time table.

  $ perf stat -r 10 --table perf bench sched pipe
  ...

   Performance counter stats for './perf bench sched pipe' (5 runs):

             # Table of individual measurements:
             5.189 (-0.293) #
             5.189 (-0.294) #
             5.186 (-0.296) #
             5.663 (+0.181) ##
             6.186 (+0.703) ####

             # Final result:
             5.483 +- 0.198 seconds time elapsed  ( +-  3.62% )

Suggested-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180423090823.32309-9-jolsa@kernel.org


[ Updated 'perf stat --table' man page entry ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e55c14af
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -123,14 +123,14 @@ spreadsheets. Columns are separated by the string specified in SEP.
   Performance counter stats for 'perf bench sched pipe' (5 runs):
   Performance counter stats for 'perf bench sched pipe' (5 runs):


             # Table of individual measurements:
             # Table of individual measurements:
             5.379 (-0.176)
             5.189 (-0.293) #
             5.243 (-0.311)
             5.189 (-0.294) #
             5.238 (-0.317)
             5.186 (-0.296) #
             5.536 (-0.019)
             5.663 (+0.181) ##
             6.377 (+0.823)
             6.186 (+0.703) ####


             # Final result:
             # Final result:
             5.555 +- 0.213 seconds time elapsed  ( +-  3.83% )
             5.483 +- 0.198 seconds time elapsed  ( +-  3.62% )


-G name::
-G name::
--cgroup name::
--cgroup name::
+7 −1
Original line number Original line Diff line number Diff line
@@ -1790,9 +1790,15 @@ static void print_table(FILE *output, int precision, double avg)


	for (idx = 0; idx < run_count; idx++) {
	for (idx = 0; idx < run_count; idx++) {
		double run = (double) walltime_run[idx] / NSEC_PER_SEC;
		double run = (double) walltime_run[idx] / NSEC_PER_SEC;
		int h, n = 1 + abs((int) (100.0 * (run - avg)/run) / 5);


		fprintf(output, " %17.*f (%+.*f)\n",
		fprintf(output, " %17.*f (%+.*f) ",
			precision, run, precision, run - avg);
			precision, run, precision, run - avg);

		for (h = 0; h < n; h++)
			fprintf(output, "#");

		fprintf(output, "\n");
	}
	}


	fprintf(output, "\n%*s# Final result:\n", indent, "");
	fprintf(output, "\n%*s# Final result:\n", indent, "");