Linux Perf Users
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Michael Petlan <mpetlan@redhat.com>
Cc: linux-perf-users@vger.kernel.org, irogers@google.com,
	namhyung@kernel.org, acme@redhat.com
Subject: Re: [PATCH 2/2] perf test attr: Fix wrong size expectation for events
Date: Tue, 6 Oct 2026 15:33:57 +0200	[thread overview]
Message-ID: <asT4xQW9Vy492Yyl@x2> (raw)
In-Reply-To: <20260924223027.799654-3-mpetlan@redhat.com>

On Fri, Sep 25, 2026 at 12:30:27AM +0200, Michael Petlan wrote:
> Although config4 has been added into struct perf_event_attr, the size
> expectation for the struct hasn't been adjusted. This hasn't been
> noticed, since the testcase's return value has been ignored after
> rewriting the testcase to python until previous commit.
> 
> Fix that.
> 
> Fixes: 80cdf208117a36de82a30d210b3b8df0f193e75b ("tools headers UAPI: Sync linux/perf_event.h with the kernel sources")

> Fixes: cbbfba4847b8a5299d36e002bf864b21bb83295d ("perf: Add perf_event_attr::config4")

This cset changes a kernel header, kernel developers are not expected to
update tools/ living code, they are welcomed to do so, so it didn't
introduce a problem, so the cset that updates the tools/include/ is the
one that should be in the fixes.

I was going to do that when I noticed this:

 #define PERF_ATTR_SIZE_VER9                    144     /* add: config4 */
+#define PERF_ATTR_SIZE_VER10                   176     /* Add: sample_simd_{vec|pred}_reg_* */

in tools/include/uapi/linux/perf_event.h, i.e. with your patch it will
continue broken, as it is not taking into account this one:

commit eb89aef367e4701038869e1ddfa719463524e3e3
Author: Dapeng Mi <dapeng1.mi@linux.intel.com>
Date:   Mon Sep 14 09:40:43 2026 +0800

    perf headers: Sync perf_event.h/perf_regs.h with the kernel headers

    Sync the UAPI header changes of supporting SIMD/eGPRs/SSP sampling into
    corresponding tools UAPI headers.

So I'm updating your patch to have 176 instead of 144.

The test is still failing tho, for some other reason:

running '/home/acme/libexec/perf-core/tests/shell/attr/test-record-graph-default'
test limitation '!aarch64'
excluded architecture list ['aarch64']
running '/home/acme/libexec/perf-core/tests/shell/attr/test-record-graph-default-aarch64'
test limitation 'aarch64'
skipped [x86_64] '/home/acme/libexec/perf-core/tests/shell/attr/test-record-graph-default-aarch64'
running '/home/acme/libexec/perf-core/tests/shell/attr/test-record-graph-dwarf'
expected sample_type=45359, got 12583
FAILED '/home/acme/libexec/perf-core/tests/shell/attr/test-record-graph-dwarf' - match failure
---- end(-1) ----
 82: Perf attribute expectations test                                                                       : FAILED!

=== Test Summary ===
Passed main tests : 0
Passed subtests   : 0
Skipped tests     : 0
Failed tests      : 1
List of failed tests:
   82: Perf attribute expectations test
root@x2:~#

Investigating.

- Arnaldo
 
> Signed-off-by: Michael Petlan <mpetlan@redhat.com>
> ---
>  tools/perf/tests/shell/attr/base-record          | 2 +-
>  tools/perf/tests/shell/attr/base-stat            | 2 +-
>  tools/perf/tests/shell/attr/system-wide-dummy    | 2 +-
>  tools/perf/tests/shell/attr/test-record-dummy-C0 | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/tests/shell/attr/base-record b/tools/perf/tests/shell/attr/base-record
> index b44e4e6e4443..dd76fbdb628f 100644
> --- a/tools/perf/tests/shell/attr/base-record
> +++ b/tools/perf/tests/shell/attr/base-record
> @@ -5,7 +5,7 @@ group_fd=-1
>  flags=0|8
>  cpu=*
>  type=0|1
> -size=136
> +size=144
>  config=0|1
>  sample_period=*
>  sample_type=263
> diff --git a/tools/perf/tests/shell/attr/base-stat b/tools/perf/tests/shell/attr/base-stat
> index fccd8ec4d1b0..d769e69bb4f5 100644
> --- a/tools/perf/tests/shell/attr/base-stat
> +++ b/tools/perf/tests/shell/attr/base-stat
> @@ -5,7 +5,7 @@ group_fd=-1
>  flags=0|8
>  cpu=*
>  type=0
> -size=136
> +size=144
>  config=0
>  sample_period=0
>  sample_type=65536
> diff --git a/tools/perf/tests/shell/attr/system-wide-dummy b/tools/perf/tests/shell/attr/system-wide-dummy
> index a1e1d6a263bf..9806de3d9c9e 100644
> --- a/tools/perf/tests/shell/attr/system-wide-dummy
> +++ b/tools/perf/tests/shell/attr/system-wide-dummy
> @@ -7,7 +7,7 @@ cpu=*
>  pid=-1
>  flags=8
>  type=1
> -size=136
> +size=144
>  config=9
>  sample_period=1
>  # PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME |
> diff --git a/tools/perf/tests/shell/attr/test-record-dummy-C0 b/tools/perf/tests/shell/attr/test-record-dummy-C0
> index 91499405fff4..23e00e7f8ace 100644
> --- a/tools/perf/tests/shell/attr/test-record-dummy-C0
> +++ b/tools/perf/tests/shell/attr/test-record-dummy-C0
> @@ -10,7 +10,7 @@ cpu=0
>  pid=-1
>  flags=8
>  type=1
> -size=136
> +size=144
>  config=9
>  sample_period=4000
>  # PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME |
> -- 
> 2.52.0
> 

  parent reply	other threads:[~2026-10-06 13:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 22:30 [PATCH 0/2] perf test attr: Fix and re-enable the test Michael Petlan
2026-09-24 22:30 ` [PATCH 1/2] perf test attr: Propagate the return value from the test to the wrapper Michael Petlan
2026-09-24 22:32   ` sashiko-bot
2026-09-24 22:30 ` [PATCH 2/2] perf test attr: Fix wrong size expectation for events Michael Petlan
2026-09-24 22:34   ` sashiko-bot
2026-10-06 13:33   ` Arnaldo Carvalho de Melo [this message]
2026-10-06 15:26     ` Arnaldo Carvalho de Melo
2026-10-05 22:47 ` [PATCH 0/2] perf test attr: Fix and re-enable the test Namhyung Kim
2026-10-06 13:13   ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=asT4xQW9Vy492Yyl@x2 \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox