perf bench uprobe: Show diff to previous
Will be useful to show the incremental overhead as we do more stuff in the BPF program attached to the uprobes. Acked-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andre Fredette <anfredet@redhat.com> Cc: Clark Williams <williams@redhat.com> Cc: Dave Tucker <datucker@redhat.com> Cc: Derek Barbosa <debarbos@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu (Google) <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/lkml/20230719204910.539044-4-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
dded6f615b
commit
54d811023b
@ -36,24 +36,35 @@ static const char * const bench_uprobe_usage[] = {
|
|||||||
|
|
||||||
static int bench_uprobe_format__default_fprintf(const char *name, const char *unit, u64 diff, FILE *fp)
|
static int bench_uprobe_format__default_fprintf(const char *name, const char *unit, u64 diff, FILE *fp)
|
||||||
{
|
{
|
||||||
static u64 baseline;
|
static u64 baseline, previous;
|
||||||
s64 diff_to_baseline = diff - baseline;
|
s64 diff_to_baseline = diff - baseline,
|
||||||
|
diff_to_previous = diff - previous;
|
||||||
int printed = fprintf(fp, "# Executed %'d %s calls\n", loops, name);
|
int printed = fprintf(fp, "# Executed %'d %s calls\n", loops, name);
|
||||||
|
|
||||||
printed += fprintf(fp, " %14s: %'" PRIu64 " %ss", "Total time", diff, unit);
|
printed += fprintf(fp, " %14s: %'" PRIu64 " %ss", "Total time", diff, unit);
|
||||||
|
|
||||||
if (baseline)
|
if (baseline) {
|
||||||
printed += fprintf(fp, " %s%'" PRId64 " to baseline", diff_to_baseline > 0 ? "+" : "", diff_to_baseline);
|
printed += fprintf(fp, " %s%'" PRId64 " to baseline", diff_to_baseline > 0 ? "+" : "", diff_to_baseline);
|
||||||
|
|
||||||
|
if (previous != baseline)
|
||||||
|
fprintf(stdout, " %s%'" PRId64 " to previous", diff_to_previous > 0 ? "+" : "", diff_to_previous);
|
||||||
|
}
|
||||||
|
|
||||||
printed += fprintf(fp, "\n\n %'.3f %ss/op", (double)diff / (double)loops, unit);
|
printed += fprintf(fp, "\n\n %'.3f %ss/op", (double)diff / (double)loops, unit);
|
||||||
|
|
||||||
if (baseline)
|
if (baseline) {
|
||||||
printed += fprintf(fp, " %'.3f %ss/op to baseline", (double)diff_to_baseline / (double)loops, unit);
|
printed += fprintf(fp, " %'.3f %ss/op to baseline", (double)diff_to_baseline / (double)loops, unit);
|
||||||
else
|
|
||||||
|
if (previous != baseline)
|
||||||
|
printed += fprintf(fp, " %'.3f %ss/op to previous", (double)diff_to_previous / (double)loops, unit);
|
||||||
|
} else {
|
||||||
baseline = diff;
|
baseline = diff;
|
||||||
|
}
|
||||||
|
|
||||||
fputc('\n', fp);
|
fputc('\n', fp);
|
||||||
|
|
||||||
|
previous = diff;
|
||||||
|
|
||||||
return printed + 1;
|
return printed + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user