From: Rob Herring <robh@kernel.org>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
acme@kernel.org, jolsa@kernel.org, svens@linux.ibm.com,
gor@linux.ibm.com, sumanthk@linux.ibm.com, hca@linux.ibm.com
Subject: Re: [PATCH] perf/test: Fix wrong size for perf test Setup struct perf_event_attr
Date: Tue, 18 Apr 2023 14:56:34 -0500 [thread overview]
Message-ID: <CAL_JsqJo14uLmz5n4gSEf0gjEcODCMrsNEZKj_EnZoVPGFfDQw@mail.gmail.com> (raw)
In-Reply-To: <20230315121303.3358416-1-tmricht@linux.ibm.com>
On Wed, Mar 15, 2023 at 7:13 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>
> The test case ./perf test 'Setup struct perf_event_attr' fails.
> On s390 this output is observed:
>
> # ./perf test -Fvvvv 17
> 17: Setup struct perf_event_attr :
> --- start ---
> running './tests/attr/test-stat-C0'
> Using CPUID IBM,8561,703,T01,3.6,002f
> .....
> Event event:base-stat
> fd = 1
> group_fd = -1
> flags = 0|8
> cpu = *
> type = 0
> size = 128 <<<--- wrong, specified in file base-stat
> config = 0
> sample_period = 0
> sample_type = 65536
> ...
> 'PERF_TEST_ATTR=/tmp/tmpgw574wvg ./perf stat -o \
> /tmp/tmpgw574wvg/perf.data -e cycles -C 0 kill >/dev/null \
> 2>&1 ret '1', expected '1'
> loading result events
> Event event-0-0-4
> fd = 4
> group_fd = -1
> cpu = 0
> pid = -1
> flags = 8
> type = 0
> size = 136 <<<--- actual size used in system call
> .....
> compare
> matching [event-0-0-4]
> to [event:base-stat]
> [cpu] 0 *
> [flags] 8 0|8
> [type] 0 0
> [size] 136 128
> ->FAIL
> match: [event-0-0-4] matches []
> expected size=136, got 128
> FAILED './tests/attr/test-stat-C0' - match failure
>
> This mismatch is caused by
> commit 09519ec3b19e ("perf: Add perf_event_attr::config3")
> which enlarges the structure perf_event_attr by 8 bytes.
>
> Fix this by adjusting the expected value of size.
>
> Output after:
> # ./perf test -Fvvvv 17
> 17: Setup struct perf_event_attr :
> --- start ---
> running './tests/attr/test-stat-C0'
> Using CPUID IBM,8561,703,T01,3.6,002f
> ...
> matched
> compare
> matching [event-0-0-4]
> to [event:base-stat]
> [cpu] 0 *
> [flags] 8 0|8
> [type] 0 0
> [size] 136 136
> ....
> ->OK
> match: [event-0-0-4] matches ['event:base-stat']
> matched
>
> Fixes: 09519ec3b19e ("perf: Add perf_event_attr::config3")
Shouldn't a kernel with this change work with an old version of perf without?
Anyways, looks like the change is needed regardless.
Acked-by: Rob Herring <robh@kernel.org>
>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
> tools/perf/tests/attr/base-record | 2 +-
> tools/perf/tests/attr/base-stat | 2 +-
> tools/perf/tests/attr/system-wide-dummy | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
prev parent reply other threads:[~2023-04-18 19:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 12:13 [PATCH] perf/test: Fix wrong size for perf test Setup struct perf_event_attr Thomas Richter
2023-03-15 16:42 ` Namhyung Kim
2023-04-18 19:56 ` Rob Herring [this message]
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=CAL_JsqJo14uLmz5n4gSEf0gjEcODCMrsNEZKj_EnZoVPGFfDQw@mail.gmail.com \
--to=robh@kernel.org \
--cc=acme@kernel.org \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sumanthk@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=tmricht@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).