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

Feature request: inspect the size (not capacity) of BPF_HASH #4855

Open HouzuoGuo opened 9 months ago

HouzuoGuo commented 9 months ago

Hey, merry Christmas & happy new year!

I’m just experimenting with eBPF atm and often find it handy to inspect the size (not capacity) of a BPF_HASH in a bpf_trace_printk call to determine how many keys there are in a map.