Re: [PATCH 1/2] perf trace augmented_syscalls.bpf: Move the renameat augmenter to renameat2, temporarily

From: Arnaldo Carvalho de Melo
Date: Mon Sep 09 2024 - 18:15:09 EST


On Mon, Sep 09, 2024 at 10:05:57AM -0700, Ian Rogers wrote:
> On Fri, Sep 6, 2024 at 12:50 PM Arnaldo Carvalho de Melo
> <acme@xxxxxxxxxx> wrote:
> >
> > From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> >
> > While trying to shape Howard Chu's generic BPF augmenter transition into
> > the codebase I got stuck with the renameat2 syscall.
> >
> > Until I noticed that the attempt at reusing augmenters were making it
> > use the 'openat' syscall augmenter, that collect just one string syscall
> > arg, for the 'renameat2' syscall, that takes two strings.
> >
> > So, for the moment, just to help in this transition period, since
> > 'renameat2' is what is used these days in the 'mv' utility, just make
> > the BPF collector be associated with the more widely used syscall,
> > hopefully the transition to Howard's generic BPF augmenter will cure
> > this, so get this out of the way for now!
>
> Should any of this be captured in a comment next to the code?

Probably, just in a hurry now, making this comment for you not to think
I'm ignoring yours

> > So now we still have that odd "reuse", but for something we're not
> > testing so won't get in the way anymore:
> >
> > root@number:~# rm -f 987654 ; touch 123456 ; perf trace -vv -e rename* mv 123456 987654 |& grep renameat
> > Reusing "openat" BPF sys_enter augmenter for "renameat"
> > 0.000 ( 0.079 ms): mv/1158612 renameat2(olddfd: CWD, oldname: "123456", newdfd: CWD, newname: "987654", flags: NOREPLACE) = 0
> > root@number:~#
> >
> > Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> > Cc: Howard Chu <howardchu95@xxxxxxxxx>
> > Cc: Ian Rogers <irogers@xxxxxxxxxx>
> > Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> > Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
> > Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> > Cc: Andrii Nakryiko <andrii@xxxxxxxxxx>
> > Cc: Alan Maguire <alan.maguire@xxxxxxxxxx>
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks!

- Arnaldo