]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: selftest: Use bpf_sk_storage in FENTRY/FEXIT/RAW_TP
authorMartin KaFai Lau <kafai@fb.com>
Thu, 12 Nov 2020 21:13:20 +0000 (13:13 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 13 Nov 2020 02:39:28 +0000 (18:39 -0800)
commit5a24797042d887100b91e876ce0f02ca6eb8186b
tree013d598a2b1901aad298f7358bc1b016e91ed85e
parent4f334710744a40b125634e6ebe16cb2863f8bf1c
bpf: selftest: Use bpf_sk_storage in FENTRY/FEXIT/RAW_TP

This patch tests storing the task's related info into the
bpf_sk_storage by fentry/fexit tracing at listen, accept,
and connect.  It also tests the raw_tp at inet_sock_set_state.

A negative test is done by tracing the bpf_sk_storage_free()
and using bpf_sk_storage_get() at the same time.  It ensures
this bpf program cannot load.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201112211320.2587537-1-kafai@fb.com
tools/testing/selftests/bpf/prog_tests/sk_storage_tracing.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_sk_storage_trace_itself.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c [new file with mode: 0644]