Hi XDP-Newbies, I've been working with BPF programs on the XDP and TC hooks and wanted to understand their overhead on the overall packet processing stack. Mainly I'd like to know how many times those programs have run and also how long each execution took. I know that BPF programs can also be used for tracing inside the kernel, so I looked up into bpftrace [1] to help me with this task, so I could start monitoring my programs faster. After browsing through the list of available trace hooks (bpftrace -l) I found a series of kprobes for xdp- and bpf-related functions. At first, however, none of them seem to map directly to an individual program execution. For the TC case, I found the kprobe for cls_bpf_classify(), which seems to be the function that actually runs the BPF program on TC and handles the output. Although it has extra processing compared to the BPF program per se[[, this seemed close enough. However, I didn't find a similar kprobe for the XDP case. I imagine this is so because XDP native runs inside the NIC driver, right? Is there a kprobe that maps to a single XDP program execution, or at least close enough? Or is there a better way to measure and trace TC and XDP programs? Thanks in advance, Matheus Castanho [1] https://github.com/iovisor/bpftrace