btf: don't try to load strings when file is empty#1837
Conversation
|
This seems to be a duplicate / alternative PR for https://github.com/cilium/ebpf/pull/1828/files |
That one returns a non-empty list while the file is empty. IMHO, this is a better solution. |
Fixes: cilium#1818 Signed-off-by: therealak12 <[email protected]> Signed-off-by: Lorenz Bauer <[email protected]>
|
Thanks for adding the test, that was useful. Rebased this on main and changed it to use the approach where newStringTable deals with emptiness. |
|
I assumed introducing an outer check on |
|
There are no system calls performed, and function calls are not really measurable at this level. Maybe you mean because the original code did some io.Read? That is gone now. |
I opened this PR to address issue#1818.
In my experience, the problem has been occurring since version v0.19.0 (it does not appear in v0.18.0), specifically for the
aesni_intelkernel module. The error encountered is:I've checked
stat /sys/kernel/btf/aesni_intel. It shows 24 bytes, which is for the BTF header, but it has no content.