Re: [PATCH v3 bpf-next 10/10] bpftool: Show probed function in perf_event link info

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

 



On Sat, Jun 17, 2023 at 11:20 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote:
>
> On Sat, Jun 17, 2023 at 4:41 AM Andrii Nakryiko
> <andrii.nakryiko@xxxxxxxxx> wrote:
> >
> > On Mon, Jun 12, 2023 at 8:16 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote:
> > >
> > > Enhance bpftool to display comprehensive information about exposed
> > > perf_event links, covering uprobe, kprobe, tracepoint, and generic perf
> > > event. The resulting output will include the following details:
> > >
> > > $ tools/bpf/bpftool/bpftool link show
> > > 3: perf_event  prog 14
> > >         event_type software  event_config cpu-clock
> > >         bpf_cookie 0
> > >         pids perf_event(1379330)
> > > 4: perf_event  prog 14
> > >         event_type hw-cache  event_config LLC-load-misses
> > >         bpf_cookie 0
> > >         pids perf_event(1379330)
> > > 5: perf_event  prog 14
> > >         event_type hardware  event_config cpu-cycles
> >
> > how about
> >
> > "event hardware:cpu-cycles" for events
>
> Agree. That is better.
>
> >
> > >         bpf_cookie 0
> > >         pids perf_event(1379330)
> > > 6: perf_event  prog 20
> > >         retprobe 0  file_name /home/yafang/bpf/uprobe/a.out  offset 0x1338
> >
> > for uprobes: "uprobe /home/yafang/bpf/uprobe/a.out+0x1338"
> > for retprobes: "uretprobe /home/yafang/bpf/uprobe/a.out+0x1338"
>
> Agree.

BTW, should we also change the output of `bpftool perf show` that way?

- Old
$ bpftool perf show
pid 11898  fd 7: prog_id 6  kprobe  func kernel_clone  offset 0
pid 11898  fd 9: prog_id 5  kretprobe  func kernel_clone  offset 0
pid 11966  fd 9: prog_id 13  uprobe  filename
/home/dev/waken/bpf/uprobe/a.out  offset 4920
pid 11966  fd 11: prog_id 14  uretprobe  filename
/home/dev/waken/bpf/uprobe/a.out  offset 4920

- New ?
$ bpftool perf show
pid 11898  fd 7: prog_id 6  kprobe kernel_clone
pid 11898  fd 9: prog_id 5  kretprobe kernel_clone
pid 11966  fd 9: prog_id 13  uprobe /home/dev/waken/bpf/uprobe/a.out+0x1338
pid 11966  fd 11: prog_id 14  uretprobe /home/dev/waken/bpf/uprobe/a.out+0x1338

>
> >
> > >         bpf_cookie 0
> > >         pids uprobe(1379706)
> > > 7: perf_event  prog 21
> > >         retprobe 1  file_name /home/yafang/bpf/uprobe/a.out  offset 0x1338
> > >         bpf_cookie 0
> > >         pids uprobe(1379706)
> > > 8: perf_event  prog 27
> > >         tp_name sched_switch
> >
> > "tracepoint  sched_switch" ?
>
> Agree.
>
> >
> > >         bpf_cookie 0
> > >         pids tracepoint(1381734)
> > > 10: perf_event  prog 43
> > >         retprobe 0  func_name kernel_clone  addr ffffffffad0a9660
> >
> > similar to uprobes:
> >
> > "kprobe kernel_clone  0xffffffffad0a9660"
> > "kretprobe kernel_clone  0xffffffffad0a9660"
> >
> >
> > That is, make this more human readable instead of mechanically
> > translated from kernel info? retprobe 1/0 is quite cumbersome,
> > "uprobe" vs "uretprobe" makes more sense?
>
> Agree. Will do it.
>
> >
> > JSON is where it could be completely mechanically translated, IMO.
>
> Agree.
>
> --
> Regards
> Yafang



-- 
Regards
Yafang





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux