On Tue, 21 Jun 2022 at 03:09, Hangbin Liu <liuhangbin@xxxxxxxxx> wrote: > > Hi Quentin, > > When I using `bpftool map list` to show what maps user using. bpftool will > show maps including self created maps. Apart from the "pid_iter.rodata", > there are also array maps without name, which makes it hard to filter out > what maps user using. e.g. > > # bpftool map list > 63: array flags 0x0 > key 4B value 32B max_entries 1 memlock 4096B > 65: array name pid_iter.rodata flags 0x480 > key 4B value 4B max_entries 1 memlock 4096B > btf_id 98 frozen > pids bpftool(10572) > 66: array flags 0x0 > key 4B value 32B max_entries 1 memlock 4096B > > So do you have plan to add a special name for the bpftool self created maps? > Or do you know if there is a way to filter out these maps? Hi Hangbin, No plan currently. Adding names has been suggested before, but it's not compatible with some older kernels that don't support map names [0]. Maybe one solution would be to probe the kernel for map name support, and to add a name if supported. Other than this I'm not aware of a reliable way to filter out these maps at the moment. This could probably be done in bpftool since we should have the ids of the self-generated maps. But I think I'd rather find a way to add map names, if possible. It would make it easier to recognise/filter these maps on regular listing, whereas a new option would be harder for users to discover. Quentin [0] https://lore.kernel.org/bpf/CAEf4BzY66WPKQbDe74AKZ6nFtZjq5e+G3Ji2egcVytB9R6_sGQ@xxxxxxxxxxxxxx/