On Fri, 2022-03-18 at 12:21 -0700, Alexei Starovoitov wrote: > On Tue, Mar 15, 2022 at 05:42:31PM -0700, Kui-Feng Lee wrote: > > > > +SEC("fentry/bpf_fentry_test1") > > Did we discuss whether it makes sense to specify cookie in the SEC() > ? > > Probably no one will be using cookie when prog is attached to a > specific > function, but with support for poor man regex in SEC the cookie > might be useful? > Would we need a way to specify a set of cookies in SEC()? > Or specify a set of pairs of kernel_func+cookie? > None of it might be worth it. It makes sense to me to provide a way to specify cookies in the source code of a BPF program. However, it could be a very complicated syntax and/or difficult to read. Kernel_func+cookie, even Kernel_func_pattern+cookie, pairs are easy to understand. For more complicated cases, giving cookies at user space programs would be a better choice.