selftests/bpf: Add tracing tests for walking skb and req.

Add tracing tests for walking skb->sk and req->sk.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/bpf/20230404045029.82870-9-alexei.starovoitov@gmail.com
This commit is contained in:
Alexei Starovoitov 2023-04-03 21:50:29 -07:00 committed by Andrii Nakryiko
parent afeebf9f57
commit 69f41a7877

View File

@ -92,4 +92,20 @@ int BPF_PROG(inet_csk_accept, struct sock *sk, int flags, int *err, bool kern,
return 0;
}
SEC("tp_btf/tcp_retransmit_synack")
int BPF_PROG(tcp_retransmit_synack, struct sock* sk, struct request_sock* req)
{
/* load only test */
bpf_sk_storage_get(&sk_stg_map, sk, 0, 0);
bpf_sk_storage_get(&sk_stg_map, req->sk, 0, 0);
return 0;
}
SEC("tp_btf/tcp_bad_csum")
int BPF_PROG(tcp_bad_csum, struct sk_buff* skb)
{
bpf_sk_storage_get(&sk_stg_map, skb->sk, 0, 0);
return 0;
}
char _license[] SEC("license") = "GPL";