Re: Suggested patch for bpftool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2023-03-06 21:46 UTC+0000 ~ Rae Marks <Raeanne.Marks@xxxxxxxxxxxxx>
> Hello,
>  
> Thank you for your work on bpftool, a great resource.
>  
> I have a legitimate reason why bpftool might fail to open an individual map to dump its information. I would like to submit a patch so that it does not bail from the loop iterating over all maps on the first map error. With this change, one map failing to open would not affect showing information about other maps. Specifically, I’d like to change this line (https://github.com/libbpf/bpftool/blob/master/src/map.c#L699) to be a continue rather than a break.
> 
> How can I submit a patch if you approve of this suggestion? I see that the GitHub mirror of libbpf/bpftool is not the appropriate place, according to the README.
>  
> Thank you!
>  
> Rae Marks
> Senior Software Engineer | Microsoft
>  

Hi Rae,

Thanks for reaching out.

Let me start with how to submit. The GitHub repository is just a mirror
indeed, the sources of bpftool are maintained as part of the Linux
kernel repository. This means that patches should be sent to this
mailing list, please refer to [0] for more details.

Regarding the patch that you propose, I'd welcome a way to keep
iterating if we fail to retrieve the id for the following map, but we
can't just "continue" in the loop if we don't have the id from
bpf_map_get_next_id(): If we don't get a valid id, we can't reuse it on
the following loop iteration to fetch the id of the following map. We
would have to start again with a null id and to loop over all maps again.

Can I ask in what context you saw bpftool stop before printing all the maps?

[0] https://docs.kernel.org/bpf/bpf_devel_QA.html#submitting-patches

Thanks,
Quentin



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux