On Tue, Feb 1, 2022 at 9:37 AM Kui-Feng Lee <kuifeng@xxxxxx> wrote: > > On Mon, 2022-01-31 at 22:45 -0800, Andrii Nakryiko wrote: > ...... cut ...... > > For multi-attach fentry, we could use the same approach if we let > > either bpf_link or bpf_prog available to fentry/fexit program at > > runtime. Kui-Feng seems to be storing prog_id in BPF trampoline > > generated code, I don't think that's the best approach, it would be > > probably better to store bpf_link or bpf_prog pointer, whichever is > > more convenient. I think we can't attach the same BPF program twice > > to > > FYI, the prog_id used is casting from a bpf_prog pointer. It gets a > bpf_prog by casting a prog_id back. > Ok, this is why we all got confused. There is already a concept of "prog ID" (it is also visible to user-space, btw), but you were actually storing an actual `struct bpf_prog *` pointer. So just a misleading use of the term in this context.