diff options
author | Matt Mullins <mmullins@fb.com> | 2019-04-26 21:49:51 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-04-27 05:04:19 +0300 |
commit | e950e843367d7990b9d7ea964e3c33876d477c4b (patch) | |
tree | 9fe461c7f01adec95c4f66d9a4748afa3348643b /net/bpf | |
parent | 4635b0ae4d26f87cf68dbab6740955dd1ad67cf4 (diff) | |
download | linux-e950e843367d7990b9d7ea964e3c33876d477c4b.tar.xz |
selftests: bpf: test writable buffers in raw tps
This tests that:
* a BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE cannot be attached if it
uses either:
* a variable offset to the tracepoint buffer, or
* an offset beyond the size of the tracepoint buffer
* a tracer can modify the buffer provided when attached to a writable
tracepoint in bpf_prog_test_run
Signed-off-by: Matt Mullins <mmullins@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/bpf')
-rw-r--r-- | net/bpf/test_run.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index 8606e5aef0b6..6c4694ae4241 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -13,6 +13,9 @@ #include <net/sock.h> #include <net/tcp.h> +#define CREATE_TRACE_POINTS +#include <trace/events/bpf_test_run.h> + static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 *retval, u32 *time) { @@ -100,6 +103,7 @@ static int bpf_test_finish(const union bpf_attr *kattr, if (err != -ENOSPC) err = 0; out: + trace_bpf_test_finish(&err); return err; } |