aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2017-10-05 09:19:23 -0700
committerDavid S. Miller <davem@davemloft.net>2017-10-07 23:05:57 +0100
commit81b9cf8028a17bdbdaa0da80b735b32150d4e89e (patch)
treeb5ec33cc6476e31c8e30c6623e635c6b75be80ae /tools/testing
parentbpf: add helper bpf_perf_prog_read_value (diff)
downloadlinux-dev-81b9cf8028a17bdbdaa0da80b735b32150d4e89e.tar.xz
linux-dev-81b9cf8028a17bdbdaa0da80b735b32150d4e89e.zip
bpf: add a test case for helper bpf_perf_prog_read_value
The bpf sample program trace_event is enhanced to use the new helper to print out enabled/running time. Signed-off-by: Yonghong Song <yhs@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/bpf_helpers.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index c15ca83dbbd9..e25dbf6038cf 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -75,6 +75,9 @@ static int (*bpf_sock_map_update)(void *map, void *key, void *value,
static int (*bpf_perf_event_read_value)(void *map, unsigned long long flags,
void *buf, unsigned int buf_size) =
(void *) BPF_FUNC_perf_event_read_value;
+static int (*bpf_perf_prog_read_value)(void *ctx, void *buf,
+ unsigned int buf_size) =
+ (void *) BPF_FUNC_perf_prog_read_value;
/* llvm builtin functions that eBPF C program may use to