From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (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 26ED33148C5 for ; Tue, 9 Jun 2026 05:18:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780982301; cv=none; b=jSy/3t3gpiyBavl3eX2Gn+BmaQT1HCV6tmf6+B1cKaQwfZdMr+WhlO0r+wu9QvidS86CDshgUdoKY8LxzHgMpemO9PCex6jEIV0NxY9e2ZdJGcraNyF2VFaG7x2JCFWi6Rzmps+Hvvl34sYnDdRSIIaJui3lSCYqtpkbwjD6hLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780982301; c=relaxed/simple; bh=AULg6TS9zdVYAzc0iEIaIlPZ4bBNNUvjdY5hipajSlY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=PQNYyOIblnPDwCf1HTSLIqgF+P5akQ8jVPlp4XB7+OFujK7nLDyw/WTFYVV9496XI0+016PV6Ha41cYEDZp3siUAlCMt0pW0xSaZwct7pwIfgqjCOr1RnP9k3BmiLMTcb0cM65t39XICiBixSlbW8u5p2GVk1L1DV/Uq56GjePE= 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=pGljWcFd; arc=none smtp.client-ip=74.125.82.74 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="pGljWcFd" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-137dd3a60e8so6573751c88.0 for ; Mon, 08 Jun 2026 22:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780982299; x=1781587099; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=0dcjYmV9oSCkLLYv23l2rswMcx+M5a96riI5dhneKmU=; b=pGljWcFdWzeJ9jGem+R150+gALjZqWQixpT0VYzI/+dLLDBZy8emUclpPUU9S9AWju 8hXilTz/d6Cd2rlVpTu0WgxC0fI0uJ7+oj5bg+vXQCiAVxi6qCQ3y5pvnCr6BvGU0Jxy xuPKVDu38C3nRW7nZQOL/CUs13Gp+4S841RHP7lkI3OD8T4CNbaNxZRYYjwvyCXCSPww xM4BaO+hIGXINyEENPTs79Ekb/3hPfmAwHXulP2T0snEk8NAHOttYg0RY5fMMy1a3z+o 5j2zdqdyLdPFnOISE4RVYzPCUyNb8IwKsToJhrVjOxAcsXB3Z+0cfSa6qP2/6iZUBJmr 8akQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780982299; x=1781587099; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0dcjYmV9oSCkLLYv23l2rswMcx+M5a96riI5dhneKmU=; b=rzg4cdZdVlFAU6V3hsdeGjah2YOUvldOpr1ZFPU0KBoi6CnbuazzAK3s5wWMlBbxPV zeXWR8+OENiUVg3vmdEyBUrc/3oGKHeAurIllJfvcC9vrn2m6MZWr0CG3paJImKiNYQe saKCrd6VBFxAXq3Kf16531q92ROsldcPSZs+dTn2zoXbXUXWNfuYdiHHLJrL/cxbpKIX QA2HBrQCC6Uxc40a1ryUeuUv7K6THrOGgnVZeSzKknoJ6OJXrFJaRhvPDNgeGKxiljGy kSuW/HzpLM0vWmzDx13w13EXUKzyAa2ChuCwqZBx4JCQIO7/lY9PaNs/ZvbaQgOoC4fU NGGw== X-Forwarded-Encrypted: i=1; AFNElJ9udvVfaRWe7+rL0oIV0tMm14JBEiRl42xPbq0iFomAJi1IYMm/Qv6ChvPmSDrpwVjrMzMZkd7HEfSXYRw=@vger.kernel.org X-Gm-Message-State: AOJu0Ywj8yd8NoCJq+6DcPdQMb20ty0qF0u6JfQiHMm4NMBUsPDbB5oD /Ufg0wYRaz3k61lNtK0z0unHdzG4kF7G9/OlliutHR83g+oPsZm+6kdpBjUHrQ7D/Arn7YJTp7v lXPxCXWbV4Q== X-Received: from dyclx3.prod.google.com ([2002:a05:693c:2183:b0:303:f2fa:386c]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:419e:b0:137:4061:8cc2 with SMTP id a92af1059eb24-1380670e1f3mr8837301c88.35.1780982299033; Mon, 08 Jun 2026 22:18:19 -0700 (PDT) Date: Mon, 8 Jun 2026 22:17:57 -0700 In-Reply-To: <20260609051759.405027-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260609051759.405027-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.1064.gd145956f57-goog Message-ID: <20260609051759.405027-6-irogers@google.com> Subject: [PATCH v1 5/7] perf test: Enhance annotate test coverage and isolate config From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Nick Terrell , David Sterba , Nathan Chancellor , Tomas Glozar , Blake Jones , Dmitrii Dolgov <9erthalion6@gmail.com>, Alexandre Chartre , Costa Shulyupin , Yuzhuo Jing , Michael Jeanson , Leo Yan , Tianyou Li , Zecheng Li , Rong Bao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Update the annotate.sh shell test to test different disassembler backends (objdump, llvm, capstone, libasm) utilizing the new --disassembler command-line option. Isolate the test script from host environment pollution by exporting PERF_CONFIG=/dev/null at the start of the script, ensuring it runs hermetically. Assisted-by: Antigravity:Google Gemini 3.5-flash Signed-off-by: Ian Rogers --- tools/perf/tests/shell/annotate.sh | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tools/perf/tests/shell/annotate.sh b/tools/perf/tests/shell/annotate.sh index 689de58e9238..d3bafa7e3db5 100755 --- a/tools/perf/tests/shell/annotate.sh +++ b/tools/perf/tests/shell/annotate.sh @@ -4,6 +4,8 @@ set -e +export PERF_CONFIG=/dev/null + shelldir=$(dirname "$0") # shellcheck source=lib/perf_has_symbol.sh @@ -23,6 +25,7 @@ disasm_regex="[0-9]*\.[0-9]* *: *\w*: *\w*" cleanup() { rm -rf "${perfdata}" "${perfout}" rm -rf "${perfdata}".old + rm -f /tmp/__perf_test.config.* trap - EXIT TERM INT } @@ -106,8 +109,61 @@ test_basic() { echo "${mode} annotate test [Success]" } +test_disassembler() { + disassembler=$1 + feature=$2 + + if [ -n "${feature}" ] + then + if ! perf check feature "${feature}" > /dev/null 2>&1 + then + echo "Skip test for ${disassembler} (feature ${feature} not supported)" + return 0 + fi + fi + + echo "Test annotate with disassembler: ${disassembler}" + + perf annotate --no-demangle -i "${perfdata}" --stdio --percent-limit 10 --disassembler "${disassembler}" 2> /dev/null > "${perfout}" + ret=$? + + if [ "x${ret}" != "x0" ] + then + echo "annotate with ${disassembler} [Failed: perf annotate error]" + err=1 + return 1 + fi + + # check if it has the target symbol + if ! grep -q "${testsym}" "${perfout}" + then + echo "annotate with ${disassembler} [Failed: missing target symbol]" + err=1 + return 1 + fi + + # check if it has the disassembly lines + if ! grep -q "${disasm_regex}" "${perfout}" + then + echo "annotate with ${disassembler} [Failed: missing disasm output]" + err=1 + return 1 + fi + + echo "annotate with ${disassembler} [Success]" + return 0 +} + test_basic Basic test_basic Pipe +if [ "${err}" -eq 0 ] +then + test_disassembler "objdump" "" + test_disassembler "llvm" "libLLVM" + test_disassembler "capstone" "libcapstone" + test_disassembler "libasm" "libasm" +fi + cleanup exit $err -- 2.54.0.1064.gd145956f57-goog