On Tue, Feb 7, 2023 at 8:49 AM Ho-Ren Chuang <horenc@xxxxxx> wrote: > > Hi Yafang and everyone, > > We've proposed very similar features at https://lore.kernel.org/bpf/CAAYibXgiCOOEY9NvLXbY4ve7pH8xWrZjnczrj6SHy3x_TtOU1g@xxxxxxxxxxxxxx/#t > I have looked through your patchset. Maybe we can use max_entires to show the used_enties for preallocated hashtab? Because for the preallocated hashtab, the memory is already allocated, so it doesn't matter how many entries it is using now. Then we can avoid the runtime overhead which Alexei is worried about. > > We are very excited seeing we are not the only ones eager to have this feature upstream to monitor eBPF map's actual usage. This shows the need for having such an ability in eBPF. > Happy to hear that this feature could help you. I think over time there will be more users who want to monitor the bpf memory usage :) > > Regarding the use cases please also check https://lore.kernel.org/all/CAADnVQLBt0snxv4bKwg1WKQ9wDFbaDCtZ03v1-LjOTYtsKPckQ@xxxxxxxxxxxxxx/#t . We are developing an app to monitor memory footprints used by eBPF programs/maps similar to Linux `top` command. > > > Thank you, > -- Regards Yafang