Re: [External] Re: [PATCH bpf-next v2 8/9] libbpf: add support for the multi-link of tracing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 11, 2024 at 7:44 PM 梦龙董 <dongmenglong.8@xxxxxxxxxxxxx> wrote:
>
> On Tue, Mar 12, 2024 at 9:56 AM Alexei Starovoitov
> <alexei.starovoitov@xxxxxxxxx> wrote:
> >
> > On Mon, Mar 11, 2024 at 2:35 AM Menglong Dong
> > <dongmenglong.8@xxxxxxxxxxxxx> wrote:
> > >
> > >
> > > -               err = libbpf_find_attach_btf_id(prog, attach_name, &btf_obj_fd, &btf_type_id);
> > > +               name_end = strchr(attach_name, ',');
> > > +               /* for multi-link tracing, use the first target symbol during
> > > +                * loading.
> > > +                */
> > > +               if ((def & SEC_ATTACH_BTF_MULTI) && name_end) {
> > > +                       int len = name_end - attach_name + 1;
> > > +                       char *first_tgt;
> > > +
> > > +                       first_tgt = malloc(len);
> > > +                       if (!first_tgt)
> > > +                               return -ENOMEM;
> > > +                       strncpy(first_tgt, attach_name, len);
> > > +                       first_tgt[len - 1] = '\0';
> > > +                       err = libbpf_find_attach_btf_id(prog, first_tgt, &btf_obj_fd,
> > > +                                                       &btf_type_id);
> > > +                       free(first_tgt);
> > > +               } else {
> > > +                       err = libbpf_find_attach_btf_id(prog, attach_name, &btf_obj_fd,
> > > +                                                       &btf_type_id);
> > > +               }
> >
> > Pls use glob_match the way [ku]probe multi are doing
> > instead of exact match.
>
> Hello,
>
> I'm a little suspecting the effect of glob_match. I seldom found
> the use case that the kernel functions which we want to trace
> have the same naming pattern. And the exact match seems more
> useful.
>
> Can we use both exact and glob match here?

exact is a subset of glob_match.
Pls follow the pattern that[ku]probe multi established
in terms of user interface expectations.





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux