On Tue, Apr 15, 2025 at 12:11:45AM +0800, Jiayuan Chen wrote: > Sockmap has the same high-performance forwarding capability as XDP, but > operates at Layer 7. > > Introduce tracing capability for sockmap, to trace the execution results > of BPF programs without modifying the programs themselves, similar to > the existing trace_xdp_redirect{_map}. > > It is crucial for debugging sockmap programs, especially in production > environments. > > Additionally, the new header file has to be added to bpf_trace.h to > automatically generate tracepoints. > > Test results: > $ echo "1" > /sys/kernel/tracing/events/sockmap/enable > > msg/skb: > ''' > sockmap_redirect: sk=000000000ec02a93, netns=4026531840, inode=318, \ > family=2, protocol=6, prog_id=59, len=8192, type=msg, action=REDIRECT, \ > redirect_type=ingress > > sockmap_redirect: sk=00000000d5d9c931, netns=4026531840, inode=64731, \ > family=2, protocol=6, prog_id=91, len=8221, type=skb, action=REDIRECT, \ > redirect_type=egress > > sockmap_redirect: sk=00000000106fc281, netns=4026531840, inode=64729, \ > family=2, protocol=6, prog_id=94, len=8192, type=msg, action=PASS, \ > redirect_type=none > ''' > > strparser: > ''' > sockmap_strparser: sk=00000000f15fc1c8, netns=4026531840, inode=52396, \ > family=2, protocol=6, prog_id=143, in_len=1000, full_len=10 > ''' > > Suggested-by: Jakub Sitnicki <ja...@cloudflare.com> > Suggested-by: Cong Wang <xiyou.wangc...@gmail.com> > Suggested-by: Steven Rostedt <rost...@goodmis.org> > Signed-off-by: Jiayuan Chen <jiayuan.c...@linux.dev> >
Reviewed-by: Cong Wang <xiyou.wangc...@gmail.com> Thanks!