From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 79F7C436366 for ; Tue, 9 Jun 2026 14:40:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781016049; cv=none; b=sAyf6uzNPcpWD6rr6MispaMJT9qRRs2hHhPkUjsIoDuOYtYVlVIJSeyi4pu1XX6OVWuQVlBvHRTB5Ak9zqH3Pvtbiq3DJqW9fNB4JyFNtcV0Zxow/Q7xgaHtC/+yABBzCn7HeQkjzFd/xMZeNWWnNsk3u3o796CJULiAWRRkL5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781016049; c=relaxed/simple; bh=ZLOVVoBWIvoSYAEUTNtbgZWHkQY4f1NrccmUuoSiPY4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U+w9R5gvdVogbCYEUM/QO99Wcd5HzZXFvncKAYrYFjw08qDtNLQgBSNDmuZWwhX4r/PFWfXq0BmjpE1ltfblHEujJ13Cu+2BuNzMt/gGMJaFM4vJFxgY9laXc+jKxH9ERzbqYFsXriFwYFkCHAexXO1PAc83d9wURM9gh9n3fto= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RXiuRRIJ; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RXiuRRIJ" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-490b64c8311so62877255e9.3 for ; Tue, 09 Jun 2026 07:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781016046; x=1781620846; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=95NlgPR4KTlap0RZdRAD+2OgBeEJ40DU9UYZfVmgTrg=; b=RXiuRRIJFB27yKNIWrzQg3UUHsV62VowcDfsm5th/B/dWC31LkFsgUKiEmX8mW8bUX p4/2EvohxxTtzXMIxh81pdApmnQS9MN0y317AyN2vMA5+qoX3P44pSgdQqkpbTH2owS5 dkbzFk3hI2oHktfwTy9HnMjlqjkcF5iy2dNfeqHcVcXErMUec9DDNqzPNmIcJeEG7vOT ZBZhLJ3pesRlcnCRL9roDcS757fNqF3USYDpSQsNJUD/ySx7xw1g4Sxnjk5Rj2vGdJIT TTV3CNrbLO5j063hjt7PIS6kW9/CdZxq0Bo5tqXCeCn1l+di9NqEGip9oW8JKf0GHcmY 8h6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781016046; x=1781620846; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=95NlgPR4KTlap0RZdRAD+2OgBeEJ40DU9UYZfVmgTrg=; b=AjsEpxJdKXU9DXR5Ez8vuInm9w80XYt1DiWdxriKoLEk9lZU+aQA4KCzJ9hZrMVX2I kQXhc+vESQ2ntHylJ1h+sPaqLDnCgI4S87/0Py56mubvOv6VvNTcDInsUWfGk6QUfR14 ulpc5SgZqNwGxF4h1JsIHehK8J7sJzdHJ7sgvG/pW/NwDDBFe2zW5T30vTnDn7J26w6h RKZVykPZ7ZiH67xnkX7Y4qsiBvnA+2de5zT0jeTKNN3ty0SM0PAnwHQKwQYGgqaW9NOI qe7PEqJSXlzYL5laKyo/+25Ye75XDaKG8iEj4eQdby75s7SqA4Ezjvt8hwUoVKI4P5sr JOxA== X-Forwarded-Encrypted: i=1; AFNElJ+RRIoh6ciysKGvQLb9dIp+rvbIZMAG80GHYdJnvT2DmzpJJqdOB+Dm9ChGUF1sVrUKNuWpap5G43C3BDE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1mUuoV3XQsJgPpOwJpRca6Eyot+FrTNU8dWxxjAlCh8jmVGbT JXS3DWglZZTQvZ7JG0v+5m9TGc7wadZp2X9PkneccFqXqxYg2Gej75n73loxqcLdBNQ= X-Gm-Gg: Acq92OHcaNqR/E+ZIL8i58SPryioNkXO+RboVxFr/Ma7BPuX4600RXGasj3SbSjuN8v MfUcFP+PmtU1bSIbz0dZJmCrVuQuCOIamNVU0+zIJZ1nU9xRGp+FctITWPVZ9Vc6f30GxitQSSl CHacc7eELjKVEhAO1n1ogFviGLG7V6+lKIYZc6m39eGJI9b9J/fRtReJV0EFQ2/BZQp0ZGgDcfo KnVIv5CDtwtKkg8KRFASE4JyU5FbKFyaPldw/+GmQgtAIep9ZxAgG6VfVw21pOgTdqwYOTg8nUF IaCgAHf9L5ZkweLSUmIYXLlKd8p0pjeJHaAVilVl6cO40dDSx4Wpj6J0V1Zv3haail7E5fQQiR8 ZKTpCOX4x9IhBTYYxjVcGS0li7WVnTlT6g/lxwpIhyrk1OmUa8nMHRNwVjm2Xqg6nECE7BqDPKp YHnosvBjA9ylrMlrUc2c6GY7k37LTlXJczCBUCsbBznHoOxyqSqgIyXQ== X-Received: by 2002:a05:600c:3e0a:b0:490:b724:dbe3 with SMTP id 5b1f17b1804b1-490c25a07c4mr317921875e9.8.1781016045935; Tue, 09 Jun 2026 07:40:45 -0700 (PDT) Received: from ho-tower-lan.lan ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490bc3c1149sm428411935e9.4.2026.06.09.07.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 07:40:45 -0700 (PDT) From: James Clark Date: Tue, 09 Jun 2026 15:40:21 +0100 Subject: [PATCH v5 16/19] perf test cs-etm: Make disassembly test use kcore Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260609-james-cs-context-tracking-fix-v5-16-d53a7d096a19@linaro.org> References: <20260609-james-cs-context-tracking-fix-v5-0-d53a7d096a19@linaro.org> In-Reply-To: <20260609-james-cs-context-tracking-fix-v5-0-d53a7d096a19@linaro.org> To: Suzuki K Poulose , Mike Leach , Leo Yan , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Amir Ayupov , Jonathan Corbet , Shuah Khan , Paschalis Mpeis Cc: coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , linux-doc@vger.kernel.org, James Clark X-Mailer: b4 0.14.0 Hits in modules return empty disassembly with vmlinux as an input to objdump. Make the disassembly test more reliable by always using kcore. And update the comments to say that this is supported by the script. Signed-off-by: James Clark --- tools/perf/scripts/python/arm-cs-trace-disasm.py | 20 ++++++++++---------- tools/perf/tests/shell/test_arm_coresight_disasm.sh | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py index ba208c90d631..8f6fa4a007b4 100755 --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py @@ -18,29 +18,29 @@ from perf_trace_context import perf_sample_srccode, perf_config_get # Below are some example commands for using this script. # Note a --kcore recording is required for accurate decode -# due to the alternatives patching mechanism. However this -# script only supports reading vmlinux for disassembly dump, -# meaning that any patched instructions will appear -# as unpatched, but the instruction ranges themselves will -# be correct. In addition to this, source line info comes -# from Perf, and when using kcore there is no debug info. The -# following lists the supported features in each mode: +# due to the alternatives patching mechanism. In addition to this, +# source line info comes from Perf, and when using kcore there is +# no debug info. The following lists the supported features in each mode: # # +-----------+-----------------+------------------+------------------+ # | Recording | Accurate decode | Source line dump | Disassembly dump | # +-----------+-----------------+------------------+------------------+ # | --kcore | yes | no | yes | -# | normal | no | yes | yes | +# | normal | no | yes (inaccurate) | yes (inaccurate) | # +-----------+-----------------+------------------+------------------+ # # Output disassembly with objdump and auto detect vmlinux -# (when running on same machine.) +# (when running on same machine.): # perf script -s scripts/python/arm-cs-trace-disasm.py -d # # Output disassembly with llvm-objdump: # perf script -s scripts/python/arm-cs-trace-disasm.py \ # -- -d llvm-objdump-11 -k path/to/vmlinux # +# Output accurate disassembly by passing kcore to script: +# perf script -s scripts/python/arm-cs-trace-disasm.py \ +# -- -d -k perf.data/kcore_dir/kcore +# # Output only source line and symbols: # perf script -s scripts/python/arm-cs-trace-disasm.py @@ -57,7 +57,7 @@ def int_arg(v): args = argparse.ArgumentParser() args.add_argument("-k", "--vmlinux", - help="Set path to vmlinux file. Omit to autodetect if running on same machine") + help="Set path to vmlinux or kcore file. Omit to autodetect if running on same machine") args.add_argument("-d", "--objdump", nargs="?", const=default_objdump(), help="Show disassembly. Can also be used to change the objdump path"), args.add_argument("-v", "--verbose", action="store_true", help="Enable debugging log") diff --git a/tools/perf/tests/shell/test_arm_coresight_disasm.sh b/tools/perf/tests/shell/test_arm_coresight_disasm.sh index 339ae4831868..87797d239f76 100755 --- a/tools/perf/tests/shell/test_arm_coresight_disasm.sh +++ b/tools/perf/tests/shell/test_arm_coresight_disasm.sh @@ -46,7 +46,7 @@ if [ "$(id -u)" == 0 ] && [ -e /proc/kcore ]; then echo "Testing kernel disassembly" perf record -o ${perfdata} -e cs_etm//k --kcore -- touch $file > /dev/null 2>&1 perf script -i ${perfdata} -s python:${script_path} -- \ - -d --stop-sample=30 2> /dev/null > ${file} + -d --stop-sample=30 -k ${perfdata}/kcore_dir/kcore 2> /dev/null > ${file} grep -q -e ${branch_search} ${file} echo "Found kernel branches" else -- 2.34.1