num_print_iv = 0;
}
-static int get_precision(double num)
-{
- if (num > 1)
- return 0;
-
- return lround(ceil(-log10(num)));
-}
-
-static void print_table(struct perf_stat_config *config,
- FILE *output, int precision, double avg)
+static void print_table(struct perf_stat_config *config, FILE *output, double avg)
{
char tmp[64];
int idx, indent = 0;
- scnprintf(tmp, 64, " %17.*f", precision, avg);
+ scnprintf(tmp, 64, " %17.9f", avg);
while (tmp[indent] == ' ')
indent++;
double run = (double) config->walltime_run[idx] / NSEC_PER_SEC;
int h, n = 1 + abs((int) (100.0 * (run - avg)/run) / 5);
- fprintf(output, " %17.*f (%+.*f) ",
- precision, run, precision, run - avg);
+ fprintf(output, " %17.9f (%+.9f) ", run, run - avg);
for (h = 0; h < n; h++)
fprintf(output, "#");
}
} else {
double sd = stddev_stats(config->walltime_nsecs_stats) / NSEC_PER_SEC;
- /*
- * Display at most 2 more significant
- * digits than the stddev inaccuracy.
- */
- int precision = get_precision(sd) + 2;
if (config->walltime_run_table)
- print_table(config, output, precision, avg);
+ print_table(config, output, avg);
- fprintf(output, " %17.*f +- %.*f seconds time elapsed",
- precision, avg, precision, sd);
+ fprintf(output, " %17.9f +- %.9f seconds time elapsed", avg, sd);
print_noise_pct(config, NULL, sd, avg, /*before_metric=*/false);
}