perf bench uprobe: Add benchmark to test uprobe overhead
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 2 Jun 2023 18:18:27 +0000 (15:18 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 20 Jul 2023 14:31:19 +0000 (11:31 -0300)
commit2df270716447a1024a6c955eed8fa579333dca85
tree5e389e2bfa86a8bf35ef45dd966cf8da4e939eb6
parentfaa4e0da1cbab97aa18bb6562ab32d9f0fc32e82
perf bench uprobe: Add benchmark to test uprobe overhead

This just adds the initial "workload", a call to libc's usleep(1000us)
function:

  $ perf stat --null perf bench uprobe all
  # Running uprobe/baseline benchmark...
  # Executed 1000 usleep(1000) calls
       Total time: 1053533 usecs

   1053.533 usecs/op

   Performance counter stats for 'perf bench uprobe all':

         1.061042896 seconds time elapsed

         0.001079000 seconds user
         0.006499000 seconds sys

  $

More entries will be added using a BPF skel to add various uprobes to
the usleep() function.

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-2-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-bench.txt
tools/perf/bench/Build
tools/perf/bench/bench.h
tools/perf/bench/uprobe.c [new file with mode: 0644]
tools/perf/builtin-bench.c