From: Namhyung Kim <namhyung@kernel.org>
To: Jan Polensky <japo@linux.ibm.com>
Cc: adrian.hunter@intel.com, irogers@google.com,
Thomas Richter <tmricht@linux.ibm.com>,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 1/1] perf tools: Fix auto-complete on s390x
Date: Fri, 25 Jul 2025 22:27:00 -0700 [thread overview]
Message-ID: <aIRnJDMRNO8olMdD@google.com> (raw)
In-Reply-To: <20250725171354.3180806-1-japo@linux.ibm.com>
Hello,
On Fri, Jul 25, 2025 at 07:13:54PM +0200, Jan Polensky wrote:
> On s390x, CPU-related events are not located in
> event_source/devices/cpu/events. Instead, they are found in architecture
> specific locations depending on the hypervisor configuration:
>
> /sys/devices/pai_crypto/events/
> /sys/devices/cpum_cf_diag/events/
> /sys/devices/pai_ext/events/
> /sys/devices/cpum_cf/events/
> /sys/devices/cpum_sf/events/
>
> Using current auto-complete script result in the following error:
>
> [root@localhost perf]# perf top -e
> ls: cannot access '/sys/bus/event_source/devices/cpu/events': No such file or directory
>
> Fix this by skipping the check for
> /sys/bus/event_source/devices/cpu/events on s390x systems.
>
> Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> ---
> tools/perf/perf-completion.sh | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh
> index 69cba3c170d5..8db6de98007b 100644
> --- a/tools/perf/perf-completion.sh
> +++ b/tools/perf/perf-completion.sh
> @@ -168,10 +168,11 @@ __perf_main ()
> local cur1=${COMP_WORDS[COMP_CWORD]}
> local raw_evts
> local arr s tmp result cpu_evts
> + local arch=`uname -m`
>
> raw_evts=$($cmd list --raw-dump hw sw cache tracepoint pmu sdt)
> # aarch64 doesn't have /sys/bus/event_source/devices/cpu/events
> - if [[ `uname -m` != aarch64 ]]; then
> + if [[ $arch != aarch64 && $arch != s390x ]]; then
I think it's better to check if the directory exists or just ignore the
error message by redirecting to /dev/null.
Thanks,
Namhyung
> cpu_evts=$(ls /sys/bus/event_source/devices/cpu/events)
> fi
>
> --
> 2.48.1
>
prev parent reply other threads:[~2025-07-26 5:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 17:13 [PATCH v1 1/1] perf tools: Fix auto-complete on s390x Jan Polensky
2025-07-26 5:27 ` Namhyung Kim [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=aIRnJDMRNO8olMdD@google.com \
--to=namhyung@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=japo@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--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 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.