All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Richter <tmricht@linux.ibm.com>
To: Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>
Cc: Jan Polensky <japo@linux.ibm.com>,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-perf-users@vger.kernel.org, acme@kernel.org,
	agordeev@linux.ibm.com, gor@linux.ibm.com,
	sumanthk@linux.ibm.com, hca@linux.ibm.com
Subject: Re: [PATCH] perf test: Fix test case 120 and 121 for s390
Date: Wed, 11 Mar 2026 08:21:51 +0100	[thread overview]
Message-ID: <131d7e1e-701e-4f5b-961f-c85af74f1d96@linux.ibm.com> (raw)
In-Reply-To: <abEG_lty-tgMXJYx@z2>

On 3/11/26 07:09, Namhyung Kim wrote:
> On Mon, Mar 09, 2026 at 11:18:28AM -0700, Ian Rogers wrote:
>> On Mon, Mar 9, 2026 at 5:59 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>>>
>>> On 3/6/26 17:53, Ian Rogers wrote:
>>>> On Fri, Mar 6, 2026 at 7:52 AM Jan Polensky <japo@linux.ibm.com> wrote:
>>>>>
>>>>> On Fri, Mar 06, 2026 at 08:10:02AM +0100, Thomas Richter wrote:
>>>>>> Perf tests
>>>>>> 120: 'perf data convert --to-ctf' command test
>>>>>> 121: 'perf data convert --to-json' command test
>>>>>> fail on s390. It is caused by selecting the default event cycles
>>>>>> which does not exist on s390 z/VM. Use software event cpu-clock
>>>>>> and specify it explicitly on the command line.
>>>>>>
>>>>>> Output before:
>>>>>> ❯ perf test 120 121
>>>>>> 120: 'perf data convert --to-ctf' command test       : FAILED!
>>>>>> 121: 'perf data convert --to-json' command test      : FAILED!
>>>>>>
>>>>>> Output after:
>>>>>> ❯ perf test 120 121
>>>>>> 120: 'perf data convert --to-ctf' command test       : Ok
>>>>>> 121: 'perf data convert --to-json' command test      : Ok
>>>>>>
>>>>>> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
>>>>> [snip]
>>>>> Thanks for providing this, Thomas!
>>>>> Tested-by: Jan Polensky <japo@linux.ibm.com>
>>>>> Reviewed-by: Jan Polensky <japo@linux.ibm.com>
>>>>
>>>> Should we not fallback for the cycles as a default event?
>>>> https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/builtin-record.c#n1374
>>>> https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/evsel.c#n3792
>>>>
>>>> Thanks,
>>>> Ian
>>>>
>>>
>>> The fallback should be cpu-clock in case hardware event cycles (or CPU_CYCLES on s390) does not exist.
>>
>> Thanks Thomas, so the change is doing:
>> ```
>> -       if ! perf record -o "$perfdata" -F 99 -g -- perf test -w noploop
>> +       if ! perf record -o "$perfdata" -e cpu-clock -F 99 -g -- perf
>> test -w noploop
>> ```
>> where the default event is cycles:
>> https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/evlist.c#n116
>> Given that cycles will fail but then fallback to cpu-clock:
>> https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/evsel.c#n3792
>> I wonder if the issue is that the fallback is broken. Specifically:
>> ```
>>    evsel->core.attr.type   == PERF_TYPE_HARDWARE &&
>>    evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES) {
>> ```
>> It isn't going to work well on hybrid machines or those whose PMU's
>> sysfs events or JSON include a cycles event. I wonder if using
>> `evsel__match(evsel, HARDWARE, CYCLES)` would be better, as the
>> evsel__match code is more robust to these kind of variances. I don't
>> know if that will address the fallback problem for you.
> 
> I suspect it may return a different error code on s390.
> 
> Thanks,
> Namhyung
> 

This is interesting, further debugging revealed this:
 # ./perf record -F 99 --call-graph dwarf  -F99 -- perf test -w noploop
Error:
Failure to open event 'cpum_cf/cycles/PH' on PMU 'cpum_cf' which will be removed.
cpum_cf/cycles/PH: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'
Error:
Failure to open any events for recording.
 # ./perf record -F 99 -g -- perf test -w noploop
Error:
Failure to open event 'cpum_cf/cycles/PH' on PMU 'cpum_cf' which will be removed.
cpum_cf/cycles/PH: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'
Error:
Failure to open any events for recording.
 # ./perf record -F 99  -- perf test -w noploop
[ perf record: Woken up 1 times to write data ]
Failed to open /proc/schedstat
[ perf record: Captured and wrote 0.012 MB perf.data (95 samples) ]
 # 

So the real issue is the -g / --call-graph dwarf option. s390 supports only dwarf.
But with --call-graph event 'cpum_cf/cycles/PH' is used, that is modifier H is added.
 # ./perf evlist
 cpum_cf/cycles/P
 #

Without that option modifier H is not added and all is well.

I suggest to drop the call-graph option. If that option is needed for the test
than we need a s390 change anyway.

-- 
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH

Vorsitzender des Aufsichtsrats: Wolfgang Wendt

Geschäftsführung: David Faller

Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

  reply	other threads:[~2026-03-11  7:21 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  7:10 [PATCH] perf test: Fix test case 120 and 121 for s390 Thomas Richter
2026-03-06 15:51 ` Jan Polensky
2026-03-06 16:53   ` Ian Rogers
2026-03-09 12:59     ` Thomas Richter
2026-03-09 18:18       ` Ian Rogers
2026-03-11  6:09         ` Namhyung Kim
2026-03-11  7:21           ` Thomas Richter [this message]
2026-03-12  3:19             ` [PATCH v1 0/2] perf evsel fallback changes Ian Rogers
2026-03-12  3:19               ` [PATCH v1 1/2] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-12  3:19               ` [PATCH v1 2/2] perf evsel: Don't configure framepointer callchains on s390 Ian Rogers
2026-03-12  6:16               ` [PATCH v2 0/2] perf evsel fallback changes Ian Rogers
2026-03-12  6:16                 ` [PATCH v2 1/2] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-12  6:16                 ` [PATCH v2 2/2] perf evsel: Don't configure framepointer callchains on s390 Ian Rogers
2026-03-12 12:45                   ` Thomas Richter
2026-03-12 15:54                     ` Ian Rogers
2026-03-12 16:46                       ` Ian Rogers
2026-03-12 18:00                         ` Namhyung Kim
2026-03-13  9:46                         ` Thomas Richter
2026-03-13 21:01                           ` Namhyung Kim
2026-03-13 20:28                 ` [PATCH v3 0/3] perf evsel fallback changes Ian Rogers
2026-03-13 20:28                   ` [PATCH v3 1/3] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-13 20:28                   ` [PATCH v3 2/3] perf target: Constify simple check functions Ian Rogers
2026-03-13 20:28                   ` [PATCH v3 3/3] perf evlist: Improve default event for s390 Ian Rogers
2026-03-16 12:13                     ` Thomas Richter
2026-03-16 18:41                       ` Ian Rogers
2026-03-17  3:05                         ` [PATCH v4 0/5] perf evsel fallback changes Ian Rogers
2026-03-17  3:05                           ` [PATCH v4 1/5] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-17  3:05                           ` [PATCH v4 2/5] perf target: Constify simple check functions Ian Rogers
2026-03-17  3:05                           ` [PATCH v4 3/5] perf evsel: Constify option arguments to config functions Ian Rogers
2026-03-17  3:06                           ` [PATCH v4 4/5] perf callchain: Move callchain option parsing out of builtin Ian Rogers
2026-03-17  3:06                           ` [PATCH v4 5/5] perf evlist: Improve default event for s390 Ian Rogers
2026-03-17  5:53                           ` [PATCH v5 0/5] perf evsel fallback changes Ian Rogers
2026-03-17  5:53                             ` [PATCH v5 1/5] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-17  5:53                             ` [PATCH v5 2/5] perf target: Constify simple check functions Ian Rogers
2026-03-17  5:53                             ` [PATCH v5 3/5] perf evsel: Constify option arguments to config functions Ian Rogers
2026-03-17  5:53                             ` [PATCH v5 4/5] perf callchain: Refactor callchain option parsing Ian Rogers
2026-03-17  5:53                             ` [PATCH v5 5/5] perf evlist: Improve default event for s390 Ian Rogers
2026-03-17  7:52                               ` Thomas Richter
2026-03-17 15:54                                 ` Ian Rogers
2026-03-17 17:56                                   ` [PATCH v6 0/5] perf evsel fallback changes, better s390 defaults Ian Rogers
2026-03-17 17:56                                     ` [PATCH v6 1/5] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-17 17:56                                     ` [PATCH v6 2/5] perf target: Constify simple check functions Ian Rogers
2026-03-17 17:56                                     ` [PATCH v6 3/5] perf evsel: Constify option arguments to config functions Ian Rogers
2026-03-17 17:56                                     ` [PATCH v6 4/5] perf callchain: Refactor callchain option parsing Ian Rogers
2026-03-17 17:56                                     ` [PATCH v6 5/5] perf evlist: Improve default event for s390 Ian Rogers
2026-03-18  8:20                                     ` [PATCH v6 0/5] perf evsel fallback changes, better s390 defaults Thomas Richter
2026-03-18 16:29                                       ` Ian Rogers
2026-03-18 17:58                                         ` [PATCH v7 " Ian Rogers
2026-03-18 17:58                                           ` [PATCH v7 1/5] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-18 17:58                                           ` [PATCH v7 2/5] perf target: Constify simple check functions Ian Rogers
2026-03-18 17:58                                           ` [PATCH v7 3/5] perf evsel: Constify option arguments to config functions Ian Rogers
2026-03-18 17:58                                           ` [PATCH v7 4/5] perf callchain: Refactor callchain option parsing Ian Rogers
2026-03-18 17:58                                           ` [PATCH v7 5/5] perf evlist: Improve default event for s390 Ian Rogers
2026-03-18 23:45                                           ` [PATCH v8 0/5] perf evsel fallback changes, better s390 defaults Ian Rogers
2026-03-18 23:45                                             ` [PATCH v8 1/5] perf evsel: Improve falling back from cycles Ian Rogers
2026-03-18 23:45                                             ` [PATCH v8 2/5] perf target: Constify simple check functions Ian Rogers
2026-03-18 23:45                                             ` [PATCH v8 3/5] perf evsel: Constify option arguments to config functions Ian Rogers
2026-03-18 23:45                                             ` [PATCH v8 4/5] perf callchain: Refactor callchain option parsing Ian Rogers
2026-03-18 23:46                                             ` [PATCH v8 5/5] perf evlist: Improve default event for s390 Ian Rogers
2026-03-19  7:53                                               ` Thomas Richter
2026-03-19  5:39                                             ` [PATCH v8 0/5] perf evsel fallback changes, better s390 defaults Ian Rogers
2026-03-19  8:02                                               ` Thomas Richter
2026-03-20 18:12                                             ` Namhyung Kim

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=131d7e1e-701e-4f5b-961f-c85af74f1d96@linux.ibm.com \
    --to=tmricht@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=japo@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=sumanthk@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.