summaryrefslogtreecommitdiffstats
path: root/samples/bpf/test_overhead_user.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2018-03-28 21:05:39 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2018-03-28 22:55:19 +0200
commit4662a4e53890badf4da17e441606a2885f29d56d (patch)
treef1a09047f3d67d5f6264e7f9b6d94b96eabf7111 /samples/bpf/test_overhead_user.c
parentlibbpf: add bpf_raw_tracepoint_open helper (diff)
downloadlinux-4662a4e53890badf4da17e441606a2885f29d56d.tar.xz
linux-4662a4e53890badf4da17e441606a2885f29d56d.zip
samples/bpf: raw tracepoint test
add empty raw_tracepoint bpf program to test overhead similar to kprobe and traditional tracepoint tests Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'samples/bpf/test_overhead_user.c')
-rw-r--r--samples/bpf/test_overhead_user.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/samples/bpf/test_overhead_user.c b/samples/bpf/test_overhead_user.c
index d291167fd3c7..e1d35e07a10e 100644
--- a/samples/bpf/test_overhead_user.c
+++ b/samples/bpf/test_overhead_user.c
@@ -158,5 +158,17 @@ int main(int argc, char **argv)
unload_progs();
}
+ if (test_flags & 0xC0) {
+ snprintf(filename, sizeof(filename),
+ "%s_raw_tp_kern.o", argv[0]);
+ if (load_bpf_file(filename)) {
+ printf("%s", bpf_log_buf);
+ return 1;
+ }
+ printf("w/RAW_TRACEPOINT\n");
+ run_perf_test(num_cpu, test_flags >> 6);
+ unload_progs();
+ }
+
return 0;
}