Re: [PATCH v3 0/6] perf auxtrace: Support AUX pause and resume with BPF
From: Leo Yan
Date: Fri Aug 08 2025 - 07:48:04 EST
On Tue, Aug 05, 2025 at 10:16:29PM +0300, Adrian Hunter wrote:
> On 30/07/2025 21:26, Leo Yan wrote:
> > Hi Adrian,
> >
> > On Mon, Jul 28, 2025 at 08:02:51PM +0300, Adrian Hunter wrote:
> >> On 25/07/2025 12:59, Leo Yan wrote:
> >>> This series extends Perf for fine-grained tracing by using BPF program
> >>> to pause and resume AUX tracing. The BPF program can be attached to
> >>> tracepoints (including ftrace tracepoints and dynamic tracepoints, like
> >>> kprobe, kretprobe, uprobe and uretprobe).
> >>
> >> Using eBPF to pause/resume AUX tracing seems like a great idea.
> >>
> >> AFAICT with this patch set, there is just support for pause/resume
> >> much like what could be done directly without eBPF, so I wonder if you
> >> could share a bit more on how you see this evolving, and what your
> >> future plans are?
> >
> > IIUC, here you mean the tool can use `perf probe` to firstly create
> > probes, then enable tracepoints as PMU event for AUX pause and resume.
>
> Yes, like:
>
> $ sudo perf probe 'do_sys_openat2 how->flags how->mode'
> Added new event:
> probe:do_sys_openat2 (on do_sys_openat2 with flags=how->flags mode=how->mode)
>
> You can now use it in all perf tools, such as:
>
> perf record -e probe:do_sys_openat2 -aR sleep 1
>
> $ sudo perf probe do_sys_openat2%return
> Added new event:
> probe:do_sys_openat2__return (on do_sys_openat2%return)
>
> You can now use it in all perf tools, such as:
>
> perf record -e probe:do_sys_openat2__return -aR sleep 1
>
> $ sudo perf record --kcore -e intel_pt/aux-action=start-paused/k -e probe:do_sys_openat2/aux-action=resume/ --filter='flags==0x98800' -e probe:do_sys_openat2__return/aux-action=pause/ -- ls
Thanks a lot for sharing the commands. I was able to replicate them
using CoreSight.
Given that we can achieve the same result without using BPF, I am not
sure how useful this series is. It may give us a base for exploring
profiling that combines AUX trace and BPF, but I am fine with holding
on until we have clear requirements for it.
I would get suggestion from you and maintainers before proceeding
further.
Thanks,
Leo