Add ability to use LIBBPF_DEBUG=1 for BPF tests#503
Conversation
gmarler
commented
Jul 1, 2026
- This allows getting BPF verifier debug output when such tests fail
- This allows getting BPF verifier debug output when such tests fail
| Self { | ||
| cache_dir_base: temp_dir(), | ||
| libbpf_debug: false, | ||
| libbpf_debug: std::env::var("LIBBPF_DEBUG").is_ok(), |
There was a problem hiding this comment.
This is false by default as it's a reasonable setting to have unless something it's set on purpose.
I recommend to either manually add it for each test such as it's done in
lightswitch/tests/integration_test.rs
Line 323 in 60048b3
There was a problem hiding this comment.
Sure, can do that - but this keeps the value false by default (and has the benefit of only having to be set in one place with one change - which I thought was a virtue) - one has to set LIBBPF_DEBUG to get a value other than false.
Relatedly, did you want me to change LIBBPF_DEBUG to TEST_DEBUG_BPF, for consistency across the codebase? Or was the intent different?
There was a problem hiding this comment.
I think it's too "magical" to use env vars for things like this, that's why I prefer hardcoding it / selecting it at runtime. The reason for this is that typically env vars are not very well documented.
I think TEST_LIBBPF_DEBUG makes more sense, definitely would be good to have a single env var name for this purpose. But as long as we are consistent on using one name I don't mind too much which one we choose!