988052f4bf
perf bench uprobe: Add uretprobe variant of uprobe benchmarks
...
Name benchmarks with _ret at the end to avoid creating a new set of
benchmarks.
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andrei Vagin <avagin@google.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Kees Kook <keescook@chromium.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: https://lore.kernel.org/r/20240406040911.1603801-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2024-04-12 17:54:02 -03:00
459fee7b50
perf bench uprobe: Remove lib64 from libc.so.6 binary path
...
bpf_program__attach_uprobe_opts will search LD_LIBRARY_PATH and so
specifying `/lib64` is unnecessary and causes failures for libc.so.6
paths like `/lib/x86_64-linux-gnu/libc.so.6`.
Fixes: 7b47623b8c
("perf bench uprobe trace_printk: Add entry attaching an BPF program that does a trace_printk")
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andrei Vagin <avagin@google.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Kees Kook <keescook@chromium.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: https://lore.kernel.org/r/20240406040911.1603801-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2024-04-12 17:54:02 -03:00
da0c884b07
perf bench uprobe: Fix potential use of memory after free
...
Found by clang-tidy:
```
bench/uprobe.c:98:3: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
bench_uprobe_bpf__destroy(skel);
```
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Nick Desaulniers <ndesaulniers@google.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Cc: Huacai Chen <chenhuacai@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: llvm@lists.linux.dev
Cc: Ming Wang <wangming01@loongson.cn >
Cc: Tom Rix <trix@redhat.com >
Cc: bpf@vger.kernel.org
Link: https://lore.kernel.org/r/20231009183920.200859-6-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2023-10-12 10:01:55 -07:00
7b47623b8c
perf bench uprobe trace_printk: Add entry attaching an BPF program that does a trace_printk
...
[root@five ~]# perf bench uprobe all
# Running uprobe/baseline benchmark...
# Executed 1,000 usleep(1000) calls
Total time: 1,053,963 usecs
1,053.963 usecs/op
# Running uprobe/empty benchmark...
# Executed 1,000 usleep(1000) calls
Total time: 1,056,293 usecs +2,330 to baseline
1,056.293 usecs/op 2.330 usecs/op to baseline
# Running uprobe/trace_printk benchmark...
# Executed 1,000 usleep(1000) calls
Total time: 1,056,977 usecs +3,014 to baseline +684 to previous
1,056.977 usecs/op 3.014 usecs/op to baseline 0.684 usecs/op to previous
[root@five ~]#
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-6-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-07-20 11:33:24 -03:00
6af5e4cf3a
perf bench uprobe empty: Add entry attaching an empty BPF program
...
Using libbpf and a BPF skel:
# perf bench uprobe all
# Running uprobe/baseline benchmark...
# Executed 1,000 usleep(1000) calls
Total time: 1,055,618 usecs
1,055.618 usecs/op
# Running uprobe/empty benchmark...
# Executed 1,000 usleep(1000) calls
Total time: 1,057,146 usecs +1,528 to baseline
1,057.146 usecs/op
#
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-5-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-07-20 11:33:02 -03:00
54d811023b
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 >
2023-07-20 11:32:36 -03:00
dded6f615b
perf bench uprobe: Print diff to baseline
...
This is just prep work to show the diff to the unmodified workload.
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-3-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-07-20 11:32:13 -03:00
2df2707164
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 >
2023-07-20 11:31:19 -03:00