> On Fri, Feb 18, 2022 at 08:51:03AM +0100, Dmitrii Dolgov wrote: > Commit 82e6b1eee6a8 ("bpf: Allow to specify user-provided bpf_cookie for > BPF perf links") introduced the concept of user specified bpf_cookie, > which could be accessed by BPF programs using bpf_get_attach_cookie(). > For troubleshooting purposes it is convenient to expose bpf_cookie via > bpftool as well, so there is no need to meddle with the target BPF > program itself. > > Implemented using the pid iterator BPF program to actually fetch > bpf_cookies, which allows constraining code changes only to bpftool. I have to admit, with pid iterator it looks a bit clumsy. Would love to know if there is a better way.