jpsamaroo / BPFnative.jl

Native Julia codegen for eBPF bytecode
Other
9 stars 1 forks source link

Add compile-time optional logging for runtime API #9

Open jpsamaroo opened 3 years ago

jpsamaroo commented 3 years ago

Many functions in Julia can throw exceptions, which we can't handle in BPF, but we can detect them and return nothing instead (where the function returns an important value) or do nothing (where the function performs a side-effect). This is better than UB (undefined behavior), but also can make it hard to debug kernels. We should allow users to opt-in to logging to a default buffer which will get printed to stderr automatically by BPFnative. The logging can be disabled by setting an environment variable and re-precompiling BPFnative.