Re: [PATCH 1/1] bpftool: Allow referring to maps by its name

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

 



2019-03-15 12:16 UTC-0700 ~ Jakub Kicinski <jakub.kicinski@xxxxxxxxxxxxx>
On Fri, 15 Mar 2019 15:41:41 -0300, Arnaldo Carvalho de Melo wrote:
While developing 'perf trace' and looking at BPF maps it puts in place I
noticed that one needs to first use 'bpftool map' to lookup a map id to
then use 'bpftool map dump map id <map-id-looked-up>'.

This is needed because everytime we restart 'perf trace' the map IDs
gets changed so we need to do the ID lookup again.

To speed up this sequence, allow specifying just the map name, look up
its ID and then use the existing routines as if the user had provided
the map id.

I can see how it could be useful for quick debug.  Names are not
guaranteed to be unique, though, do you not care about potential
duplicates?


Jakub beat me to it by a few seconds :). I discussed possible workarounds on that point with him though, so here are my two cents. I see two options: first one would be to return the ids of, and then dump info about all maps having that name. The second one would be to simply return an error if duplicate names are found.

We agreed that returning an error if there are duplicates is probably the best way to go, because dealing with several maps for anything else than "bpftool map show" would be problematic (clearly, we don't want to update all maps with a given name at once). Of course if you have other suggestions, feel free to propose :).

Best,
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