From mboxrd@z Thu Jan 1 00:00:00 1970 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 941593DA5D8 for ; Tue, 9 Jun 2026 07:07:50 +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=1780988872; cv=none; b=jBe3l+mJs/tD8Z/NkpGW8MyYpwZUZpWqHx4g2pjC8uMSbn8m5ql3KagmR/cLgYmQyk/vlYwjRsQ+VfHOJ6zMrpwX4+sHthREjEK5n5JX7pE7/yorih5Ijn894txrO1mhu+xfbVpuwC8+Fwp/odqm+GF+DTqur94jbcwzy/FI7MY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780988872; c=relaxed/simple; bh=H7rLKMOT3wtg0NltCoIV5q2RgoYwHopGnS10VXu5I3U=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=SoaK/DqrWhnVMCn4lLnFeCcZ/rw0cIz+EADeQ3x4RLiA+1HYVcq4lCXv8iZ1hsu2qrvoxeMBSbX1gSo/NSms/OQudIMPz0NG0NVQeGr3uQLGm+pf5D7lP0OB+W/FgyfgVraO0KnoV5KbvYITREw/ebwSLqDPyaIf15m0+i7g7xc= 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=p9iLakFG; 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="p9iLakFG" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-304f23c55b2so5204252eec.0 for ; Tue, 09 Jun 2026 00:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780988870; x=1781593670; 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=t/juy7qk06nJuTJJeVGuuQioE+EFh0BWQCUQcuD3Ibc=; b=p9iLakFGHAwmubh8L9vObft7KMKls+p6z+1f+TtEgQD1q/7qhRgY3AC3RsPR39PlO0 smZLhefu6cPNRckc746xrJBSAEzkxssfwgKxOh4DQWCwTEpU0dBdtUtft7PGpSY/9RAr h1FRRAc6SVQw1yjUDD0hjm+dz7U5T9WFGpzppfZpJry9+6euXjSw5sR/tXEutmsSvStV RsyBYNxtXf3K/Susar5qKJL+TteIpSdK2FHjPd4HcgUr/46f8nlsdIm/O+U5lX4vCMCG wnIv1hi3Q+7Ie7c2XtvoS4FQLWDywRbOtRjEDFizH4HmfIlOu9BugfGMBFHMkMVCpySh T+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780988870; x=1781593670; 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=t/juy7qk06nJuTJJeVGuuQioE+EFh0BWQCUQcuD3Ibc=; b=oUDhnqP5EOBLtAvXkjrRlHZbMDT9jkfwiA4+36QDRFPdnAwQfGFEWQyUaWjx491Rjz +58TQ5+SoL7emukcVF1Dgx1Kd8uod0CnpEqor39xOr74eEd2X1GoruFBgSAvI8Dxf1cT t/x97fLn1EdwDoVQLVWeCDrKe3EZ1iz1d19ns087JL1edrbNn+7rR1XKkGtB/EkGzfqh J93nj+itkg4LasNwZZtpM5WmyCSYrtGbex+qh4/o8he5HZUHwPKDM+Hq3hBHngSi31OP S7NVobCZrA8o/pIdGo3roTqZYK4ksMjxtlHD56xwPHFEgcGnvbo5ywEUM620kEIU+mb7 NMSg== X-Forwarded-Encrypted: i=1; AFNElJ//6C3ECzpkzGbYD/gCwQpKShSJFX7AER4eHVIDWIEZc7evSZ4ZlyKh+9mwBUBevvp7DlYpfOojoxX2ctg=@vger.kernel.org X-Gm-Message-State: AOJu0YyevWNLT8O/kRfg9fdJxb4yXoNkTsvfQK8hB6K7OSAxrzhqz6Na T5GoZ3sIdxtnQNZtGZsxRIMvyLzlnJKH/HYH1tIQyV5bMWrmhHW8F1zxIYTbOeppBAKySeNOk+D chvUSb0RQRA== X-Received: from dybrh10.prod.google.com ([2002:a05:7300:f00a:b0:304:561f:1afb]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:8c88:b0:304:d32e:65e7 with SMTP id 5a478bee46e88-3077ae9d56bmr10393138eec.0.1780988869407; Tue, 09 Jun 2026 00:07:49 -0700 (PDT) Date: Tue, 9 Jun 2026 00:07:30 -0700 In-Reply-To: <20260609070732.545416-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: <20260609070732.545416-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.1064.gd145956f57-goog Message-ID: <20260609070732.545416-6-irogers@google.com> Subject: [PATCH v2 5/7] perf test: Enhance annotate test coverage and isolate config From: Ian Rogers To: Serhei Makarov , mark@klomp.org, 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 | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tools/perf/tests/shell/annotate.sh b/tools/perf/tests/shell/annotate.sh index 689de58e9238..2c06d2670cb1 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 @@ -106,8 +108,60 @@ 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 0 + 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 0 + 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 0 + 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