Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Namhyung Kim" <namhyung@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 6/6] perf test: Simplify perf kvm record/report tests
Date: Tue, 23 Jun 2026 21:57:28 +0000	[thread overview]
Message-ID: <20260623215728.947A21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260623191439.3621593-7-namhyung@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unwrapped command execution in test script with `set -e` causes premature exit on failure.
--

commit 3ce1271a163998e293f818fbfbc37ed07914f209
Author: Namhyung Kim <namhyung@kernel.org>

perf test: Simplify perf kvm record/report tests

It can now pass command line arguments to perf kvm record --host.
Let's pass 'sleep 1' directly rather than running it in background.

> diff --git a/tools/perf/tests/shell/kvm.sh b/tools/perf/tests/shell/kvm.sh
> index f88e859025c42..4ca10388748de 100755
> --- a/tools/perf/tests/shell/kvm.sh
> +++ b/tools/perf/tests/shell/kvm.sh
> @@ -63,13 +63,7 @@ test_kvm_record_report() {
>  	echo "Recording kvm profile for pid ${qemu_pid}..."
>  	# Use --host to avoid needing guest symbols/mounts for this simple test
>  	# We just want to verify the command runs and produces data
> -	# We run in background and kill it because 'perf kvm record' appends options
> -	# after the command, which breaks 'sleep' (e.g. it gets '-e cycles').
> -	perf kvm --host record -p "${qemu_pid}" -o "${perfdata}" &
> -	rec_pid=$!
> -	sleep 1
> -	kill -INT "${rec_pid}"
> -	wait "${rec_pid}" || true
> +	perf kvm --host record -p "${qemu_pid}" -o "${perfdata}" sleep 1

[Severity: Medium]
Since this script runs with set -e, will a failure in perf kvm here cause 
the script to exit immediately?

The previous backgrounding implementation handled failures gracefully using
wait "${rec_pid}" || true. If this new foreground command fails (for example 
due to restricted perf_event_paranoid settings), it seems the entire test 
script will abort early and skip the remaining tests instead of accumulating 
errors gracefully. 

Should this be wrapped to catch failures, or append || true to prevent a 
premature script exit?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260623191439.3621593-1-namhyung@kernel.org?part=6

      reply	other threads:[~2026-06-23 21:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 19:14 [PATCH v2 0/6] perf kvm: A small update in the default arch event Namhyung Kim
2026-06-23 19:14 ` [PATCH v2 1/6] perf kvm: Factor out kvm_need_default_arch_event() Namhyung Kim
2026-06-23 21:20   ` sashiko-bot
2026-06-23 19:14 ` [PATCH v2 2/6] perf kvm: Check kvm_need_default_arch_event() early Namhyung Kim
2026-06-23 19:14 ` [PATCH v2 3/6] perf kvm: Kill STRDUP_FAIL_EXIT() Namhyung Kim
2026-06-23 19:14 ` [PATCH v2 4/6] perf kvm: Do not copy filename string Namhyung Kim
2026-06-23 21:46   ` sashiko-bot
2026-06-23 19:14 ` [PATCH v2 5/6] perf kvm: Fix a memory leak in the usage string Namhyung Kim
2026-06-23 19:14 ` [PATCH v2 6/6] perf test: Simplify perf kvm record/report tests Namhyung Kim
2026-06-23 21:57   ` sashiko-bot [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=20260623215728.947A21F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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