public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1] perf test: Fix inet_pton probe failure due to multiple probes
Date: Fri, 10 Apr 2026 00:38:05 +0000	[thread overview]
Message-ID: <20260410003806.27EC4C4CEF7@smtp.kernel.org> (raw)
In-Reply-To: <20260410002351.10856-1-irogers@google.com>

Sashiko AI review found 1 potential issue(s):
- [Medium] The use of `sort -u` fails to guarantee a single event name on systems without uprobe multiprobe support, leaving the test broken in those environments.
--

commit 82ddf08abe58056272425532334245db796f2020
Author: Ian Rogers <irogers@google.com>

perf test: Fix inet_pton probe failure due to multiple probes

This commit attempts to fix a test failure caused by perf probe outputting
multiple probe points. It replaces a tail/head pipeline with sort -u to try
and extract a single, unique event name from the awk script output.

> diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> index ab99bef556bf0..b717063f70c27 100755
> --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> @@ -22,9 +22,9 @@ event_pattern='probe_libc:inet_pton(_[[:digit:]]+)?'
>  
>  add_libc_inet_pton_event() {
>  
> -	event_name=$(perf probe -f -x $libc -a inet_pton 2>&1 | tail -n +2 | head -n -5 | \
> +	event_name=$(perf probe -f -x $libc -a inet_pton 2>&1 | \
>  			awk -v ep="$event_pattern" -v l="$libc" '$0 ~ ep && $0 ~ \
> -			("\\(on inet_pton in " l "\\)") {print $1}')
> +			("\\(on inet_pton in " l "\\)") {print $1}' | sort -u)

Does sort -u guarantee a single event name is captured on kernels without
uprobe multiprobe support?

On systems without multiprobe support, perf probe actively prevents name
collisions by appending indices to subsequent probe points, outputting
names like probe_libc:inet_pton and probe_libc:inet_pton_1. 

Because these strings are textually distinct, sort -u will output all of
them rather than deduplicating them.

This leaves the event_name variable containing multiple words separated by
newlines. When expanded unquoted in the subsequent perf record and perf probe
commands, bash word splitting causes the same syntax errors the patch intends
to fix.

Could this use head -n 1 or awk '{print $1; exit}' instead to robustly
guarantee a single name is captured across all environments?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260410002351.10856-1-irogers@google.com?part=1

      reply	other threads:[~2026-04-10  0:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10  0:23 [PATCH v1] perf test: Fix inet_pton probe failure due to multiple probes Ian Rogers
2026-04-10  0:38 ` 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=20260410003806.27EC4C4CEF7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko@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