tcpconnlat
libbpf tool: Unrecognized arg#0 type PTR
#477
-
Hi! I am trying to implement a Go frontend for
Note, instead of using -SEC("fentry/tcp_v4_connect")
-int BPF_PROG(tcp_v4_connect, struct sock *sk)
+SEC("kprobe/tcp_v4_connect")
+int BPF_KPROBE(tcp_v4_connect, struct sock *sk)
-SEC("fentry/tcp_rcv_state_process")
-int BPF_PROG(tcp_rcv_state_process, struct sock *sk)
+SEC("kprobe/tcp_rcv_state_process")
+int BPF_KPROBE(tcp_rcv_state_process, struct sock *sk) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Try I don't think you can expect fentry code to work as a kprobe without any further changes. |
Beta Was this translation helpful? Give feedback.
-
Thank you, I will try that!
The reason I decided to see if I thought maybe the issue is similar to iovisor/bcc#3190. SEC("fentry/tcp_rcv_state_process")
int BPF_PROG(tcp_rcv_state_process, struct sock *sk)
{
struct piddata *piddatap;
struct event event = {};
s64 delta;
u64 ts;
if (sk->__sk_common.skc_state != TCP_SYN_SENT)
return 0;
// ...
}
SEC("fentry/tcp_v4_connect")
int BPF_PROG(tcp_v4_connect, struct sock *sk)
{
return trace_connect(sk);
}
SEC("kprobe/tcp_v6_connect")
int BPF_KPROBE(tcp_v6_connect, struct sock *sk)
{
return trace_connect(sk);
} |
Beta Was this translation helpful? Give feedback.
-
It worked out, thank you! |
Beta Was this translation helpful? Give feedback.
Try
master
, it should have fentry support since 35f5e51 cc @mehrdadradI don't think you can expect fentry code to work as a kprobe without any further changes.