Received: from mail-dy1-f202.google.com (mail-dy1-f202.google.com [74.125.82.202]) (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 A8A093D8133 for ; Tue, 9 Jun 2026 07:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780988874; cv=none; b=IN41+/tiFtCZ0mZAGZjNp/wZMSgn1Spxw2sTr3k3dJNmxn6AqhN6JPm54XdWRST8O6Izsl3KGTwJzf4OEQoimXyBT+qRG54SqMiwKtmKQha74H6Fu0RuDCC/RmBwBpdknWeXU8zF3CY/ro9p4iUlMBBleFQNGQzZEODqyrGM9dI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780988874; c=relaxed/simple; bh=H7rLKMOT3wtg0NltCoIV5q2RgoYwHopGnS10VXu5I3U=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=PMujWUetunKLK9KpE5s/ki5OqDEDS5jRTS79iEWZh09UzDV5iVjN8q8KmZP1exwA2+cnWuz0XIZVJgwyiZdCQlgSK6ViL3oo6Z8RXFONqeYBCdOdsT+GxBy2HbzBOaAmqibj1LVeVzXFapHTpyiF316RmQrKgSYvPQmKs/tWWs0= 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.202 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-f202.google.com with SMTP id 5a478bee46e88-304f23c55b2so5204250eec.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=XxjJcW22TTH0FIZV0HRGZbSjNfm50ixEz0d4SXjh7csBmjz0rxxX+Yv8CFIZVbgAEy 8mxSLsKlFSbLFDZA94GEEWb/YX+1ihtKnx+OKKEYkmMBWuXb9a1dUTKUhKz/uPEWZlP9 9FXuW2Yf4MSwBGP+Gs2OdE1qzyRFZuxMx5haWOlzZOMSKE6JNvYsGQgjJtfemw+T+bnE qyBx9n6vx05Zdq0H8qrYJyx7ApmmeXZLfugnd2Ralrot/YneaHnwoQ9FgwQ6YFOnSszv OEkCKkU9nZpsKy1POFXKNmoKt7S3/o9iTNvA98BlPI+WcDwCYlf03CchKz+XLvAsh3IN x06w== X-Forwarded-Encrypted: i=1; AFNElJ8jvKX7/HoWRiISVR8YyCsUlXpG/m4TqFXycuWbVKlyDty3xEQ+0x+r4H9Pw74eHLmECcY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7o1gR2EaWFlIJQBvoAwMguq+Ug5MTBu4PjZhCAD7m7WVlMq2d W9Mj/R6fAPmoE43rFTeUPqn386+D3nmzJexEIjumVu4B8TUNAxxHQ/EjrJSOBuzvBdsdpfPORAD OM5NBm5sEMw== 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: bpf@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