Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jiebin Sun" <jiebin.sun@intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 4/4] perf tests c2c: Add function view stdio coverage
Date: Fri, 21 Aug 2026 05:58:03 +0000	[thread overview]
Message-ID: <20260821055803.74B191F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <9bd7a313c9c1d71058e857c320c6d5c30cf4cbfa.1787283281.git.jiebin.sun@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The newly added `test_c2c_function_report` test fails spuriously because it incorrectly assumes `perfdata` is valid when `err` is 0. If the workload in `test_c2c_record_report` fails, it returns early but leaves `err=0`. This causes `test_c2c_function_report` to process an invalid or missing `perfdata` file, failing its diagnostic checks and setting `err=1` (test failure).
--

--- Patch [4]: [PATCH 4/4] perf tests c2c: Add function view stdio coverage ---
commit 32c977aa30c2c6186f39077056298ef3b53307dd
Author: Jiebin Sun <jiebin.sun@intel.com>

perf tests c2c: Add function view stdio coverage

Exercise the function view without driving a terminal now that it has
a stdio path. Keep the existing datasym record/report coverage and make a
separate recording of the contended locks used by the futex hash benchmark.

> diff --git a/tools/perf/tests/shell/c2c.sh b/tools/perf/tests/shell/c2c.sh
> index f5f223cbf9cc7..cf76359d19ccd 100755
> --- a/tools/perf/tests/shell/c2c.sh
> +++ b/tools/perf/tests/shell/c2c.sh
[ ... ]
> @@ -58,6 +63,114 @@ test_c2c_record_report() {
>  	echo "c2c record and report test [Success]"
>  }
>  
> +test_c2c_function_report() {
> +	echo "c2c function stdio report test"
> +
> +	if perf c2c report -i "${perfdata}" --function -c pid > "${perfout}" 2>&1 ; then
> +		echo "c2c function stdio report test [Failed: report accepted missing iaddr]"
> +		err=1
> +		return
> +	fi
[ ... ]
>  test_c2c_record_report
> +if [ "${err}" -eq 0 ]; then
> +	test_c2c_function_report
> +fi
>  cleanup
>  exit $err

[Severity: Medium]
Will this lead to a spurious test failure if the record workload fails?

In test_c2c_record_report(), if the 'perf test -w datasym 1' workload fails,
it returns early without modifying err, leaving err=0:

	if ! perf c2c record -o "${perfdata}" -- perf test -w datasym 1 > /dev/null 2>&1 ; then
		echo "c2c record and report test [Skipped: perf c2c record failed during workload]"
		return
	fi

Because err remains 0, test_c2c_function_report() will conditionally execute
and attempt to use the missing or invalid perfdata file. This will cause
test_c2c_function_report() to fail its diagnostic checks and set err=1.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787283281.git.jiebin.sun@intel.com?part=4

      reply	other threads:[~2026-08-21  5:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  5:56 [PATCH 0/4] perf c2c: Add function-view stdio support and coverage Jiebin Sun
2026-08-21  5:56 ` [PATCH 1/4] perf c2c: Fix documented default coalesce fields Jiebin Sun
2026-08-21  5:57   ` sashiko-bot
2026-08-21  5:56 ` [PATCH 2/4] perf tests c2c: Report skip when the workload fails Jiebin Sun
2026-08-21  5:52   ` sashiko-bot
2026-08-21  5:56 ` [PATCH 3/4] perf c2c: Add stdio support for the function view Jiebin Sun
2026-08-21  5:58   ` sashiko-bot
2026-08-21  5:56 ` [PATCH 4/4] perf tests c2c: Add function view stdio coverage Jiebin Sun
2026-08-21  5:58   ` 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=20260821055803.74B191F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jiebin.sun@intel.com \
    --cc=linux-perf-users@vger.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