public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Rust data-type profiling working in perf was: Re: [RFC PATCH v2 0/4] Test annotate with data type profiling
       [not found] ` <aYigHLZtXooznMB7@x1>
@ 2026-02-08 14:42   ` Arnaldo Carvalho de Melo
  2026-02-08 15:16     ` Miguel Ojeda
  2026-02-09  8:45     ` Dmitry Dolgov
  0 siblings, 2 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-02-08 14:42 UTC (permalink / raw)
  To: Dmitrii Dolgov
  Cc: Miguel Ojeda, linux-perf-users, Namhyung Kim, Ian Rogers,
	Linux Kernel Mailing List

On Sun, Feb 08, 2026 at 11:39:28AM -0300, Arnaldo Carvalho de Melo wrote:
> On Sun, Feb 08, 2026 at 01:22:22PM +0100, Dmitrii Dolgov wrote:
> > Add shell tests for data type profiling, including C and rust.

> > To support the rust test, a new workload with rust code was introduced.
> > To build it only when rust is actually available, also add a feature
> > test for rust compiler and guard everything behind it.

> > Changes in v2:
> > - Switched to use mem record.
> > - Fixed the build issue with a custom output.
> > - Separated patches for the workload and tests.
> > - Added new test for C code.
> > - Added a feature test for rust compiler.
 
> Thanks, tested it, everything working as advertised:

This is an interesting piece of news, so CCing to lkml and Miguel as
well, please CC that list in the future.

Also please consider adding examples of output of such new features, so
that people can quickly see it in action, data-type profiling for Rust
seems interesting, right? :-)

- Arnaldo
 
> ⬢ [acme@toolbx perf-tools-next]$ m
> make: Entering directory '/home/acme/git/linux/tools/perf'
>   BUILD:   Doing 'make -j32' parallel build
> Warning: Kernel ABI header differences:
>   diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
>   diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
> 
> Auto-detecting system features:
> ...                  libdw: [ on  ]
> ...                  glibc: [ on  ]
> ...                 libelf: [ on  ]
> ...                libnuma: [ on  ]
> ... numa_num_possible_cpus: [ on  ]
> ...              libpython: [ on  ]
> ...            libcapstone: [ on  ]
> ...              llvm-perf: [ on  ]
> ...                   zlib: [ on  ]
> ...                   lzma: [ on  ]
> ...                    bpf: [ on  ]
> ...                 libaio: [ on  ]
> ...                libzstd: [ on  ]
> ...             libopenssl: [ on  ]
> ...                   rust: [ on  ] <-------------------------
> 
>   INSTALL libsubcmd_headers
> <SNIP>
> 
> ⬢ [acme@toolbx perf-tools-next]$ perf record perf test -w code_with_type
> [ perf record: Woken up 2 times to write data ]
> [ perf record: Captured and wrote 0.162 MB perf.data (4036 samples) ]
> ⬢ [acme@toolbx perf-tools-next]$ perf report --stdio --dso perf -s srcfile,srcline | head -20
> # To display the perf.data header info, please use --header/--header-only options.
> #
> #
> # Total Lost Samples: 0
> #
> # Samples: 4K of event 'cpu/cycles/Pu'
> # Event count (approx.): 5337677712
> #
> # Overhead  Source File        Source:Line
> # ........  .................  ..............................................................
> #
>     25.53%  cmp.rs             cmp.rs:1903
>     16.66%  code_with_type.rs  code_with_type.rs:15
>     14.48%  ub_checks.rs       ub_checks.rs:68
>     11.16%  range.rs           range.rs:204
>      6.39%  range.rs           range.rs:0
>      4.61%  range.rs           range.rs:849
>      3.78%  code_with_type.rs  code_with_type.rs:13
>      3.51%  code_with_type.rs  code_with_type.rs:21
>      2.89%  range.rs           range.rs:764
> ⬢ [acme@toolbx perf-tools-next]$ grep -m1 'model name' /proc/cpuinfo
> model name	: AMD Ryzen 9 9950X3D 16-Core Processor
> ⬢ [acme@toolbx perf-tools-next]$ uname -a
> Linux toolbx 6.18.8-200.fc43.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jan 30 20:23:28 UTC 2026 x86_64 GNU/Linux
> ⬢ [acme@toolbx perf-tools-next]$
> 
>   root@number:~# perf test 'perf data type profiling tests'
>    83: perf data type profiling tests                                  : Ok
>   root@number:~# perf test -vv 'perf data type profiling tests'
>    83: perf data type profiling tests:
>   --- start ---
>   test child forked, pid 125028
>   Basic Rust perf annotate test
>   Basic annotate test [Success]
>   Pipe Rust perf annotate test
>   Pipe annotate test [Success]
>   Basic C perf annotate test
>   Basic annotate test [Success]
>   Pipe C perf annotate test
>   Pipe annotate test [Success]
>   ---- end(0) ----
>    83: perf data type profiling tests                                  : Ok
>   root@number:~#
> 
> Thanks, applied to perf-tools-next,
> 
> - Arnaldo

> > Dmitrii Dolgov (4):
> >   tools/build: Add a feature test for rust compiler
> >   perf test workload: Add code_with_type test workload
> >   perf tests: Test annotate with data type profiling and rust
> >   perf tests: Test annotate with data type profiling and C
> > 
> >  tools/build/Makefile.build                    | 14 ++++
> >  tools/build/Makefile.feature                  |  6 +-
> >  tools/build/feature/Makefile                  |  7 ++
> >  tools/build/feature/test-rust.rs              |  4 +
> >  tools/perf/Makefile.config                    | 11 +++
> >  tools/perf/Makefile.perf                      |  2 +-
> >  tools/perf/builtin-check.c                    |  1 +
> >  tools/perf/tests/builtin-test.c               |  4 +
> >  tools/perf/tests/shell/data_type_profiling.sh | 84 +++++++++++++++++++
> >  tools/perf/tests/tests.h                      |  4 +
> >  tools/perf/tests/workloads/Build              |  5 ++
> >  tools/perf/tests/workloads/code_with_type.c   | 46 ++++++++++
> >  tools/perf/tests/workloads/code_with_type.rs  | 23 +++++
> >  tools/scripts/Makefile.include                |  2 +
> >  14 files changed, 210 insertions(+), 3 deletions(-)
> >  create mode 100644 tools/build/feature/test-rust.rs
> >  create mode 100755 tools/perf/tests/shell/data_type_profiling.sh
> >  create mode 100644 tools/perf/tests/workloads/code_with_type.c
> >  create mode 100644 tools/perf/tests/workloads/code_with_type.rs
> > 
> > base-commit: 36a1b0061a584430277861fe5d8bd107aef26137
> > -- 
> > 2.52.0
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Rust data-type profiling working in perf was: Re: [RFC PATCH v2 0/4] Test annotate with data type profiling
  2026-02-08 14:42   ` Rust data-type profiling working in perf was: Re: [RFC PATCH v2 0/4] Test annotate with data type profiling Arnaldo Carvalho de Melo
@ 2026-02-08 15:16     ` Miguel Ojeda
  2026-02-09  8:45     ` Dmitry Dolgov
  1 sibling, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2026-02-08 15:16 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Dmitrii Dolgov, Miguel Ojeda, linux-perf-users, Namhyung Kim,
	Ian Rogers, Linux Kernel Mailing List, rust-for-linux, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich

On Sun, Feb 8, 2026 at 3:42 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> This is an interesting piece of news, so CCing to lkml and Miguel as
> well, please CC that list in the future.
>
> Also please consider adding examples of output of such new features, so
> that people can quickly see it in action, data-type profiling for Rust
> seems interesting, right? :-)

Thanks Arnaldo for the ping!

Cc'ing rust-for-linux as well.

Thread at https://lore.kernel.org/all/20260208122227.3524-1-9erthalion6@gmail.com/

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Rust data-type profiling working in perf was: Re: [RFC PATCH v2 0/4] Test annotate with data type profiling
  2026-02-08 14:42   ` Rust data-type profiling working in perf was: Re: [RFC PATCH v2 0/4] Test annotate with data type profiling Arnaldo Carvalho de Melo
  2026-02-08 15:16     ` Miguel Ojeda
@ 2026-02-09  8:45     ` Dmitry Dolgov
  2026-02-10  1:26       ` Namhyung Kim
  1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Dolgov @ 2026-02-09  8:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Miguel Ojeda, linux-perf-users, Namhyung Kim, Ian Rogers,
	Linux Kernel Mailing List

> On Sun, Feb 08, 2026 at 11:42:28AM -0300, Arnaldo Carvalho de Melo wrote:
>
> Also please consider adding examples of output of such new features, so
> that people can quickly see it in action, data-type profiling for Rust
> seems interesting, right? :-)

Agree :) What would be the right place to put such examples, somewhere
in the documentation?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Rust data-type profiling working in perf was: Re: [RFC PATCH v2 0/4] Test annotate with data type profiling
  2026-02-09  8:45     ` Dmitry Dolgov
@ 2026-02-10  1:26       ` Namhyung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2026-02-10  1:26 UTC (permalink / raw)
  To: Dmitry Dolgov
  Cc: Arnaldo Carvalho de Melo, Miguel Ojeda, linux-perf-users,
	Ian Rogers, Linux Kernel Mailing List

On Mon, Feb 09, 2026 at 09:45:32AM +0100, Dmitry Dolgov wrote:
> > On Sun, Feb 08, 2026 at 11:42:28AM -0300, Arnaldo Carvalho de Melo wrote:
> >
> > Also please consider adding examples of output of such new features, so
> > that people can quickly see it in action, data-type profiling for Rust
> > seems interesting, right? :-)
> 
> Agree :) What would be the right place to put such examples, somewhere
> in the documentation?

Yep, please add it to the documentation.

Thanks,
Namhyung


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-10  1:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260208122227.3524-1-9erthalion6@gmail.com>
     [not found] ` <aYigHLZtXooznMB7@x1>
2026-02-08 14:42   ` Rust data-type profiling working in perf was: Re: [RFC PATCH v2 0/4] Test annotate with data type profiling Arnaldo Carvalho de Melo
2026-02-08 15:16     ` Miguel Ojeda
2026-02-09  8:45     ` Dmitry Dolgov
2026-02-10  1:26       ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox