From: Thomas Richter <tmricht@linux.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "linux-perf-use." <linux-perf-users@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Sumanth Korikkar <sumanthk@linux.ibm.com>
Subject: Re: REGRESSION linux-next since Nov 16th, perf tool broken (at least on s390)
Date: Thu, 23 Nov 2023 12:38:31 +0100 [thread overview]
Message-ID: <74ee8a88-1b3a-4aa5-84d0-d1c77e400e1b@linux.ibm.com> (raw)
In-Reply-To: <20231122100756.GP8262@noisy.programming.kicks-ass.net>
On 11/22/23 11:07, Peter Zijlstra wrote:
> On Wed, Nov 22, 2023 at 08:38:28AM +0100, Thomas Richter wrote:
>> perf tool fails on linux-next since Nov 16th on s390 when invoking perf on
>> any PMU event, as in
>>
>> # perf stat -e cycles -- true
>>
>> Performance counter stats for 'true':
>>
>> <not supported> cycles
>>
>> 0.000598399 seconds time elapsed
>>
>> 0.000055000 seconds user
>> 0.000567000 seconds sys
>>
>> # perf stat -e pai_ext/NNPA_ALL/ -C0 -- true
>> event syntax error: 'pai_ext/NNPA_ALL/'
>> \___ Bad event or PMU
>>
>> Unable to find PMU or event on a PMU of 'pai_ext'
>>
>> Initial error:
>> event syntax error: 'pai_ext/NNPA_ALL/'
>> \___ Cannot find PMU `pai_ext'. Missing kernel support?
>> #
>>
>> This error is caused by following commit, which got into linux-next around November 15th:
>>
>> commit 652ffc2104ec1f69dd4a46313888c33527145ccf
>> Author: Greg KH <gregkh@linuxfoundation.org>
>> Date: Mon Jun 12 15:09:09 2023 +0200
>>
>> perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file
>>
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>> Link: https://lkml.kernel.org/r/2023061204-decal-flyable-6090@gregkh
>>
>> This commit adds function pmu_dev_is_visible() as the PMU bus function
>> to make sysfs attribute files visible.
>> On a failing system these sysfs attribute files are exported:
>
> Does this help? I'm not entirely sure on the is_visible thing, but the
> way I understand it, it was only supposed to hide the nr_filters thing,
> not the entire group and @n helps select the attribute.
>
> Greg, did I get that right?
>
> Also, spurious return... clearly I should've woken up before merging
> that patch... oh well.
>
> ---
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 4f0c45ab8d7d..59b332cce9e7 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -11417,12 +11417,10 @@ static umode_t pmu_dev_is_visible(struct kobject *kobj, struct attribute *a, int
> struct device *dev = kobj_to_dev(kobj);
> struct pmu *pmu = dev_get_drvdata(dev);
>
> - if (!pmu->nr_addr_filters)
> + if (n == 2 && !pmu->nr_addr_filters)
> return 0;
>
> return a->mode;
> -
> - return 0;
> }
>
> static struct attribute_group pmu_dev_attr_group = {
Yep, this fixes the issue. As you can see, the type file etc is exported again:
# ll /sys/devices/pai_crypto/
total 0
drwxr-xr-x. 2 root root 0 Nov 23 12:19 events
drwxr-xr-x. 2 root root 0 Nov 23 12:19 format
-rw-r--r--. 1 root root 4096 Nov 23 12:19 perf_event_mux_interval_ms
lrwxrwxrwx. 1 root root 0 Nov 23 12:18 subsystem -> ../../bus/event_source
-r--r--r--. 1 root root 4096 Nov 23 12:19 type
-rw-r--r--. 1 root root 4096 Nov 23 12:19 uevent
# perf stat -a -e pai_crypto/KM_DEA/ -- true
Performance counter stats for 'system wide':
0 pai_crypto/KM_DEA/
0.000983239 seconds time elapsed
#
This looks very and and you have my
Tested-by: Thomas Richter <tmricht@linux.ibm.com
--
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
prev parent reply other threads:[~2023-11-23 11:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 7:38 REGRESSION linux-next since Nov 16th, perf tool broken (at least on s390) Thomas Richter
2023-11-22 8:06 ` Bagas Sanjaya
2023-11-22 9:31 ` Greg KH
2023-11-23 7:54 ` Thomas Richter
2023-11-23 8:43 ` Greg KH
2023-11-22 10:07 ` Peter Zijlstra
2023-11-22 14:38 ` Thomas Richter
2023-11-22 15:29 ` Peter Zijlstra
2023-11-23 11:38 ` Thomas Richter [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=74ee8a88-1b3a-4aa5-84d0-d1c77e400e1b@linux.ibm.com \
--to=tmricht@linux.ibm.com \
--cc=acme@kernel.org \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=hca@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox