iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

libbpf-tools/syscount: Fix incorrect errno usage #4991

Closed ekyooo closed 4 months ago

ekyooo commented 4 months ago

In read_vals_batch function, the errno set by bpf_map_lookup_and_delete_batch() may change if the next warn() fails. So the errno of read_vals:240 may be incorrect.

bpf_map_lookup_and_delete_batch() already returns errno with a minus added on failure, so used the return value instead of errno.