You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to free the memory allocated for program log buffers after loading an object. I assume that's safe to do, but I noticed that bpf_program__set_log_buf returns -EBUSY if the object has been loaded, which makes me wonder if it's safe to free the buffers after all.
At what point is it safe to free these buffers? What's the reason bpf_program__set_log_buf doesn't allow setting the log buffer after the object has been loaded? Would it be possible to allow setting the buffer to null to give some reasonable assurance that libbpf isn't holding onto a pointer to the log buffer, so that I can free it?
The text was updated successfully, but these errors were encountered:
It should be safe to free the buffer, libbpf doesn't use this buffer after BPF object is loaded. But it's probably also good to improve bpf_program__set_log_buf() to allow to set buffer to NULL even after bpf_object is loaded. Do you care to submit patch upstream to kernel mailing list?
I'd like to be able to free the memory allocated for program log buffers after loading an object. I assume that's safe to do, but I noticed that
bpf_program__set_log_buf
returns-EBUSY
if the object has been loaded, which makes me wonder if it's safe to free the buffers after all.At what point is it safe to free these buffers? What's the reason
bpf_program__set_log_buf
doesn't allow setting the log buffer after the object has been loaded? Would it be possible to allow setting the buffer to null to give some reasonable assurance that libbpf isn't holding onto a pointer to the log buffer, so that I can free it?The text was updated successfully, but these errors were encountered: