From nobody Sat Jun 20 20:53:37 2026 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAE0E26D4F9 for ; Fri, 10 Apr 2026 00:23:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775780636; cv=none; b=XHZg2zt33LK+d2girzLxynb6zn8ViO90jBlGUrXZOBHTo3NjAUx7VTXF9SQt1sIo5PFBmPMmQHAqXz33CpvKBPIPTbD6YWsZ4VZQGQQJPzsUZ5Vm1nLiZrq7E42zBvuxAdwCt76rKIP+0+nh+DHJdlnmV6Ywg+ZtomlDKaofHEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775780636; c=relaxed/simple; bh=0aeGwRNW0xmntzjfP7YxxLFi+8s2M7WGQMmYb7loLl8=; h=Date:Mime-Version:Message-ID:Subject:From:To:Content-Type; b=ZWtf/z77KCauJ29ut6A05h0jxfJ4mE8Z1gA5nU3BjypN0THPYDDC6nrz4ynx1LzsmJxyoBDsxVQRhgASmHDvV7Z6xPZw6ZptIlLB/ndM2k75TcnuKZUlBe6HtBx1tRLLnCjYo++wLsbHd89ABISktLoim/PZgpF3i1LfBetiTsA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=I+r6veey; arc=none smtp.client-ip=74.125.82.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="I+r6veey" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2c16233ee11so1980477eec.1 for ; Thu, 09 Apr 2026 17:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775780635; x=1776385435; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=auhMbk+xHy2gdDd91CGiDgq/1FaWJaoeUXnY1AfHXxs=; b=I+r6veeyXOIyUFLEJIfjuxBPTpmQIE7mg3p1u0W90HYG0zCPPH7G7SOPhphjfnz3ZD TxbXH+cldjb9DWCrMARB+pWoLBszuwptQeXsTfcc3/4j5G/9dcx42xLgSQgD7mCiLLs1 woBD+BMF7HRwy/ohWDO/yMLUSNPT+6v11OxMDjsd3aZzoXwBGUWuthsolcdlArNH+ZXm cMqYf/Dfkee/LiywlGMbF6uKEmEVNHx6eo1UsrLMpu1Von9ug1Gs1LBQH9L1fcesJd1u W8pUU/ojrY+o0aFdS1VuzyMatwDkPf9IgO4e4PCPjbZ/LEqaSqukxRqwUED15egsXjAU YXig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775780635; x=1776385435; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=auhMbk+xHy2gdDd91CGiDgq/1FaWJaoeUXnY1AfHXxs=; b=XNMAatj4n9SyCMDJqKxjf1cT2vrS0L1N78t2NNctMhNIZVtxxRrFyQW3oYz1kuqWDu Ad6z8wjPGQA9lKxkamNnA/b9KIVMm84hoTNWLMAcwnPR6/Qp+FnqJlI7f3ZZgM76wUCL LFt7cJCUr0W7WYIGKkc/db9hTQe9DmZOa2VQYbsFDgLsOsuPVqJj18NfD0ozKtFgbCtl XhH9lqGVbO6QqUukjtWaF91uhxU0mwYqR6Xe3j6Scy/94z85oSwjHp7eDdI+7t8virwA fmt62uuUowAIEWh+ImsRarKfOgSBBOOeQjhElhdQtzCwxv1sc87LbeSk5/p11f8GA4zK S1PQ== X-Forwarded-Encrypted: i=1; AJvYcCVMSro/hrhMGLdcqHXPDtb6lus6zNzj8hwiSCPj0By3/2REKdTJzF6RcvuPBeALy5RI2wIm07EHU+6eMGg=@vger.kernel.org X-Gm-Message-State: AOJu0YzZMzDdJBRW57MnNy4tmzQ14Lc6BA/uv06CKLupgWaMpcGh+/ob MSiO1xZUGwS32xE4RNNTfgEyJk9tJEgNL0gHzr5WeyaoKCUgceE6xAzB5DPOdmlwxAvHi0DCWmX hPjCemrVsGg== X-Received: from dycng24.prod.google.com ([2002:a05:7300:ce18:b0:2ca:8cd8:d7e0]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:2b05:b0:2c8:8954:1441 with SMTP id 5a478bee46e88-2d5891764cdmr655590eec.17.1775780634492; Thu, 09 Apr 2026 17:23:54 -0700 (PDT) Date: Thu, 9 Apr 2026 17:23:51 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.53.0.1213.gd9a14994de-goog Message-ID: <20260410002351.10856-1-irogers@google.com> Subject: [PATCH v1] perf test: Fix inet_pton probe failure due to multiple probes From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Collin Funk , Chun-Tse Shao , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When adding a probe for libc's inet_pton, perf probe may create multiple probe points (e.g., due to inlining or multiple symbol resolutions), resulting in multiple identical event names being output (e.g., `probe_libc:inet_pton_1`). The script previously used a brittle pipeline (`tail -n +2 | head -n -5`) and an awk script to extract the event name. When multiple probes were added, awk would output the event name multiple times, which expanded to multiple words in bash. This broke the subsequent `perf record` and `perf probe -d` commands, causing the test to fail with: `Error: another command except --add is set.` Fix this by removing the brittle `tail/head` commands and appending `| sort -u` to the awk extraction. This ensures that only a single, unique event name is captured, regardless of how many probe points are created. Assisted-by: Gemini:gemini-3.1-pro-preview Signed-off-by: Ian Rogers --- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ab99bef556bf..b717063f70c2 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=3D'probe_libc:inet_pton(_[[:digit:]]+)?' =20 add_libc_inet_pton_event() { =20 - event_name=3D$(perf probe -f -x $libc -a inet_pton 2>&1 | tail -n +2 | he= ad -n -5 | \ + event_name=3D$(perf probe -f -x $libc -a inet_pton 2>&1 | \ awk -v ep=3D"$event_pattern" -v l=3D"$libc" '$0 ~ ep && $0 ~ \ - ("\\(on inet_pton in " l "\\)") {print $1}') + ("\\(on inet_pton in " l "\\)") {print $1}' | sort -u) =20 if [ $? -ne 0 ] || [ -z "$event_name" ] ; then printf "FAIL: could not add event\n" --=20 2.53.0.1213.gd9a14994de-goog