Re: [PATCH bpf-next 4/5] bpftool: support dumping metadata

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

 



YiFei Zhu <zhuyifei@xxxxxxxxxx> writes:

> On Fri, Aug 21, 2020 at 3:58 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote:
>> Yonghong Song <yhs@xxxxxx> writes:
>> > Not sure whether we need formal libbpf API to access metadata or not.
>> > This may help other applications too. But we can delay until it is
>> > necessary.
>>
>> Yeah, please put in a libbpf accessor as well; I would like to use this
>> from libxdp - without a skeleton :)
>>
>> -Toke
>
> I don't think I have an idea on a good API in libbpf that could be
> used to get the metadata of an existing program in kernel, that could
> be reused by bpftool without duplicating all the code. Maybe we can
> discuss this in a follow up series?

I think the most important part is getting a reference to the metadata
map. So a function that basically does what the top half of what your
show_prog_metadata() function does: given a prog fd, walk the map ids,
check if any of them looks like a metadata map, and if so return the map
fd.

Should be pretty straight-forward to reuse between bpftool/libbpf, no?

-Toke





[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