I wonder why we evaluate the kernel configuration via bpf_core_type_exists on every time the probe function is called? Couldn't we have cached that value with an static? ie:
Answering my own question: Apparently the branches are resolved by the verifier on load time and dead code is removed. So not needed to worry about performance in those cases.
https://github.com/iovisor/bcc/blob/bc9b43a00b83bcea600b3540c5a6124ebd78a7ff/libbpf-tools/core_fixes.bpf.h#L223-L228
I wonder why we evaluate the kernel configuration via
bpf_core_type_exists
on every time the probe function is called? Couldn't we have cached that value with an static? ie: