diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-06-02 23:42:47 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-07-20 17:33:02 +0300 |
commit | 6af5e4cf3a6521d23ca53df5001319babefdffbf (patch) | |
tree | c3bb8a6b4be5c2683efafc3cf265692b9dd69116 /tools/perf/util/bpf_skel | |
parent | 54d811023b5f99e658511b577b16a6d7014d162c (diff) | |
download | linux-6af5e4cf3a6521d23ca53df5001319babefdffbf.tar.xz |
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>
Diffstat (limited to 'tools/perf/util/bpf_skel')
-rw-r--r-- | tools/perf/util/bpf_skel/bench_uprobe.bpf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/bpf_skel/bench_uprobe.bpf.c b/tools/perf/util/bpf_skel/bench_uprobe.bpf.c new file mode 100644 index 000000000000..1365dcc5dddf --- /dev/null +++ b/tools/perf/util/bpf_skel/bench_uprobe.bpf.c @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +// Copyright (c) 2023 Red Hat +#include "vmlinux.h" +#include <bpf/bpf_tracing.h> + +SEC("uprobe") +int BPF_UPROBE(empty) +{ + return 0; +} + +char LICENSE[] SEC("license") = "Dual BSD/GPL"; |