Open palmtenor opened 7 years ago
Yeah this has always bothered me...if libbcc is linked into a long-lived service then this will be a big problem. One could always run the compilation in a child process and hand the fd's back through SCM_RIGHTS.
Do we want to make that a general behavior for BCC (i.e., BPFModule
will start compilation work in new process) or users should be doing that (i.e. users start BPF
/ BPFModule
in new fork)?
Also would the FD_CLOEXEC
flag we use across the stack be a problem if we want to do this "compile in another process" thing?
IMO depends how complicated the code ends up being, and if if there is any usability impact (performance, features). Probably deserves a prototype, but roughly it should fit into the BPFModule class somewhere, maybe with a mode similar to TableStorage (with a private impl
member) that can be switched according to the user's desires.
It seems that LLVM will hard fail and call
exit()
for some failuresThis is bad for continuous profiling / monitoring tool that loads BPF module on-demand. Is it possible we can make it just return error or throw exception, so that the rest of the world can go on even if the BPF program compilation failed?
Example stack: