public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Martin Kaiser <martin@kaiser.cx>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] perf test: fix nanosleep check in the ftrace test
Date: Mon, 27 Apr 2026 15:29:45 -0700	[thread overview]
Message-ID: <ae_jWY54Umgr6gDN@google.com> (raw)
In-Reply-To: <20260427090225.794482-2-martin@kaiser.cx>

On Mon, Apr 27, 2026 at 11:01:41AM +0200, Martin Kaiser wrote:
> The perf ftrace test case runs
> 
> perf ftrace profile --graph-opts depth=5 sleep 0.1
> 
> and checks that the output contains a *clock_nanosleep function with a
> count of 1.
> 
> This fails on a risc-v system that uses musl as its C library. musl's
> nanosleep syscall wrapper uses either the nanosleep or the
> clock_nanosleep syscall.
> 
> Filter for sys_*nanosleep to allow both syscalls.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/tests/shell/ftrace.sh | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/tests/shell/ftrace.sh b/tools/perf/tests/shell/ftrace.sh
> index 7f8aafcbb761..9f6e590f6437 100755
> --- a/tools/perf/tests/shell/ftrace.sh
> +++ b/tools/perf/tests/shell/ftrace.sh
> @@ -71,9 +71,10 @@ test_ftrace_profile() {
>      grep ^# "${output}"
>      time_re="[[:space:]]+1[[:digit:]]{5}\.[[:digit:]]{3}"
>      # 100283.000 100283.000 100283.000          1   __x64_sys_clock_nanosleep
> -    # Check for one *clock_nanosleep line with a Count of just 1 that takes a bit more than 0.1 seconds
> -    # Strip the _x64_sys part to work with other architectures
> -    grep -E "^${time_re}${time_re}${time_re}[[:space:]]+1[[:space:]]+.*clock_nanosleep" "${output}"
> +    # Check for one *sys_*nanosleep line with a Count of just 1 that takes a bit more than 0.1 seconds
> +    # Strip the _x64_ part to work with other architectures, strip the clock part to support
> +    # C libraries that use the nanosleep syscall instead of clock_nanosleep
> +    grep -E "^${time_re}${time_re}${time_re}[[:space:]]+1[[:space:]]+.*sys_.*nanosleep" "${output}"
>      echo "perf ftrace profile test  [Success]"
>  }
>  
> -- 
> 2.43.7
> 

  reply	other threads:[~2026-04-27 22:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  9:01 [PATCH 0/3] perf: fix some tests for musl Martin Kaiser
2026-04-27  9:01 ` [PATCH 1/3] perf test: fix nanosleep check in the ftrace test Martin Kaiser
2026-04-27 22:29   ` Namhyung Kim [this message]
2026-04-27  9:01 ` [PATCH 2/3] perf test: fix sys_enter_openat event test for musl Martin Kaiser
2026-04-27  9:01 ` [PATCH 3/3] perf test: fix "trace summary" test for musl-based systems Martin Kaiser

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=ae_jWY54Umgr6gDN@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=martin@kaiser.cx \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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