iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

libbpf-tools: add string helpers, filter ksyms by regex #4964

Open myhro opened 5 months ago

myhro commented 5 months ago

The goal is offer the basis of what is required, in terms of regex handling, to implement the C equivalent of what b.attach_kprobe(event_re=...) does in Python. The first client that will be making use of it is a CO-RE port of vfscount:

This could also be useful to, for instance, add regex support to the libbpf-tools/funclatency tool which is currently lacking this feature when compared to the Python version:

https://github.com/iovisor/bcc/blob/c0e9b562675bcd18eff9443af4e0d2cc55e38738/libbpf-tools/funclatency.c#L7-L9