selftests/bpf: Adding test for arg dereference in extension trace
authorJiri Olsa <jolsa@kernel.org>
Tue, 29 Sep 2020 12:45:56 +0000 (14:45 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Sep 2020 20:09:24 +0000 (13:09 -0700)
commit17d3f386757609223aa02342d29526daa67efafc
tree4eba22b7e92439c1832a044eeeddd4e8fc8a0c7f
parentf6429476c2012afade24741cc08890371d2842b4
selftests/bpf: Adding test for arg dereference in extension trace

Adding test that setup following program:

  SEC("classifier/test_pkt_md_access")
  int test_pkt_md_access(struct __sk_buff *skb)

with its extension:

  SEC("freplace/test_pkt_md_access")
  int test_pkt_md_access_new(struct __sk_buff *skb)

and tracing that extension with:

  SEC("fentry/test_pkt_md_access_new")
  int BPF_PROG(fentry, struct sk_buff *skb)

The test verifies that the tracing program can
dereference skb argument properly.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/160138355603.48470.9072073357530773228.stgit@toke.dk
tools/testing/selftests/bpf/prog_tests/trace_ext.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_trace_ext.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_trace_ext_tracing.c [new file with mode: 0644]