[PATCH v2 0/5] perf trace: Augment enum arguments with BTF

Howard Chu posted 5 patches 1 year, 7 months ago
There is a newer version of this series
tools/perf/builtin-trace.c                    | 214 ++++++++++++++++--
tools/perf/tests/builtin-test.c               |   1 +
tools/perf/tests/shell/trace_btf_enum.sh      |  57 +++++
tools/perf/tests/tests.h                      |   1 +
tools/perf/tests/workloads/Build              |   1 +
.../perf/tests/workloads/landlock_add_rule.c  |  32 +++
tools/perf/util/syscalltbl.c                  |   7 +
tools/perf/util/syscalltbl.h                  |   1 +
8 files changed, 289 insertions(+), 25 deletions(-)
create mode 100755 tools/perf/tests/shell/trace_btf_enum.sh
create mode 100644 tools/perf/tests/workloads/landlock_add_rule.c
[PATCH v2 0/5] perf trace: Augment enum arguments with BTF
Posted by Howard Chu 1 year, 7 months ago
changes in v2:
- Move inline landlock_add_rule c code to tests/workloads
- Rename 'enum_aug_prereq' to 'check_vmlinux'

Augment enum arguments in perf trace, including syscall arguments and
non-syscall tracepoint arguments. The augmentation is implemented using
BTF.

This patch series also includes a bug fix by Arnaldo Carvalho de Melo 
<acme@redhat.com>, which makes more syscalls to be traceable by perf trace.

Test is included.

Howard Chu (5):
  perf trace: Fix iteration of syscall ids in syscalltbl->entries
  perf trace: Augment enum syscall arguments with BTF
  perf trace: Augment enum tracepoint arguments with BTF
  perf trace: Filter enum arguments with enum names
  perf trace: Add test for enum augmentation

 tools/perf/builtin-trace.c                    | 214 ++++++++++++++++--
 tools/perf/tests/builtin-test.c               |   1 +
 tools/perf/tests/shell/trace_btf_enum.sh      |  57 +++++
 tools/perf/tests/tests.h                      |   1 +
 tools/perf/tests/workloads/Build              |   1 +
 .../perf/tests/workloads/landlock_add_rule.c  |  32 +++
 tools/perf/util/syscalltbl.c                  |   7 +
 tools/perf/util/syscalltbl.h                  |   1 +
 8 files changed, 289 insertions(+), 25 deletions(-)
 create mode 100755 tools/perf/tests/shell/trace_btf_enum.sh
 create mode 100644 tools/perf/tests/workloads/landlock_add_rule.c

-- 
2.45.2
Re: [PATCH v2 0/5] perf trace: Augment enum arguments with BTF
Posted by Arnaldo Carvalho de Melo 1 year, 7 months ago
On Wed, Jun 19, 2024 at 04:20:37PM +0800, Howard Chu wrote:
> changes in v2:
> - Move inline landlock_add_rule c code to tests/workloads
> - Rename 'enum_aug_prereq' to 'check_vmlinux'

Usually the versions descriptions comes at the end, after your signature
line, just before the list of csets in the series.
 
> Augment enum arguments in perf trace, including syscall arguments and
> non-syscall tracepoint arguments. The augmentation is implemented using
> BTF.
> 
> This patch series also includes a bug fix by Arnaldo Carvalho de Melo 
> <acme@redhat.com>, which makes more syscalls to be traceable by perf trace.
> 
> Test is included.

Thanks, the patch submission is now very good, at some point you'll be
able to point to a git tree from where to do a pull, then have it with a
signed tag, etc, all this is not necessary at this point in our
collaboration, but as you evolve as a kernel developer, it eventually
will be asked from you.

And it comes with a test that introduces a 'perf test -w' workload,
super great!

- Arnaldo
 
> Howard Chu (5):
>   perf trace: Fix iteration of syscall ids in syscalltbl->entries
>   perf trace: Augment enum syscall arguments with BTF
>   perf trace: Augment enum tracepoint arguments with BTF
>   perf trace: Filter enum arguments with enum names
>   perf trace: Add test for enum augmentation
> 
>  tools/perf/builtin-trace.c                    | 214 ++++++++++++++++--
>  tools/perf/tests/builtin-test.c               |   1 +
>  tools/perf/tests/shell/trace_btf_enum.sh      |  57 +++++
>  tools/perf/tests/tests.h                      |   1 +
>  tools/perf/tests/workloads/Build              |   1 +
>  .../perf/tests/workloads/landlock_add_rule.c  |  32 +++
>  tools/perf/util/syscalltbl.c                  |   7 +
>  tools/perf/util/syscalltbl.h                  |   1 +
>  8 files changed, 289 insertions(+), 25 deletions(-)
>  create mode 100755 tools/perf/tests/shell/trace_btf_enum.sh
>  create mode 100644 tools/perf/tests/workloads/landlock_add_rule.c
> 
> -- 
> 2.45.2
>
Re: [PATCH v2 0/5] perf trace: Augment enum arguments with BTF
Posted by Namhyung Kim 1 year, 7 months ago
Hello,

On Wed, Jun 19, 2024 at 9:55 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Wed, Jun 19, 2024 at 04:20:37PM +0800, Howard Chu wrote:
> > changes in v2:
> > - Move inline landlock_add_rule c code to tests/workloads
> > - Rename 'enum_aug_prereq' to 'check_vmlinux'
>
> Usually the versions descriptions comes at the end, after your signature
> line, just before the list of csets in the series.
>
> > Augment enum arguments in perf trace, including syscall arguments and
> > non-syscall tracepoint arguments. The augmentation is implemented using
> > BTF.
> >
> > This patch series also includes a bug fix by Arnaldo Carvalho de Melo
> > <acme@redhat.com>, which makes more syscalls to be traceable by perf trace.
> >
> > Test is included.
>
> Thanks, the patch submission is now very good, at some point you'll be
> able to point to a git tree from where to do a pull, then have it with a
> signed tag, etc, all this is not necessary at this point in our
> collaboration, but as you evolve as a kernel developer, it eventually
> will be asked from you.
>
> And it comes with a test that introduces a 'perf test -w' workload,
> super great!
>
> - Arnaldo
>
> > Howard Chu (5):
> >   perf trace: Fix iteration of syscall ids in syscalltbl->entries
> >   perf trace: Augment enum syscall arguments with BTF
> >   perf trace: Augment enum tracepoint arguments with BTF
> >   perf trace: Filter enum arguments with enum names
> >   perf trace: Add test for enum augmentation

Please make sure that your change doesn't break the build
in case libbpf is not available.  For example, a build without
libelf seems to be broken.

  $ make NO_LIBELF=1

Thanks,
Namhyung
Re: [PATCH v2 0/5] perf trace: Augment enum arguments with BTF
Posted by Howard Chu 1 year, 7 months ago
On Thu, Jun 20, 2024 at 2:19 AM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Hello,
>
> On Wed, Jun 19, 2024 at 9:55 AM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> >
> > On Wed, Jun 19, 2024 at 04:20:37PM +0800, Howard Chu wrote:
> > > changes in v2:
> > > - Move inline landlock_add_rule c code to tests/workloads
> > > - Rename 'enum_aug_prereq' to 'check_vmlinux'
> >
> > Usually the versions descriptions comes at the end, after your signature
> > line, just before the list of csets in the series.
> >
> > > Augment enum arguments in perf trace, including syscall arguments and
> > > non-syscall tracepoint arguments. The augmentation is implemented using
> > > BTF.
> > >
> > > This patch series also includes a bug fix by Arnaldo Carvalho de Melo
> > > <acme@redhat.com>, which makes more syscalls to be traceable by perf trace.
> > >
> > > Test is included.
> >
> > Thanks, the patch submission is now very good, at some point you'll be
> > able to point to a git tree from where to do a pull, then have it with a
> > signed tag, etc, all this is not necessary at this point in our
> > collaboration, but as you evolve as a kernel developer, it eventually
> > will be asked from you.
> >
> > And it comes with a test that introduces a 'perf test -w' workload,
> > super great!
> >
> > - Arnaldo
> >
> > > Howard Chu (5):
> > >   perf trace: Fix iteration of syscall ids in syscalltbl->entries
> > >   perf trace: Augment enum syscall arguments with BTF
> > >   perf trace: Augment enum tracepoint arguments with BTF
> > >   perf trace: Filter enum arguments with enum names
> > >   perf trace: Add test for enum augmentation
>
> Please make sure that your change doesn't break the build
> in case libbpf is not available.  For example, a build without
> libelf seems to be broken.
>
>   $ make NO_LIBELF=1
>
> Thanks,
> Namhyung

Thank you, I'll fix this.

Thanks,
Howard
Re: [PATCH v2 0/5] perf trace: Augment enum arguments with BTF
Posted by Howard Chu 1 year, 7 months ago
Hello,

Now $ make NO_LIBELF=1 can build successfully, and if
__NR_landlock_add_rule is not defined, we'll skip the test. The fixes
that Arnaldo suggested are also included.

I added too many things, changed some behaviors, figured it's probably
easier for you to merge from my source tree.

The fixes are on the perf-tools-next branch at:
https://github.com/Sberm/linux.git

please use
```
git pull https://github.com/Sberm/linux.git perf-tools-next
```

I'm no git expert so please tell me if something is wrong.

P.S. not my proudest patch, changed too many things, might be buggy.
If there're bugs please let me know.

On Thu, Jun 20, 2024 at 2:25 AM Howard Chu <howardchu95@gmail.com> wrote:
>
> On Thu, Jun 20, 2024 at 2:19 AM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > Hello,
> >
> > On Wed, Jun 19, 2024 at 9:55 AM Arnaldo Carvalho de Melo
> > <acme@kernel.org> wrote:
> > >
> > > On Wed, Jun 19, 2024 at 04:20:37PM +0800, Howard Chu wrote:
> > > > changes in v2:
> > > > - Move inline landlock_add_rule c code to tests/workloads
> > > > - Rename 'enum_aug_prereq' to 'check_vmlinux'
> > >
> > > Usually the versions descriptions comes at the end, after your signature
> > > line, just before the list of csets in the series.
> > >
> > > > Augment enum arguments in perf trace, including syscall arguments and
> > > > non-syscall tracepoint arguments. The augmentation is implemented using
> > > > BTF.
> > > >
> > > > This patch series also includes a bug fix by Arnaldo Carvalho de Melo
> > > > <acme@redhat.com>, which makes more syscalls to be traceable by perf trace.
> > > >
> > > > Test is included.
> > >
> > > Thanks, the patch submission is now very good, at some point you'll be
> > > able to point to a git tree from where to do a pull, then have it with a
> > > signed tag, etc, all this is not necessary at this point in our
> > > collaboration, but as you evolve as a kernel developer, it eventually
> > > will be asked from you.
> > >
> > > And it comes with a test that introduces a 'perf test -w' workload,
> > > super great!
> > >
> > > - Arnaldo
> > >
> > > > Howard Chu (5):
> > > >   perf trace: Fix iteration of syscall ids in syscalltbl->entries
> > > >   perf trace: Augment enum syscall arguments with BTF
> > > >   perf trace: Augment enum tracepoint arguments with BTF
> > > >   perf trace: Filter enum arguments with enum names
> > > >   perf trace: Add test for enum augmentation
> >
> > Please make sure that your change doesn't break the build
> > in case libbpf is not available.  For example, a build without
> > libelf seems to be broken.
> >
> >   $ make NO_LIBELF=1
> >
> > Thanks,
> > Namhyung
>
> Thank you, I'll fix this.
>
> Thanks,
> Howard