Commit Graph

2 Commits

Author SHA1 Message Date
Jerome Marchand c96f9d6785 selftests/bpf: Migrate from bpf_prog_test_run
Bugzilla: https://bugzilla.redhat.com/2120966

commit 04fcb5f9a104f24278ad849c642cbdf0c8f48453
Author: Delyan Kratunov <delyank@fb.com>
Date:   Wed Feb 2 15:54:20 2022 -0800

    selftests/bpf: Migrate from bpf_prog_test_run

    bpf_prog_test_run is being deprecated in favor of the OPTS-based
    bpf_prog_test_run_opts.
    We end up unable to use CHECK in most cases, so replace usages with
    ASSERT_* calls.

    Signed-off-by: Delyan Kratunov <delyank@fb.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20220202235423.1097270-2-delyank@fb.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2022-10-25 14:57:55 +02:00
Jiri Olsa 17d3f38675 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
2020-09-29 13:09:24 -07:00