Motivation
I'm trying to write a bpftrace program to trace out when a socket is ready for reading by hooking into the kprobe sock_def_readable
. I will get a struct sock
to inspect. I'd like to map it back to the socket I created in user-land.
Question
How does one recover the port number from a struct sock
?