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

Fix profile.py for older kernels: On pre-5.7 kernels, skip pid ns mapping (fallback) #4974

Closed bernhardkaindl closed 4 months ago

bernhardkaindl commented 5 months ago

Fix profile.py for older kernels:

bpf_get_ns_current_pid_tgid() is not available before Linux 5.7: https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md

When the kernel is prior to 5.7, skip PID namespace translation, as bpf_get_ns_current_pid_tgid() would not be available then.