diff options
author | John Fastabend <john.fastabend@gmail.com> | 2018-04-23 14:30:38 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-04-25 00:06:20 +0200 |
commit | 16962b2404ac88cde0281fe2176d6ae3820ed320 (patch) | |
tree | 954672926f41481d6cd3af9517c99a15359e0416 /tools/lib/bpf/libbpf.h | |
parent | 5d9ffeae5edc7ae5137059f90715de70c45af553 (diff) | |
download | linux-16962b2404ac88cde0281fe2176d6ae3820ed320.tar.bz2 |
bpf: sockmap, add selftests
This adds a new test program test_sockmap which is the old sample
sockmap program. By moving the sample program here we can now run it
as part of the self tests suite. To support this a populate_progs()
routine is added to load programs and maps which was previously done
with load_bpf_file(). This is needed because self test libs do not
provide a similar routine. Also we now use the cgroup_helpers
routines to manage cgroup use instead of manually creating one and
supplying it to the CLI.
Notice we keep the CLI around though because it is useful for dbg
and specialized testing.
To run use ./test_sockmap and the result should be,
Summary 660 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index d6ac4fa6f472..197f9ce2248c 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -193,6 +193,8 @@ int bpf_program__set_sched_act(struct bpf_program *prog); int bpf_program__set_xdp(struct bpf_program *prog); int bpf_program__set_perf_event(struct bpf_program *prog); void bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type); +void bpf_program__set_expected_attach_type(struct bpf_program *prog, + enum bpf_attach_type type); bool bpf_program__is_socket_filter(struct bpf_program *prog); bool bpf_program__is_tracepoint(struct bpf_program *prog); |