On Mon, Nov 16, 2026 at 10:58:13AM +0800, Johnny Fan wrote:
> On Fri, Nov 13, 2026 at 04:00:41PM +0000, Leo Yan wrote:
>
> [...]
>
> > Based on above idea, I would fold your patch into my series (but I will
> > drop the first patch for changing TRBE/SPE drivers). I will keep you as
> > the author but please bear me a bit that I may refactor it to fit into
> > the extensions. Hope this is fine for you.
>
>
> Hi Leo,
>
> Thanks for the detailed review, and yes — please go ahead and fold it
> into your series. I'm happy for you to keep me as the author and to
> refactor it as you see fit.
Cool!
> I'll hold off posting a v4 so we don't end up with two versions under
> review. Ping me when there's something you'd like tested on the CIX
> board.
Thanks for offering to test! I'll test on my Orion6 board and send out
the patches this week. You're welcome to test them and any comments.
Even if we're testing on the same SoC, your results would still be
valuable, maybe we're using different firmware versions.
Thanks,
Leo
On 16/11/2026 02:03, Jie Gan wrote:
>
>
> On 11/12/2026 4:43 AM, Leo Yan wrote:
>> On Tue, Nov 10, 2026 at 09:46:43AM -0600, Rob Herring wrote:
>>> On Tue, Nov 10, 2026 at 09:21:13AM +0800, Jie Gan wrote:
>>>> The CoreSight TNOC (Trace Network-On-Chip) binding so far only
>>>> allowed the
>>>> two-string AMBA form "qcom,coresight-tnoc", "arm,primecell". That form
>>>> forces the device onto the AMBA bus, where the driver must read the
>>>> peripheral ID from the device registers during probe. On several QCOM
>>>> platforms this AMBA peripheral-ID probing fails, so the traceNoC device
>>>> never probes and its trace path is unavailable.
>>>
>>> But it works fine on some platforms? We have a property to override the
>>> peripheral-ID which would solve your issue. That would be much simpler
>>> and avoid the ABI break on any of the working platforms.
>>
>> Looking back at the earlier discussion [1], Jie in v2 already proposed
>> "arm,primecell-periphid". Questions about AMBA IDs and ATID handling got
>> mixed together. The series later moved towards platform-device probing,
>> then became current shape.
>>
>> Hope we make the right decision on arm,primecell-periphid this time.
>>
>> Anyway, I'd like to apologise to Jie for all the back and forth.
>>
>
> Never mind.
>
> Hi Suzuki, Rob,
>
> The "arm,primecell-periphid" override is the simplest fix for the issue.
> Which fix are your preferring for the issue? If we want fix it with DT
> property, we can revert the patch series and I will post a new one to
> fix it.
>
> As Leo mentioned, the AMBA probe is not affecting by the series.
Alright, I will remove it from the coresight next, please send the DT
fix.
Cheers
Suzuki
Hi Johnny,
On Mon, Nov 02, 2026 at 04:41:52PM +0800, Johnny.Fan wrote:
[...]
> Group the CPUs by (hetero id, interrupt) and register one platform
> device per group. A GSI may be shared between groups with
> non-overlapping CPU masks, so only unregister the GSI mapping once no
> successfully registered device uses it, as the mapping is not reference
> counted.
This is fine for me in general. For CPU grouping, we would prefter to
use MIDR rather than hetid, as events should be able to migrate between
CPUs with the same MIDR.
My concern is that we need particular change in SPE/TRBE drivers to
retrieve IRQ affinity based on this change. It is better to improve
fwnode layer to provide a general way for retrieve IRQ affinity. I did
a bit experiment with using swnode and seems it makes sense.
I would also consolidate CPU PMU device registration. That means we need
to extend the device registration to support SPI. We also need to update
PMU platform driver for ACPI device probe.
Based on above idea, I would fold your patch into my series (but I will
drop the first patch for changing TRBE/SPE drivers). I will keep you as
the author but please bear me a bit that I may refactor it to fit into
the extensions. Hope this is fine for you.
Thanks,
Leo
From: Arnaldo Carvalho de Melo <acme(a)redhat.com>
Hi,
Please consider merging,
Nothing measured how much of perf the test suite reaches. Patch 1 adds
tools/perf/scripts/coverage.sh: it builds perf with clang source based
coverage, runs the complete perf test suite and reports line and function
coverage, optionally against a baseline, with --table and --html like
pahole's coverage_table.py. Also as 'make -C tools/perf coverage',
'coverage-prep' and 'coverage-table'.
The rest is what the first runs found, in the code, the build and the
tests:
- clang DWARF 5 describes globals with DW_OP_addrx, which was not
resolved (patch 2).
- The flexible array member had no test; one showed the struct row at
0.00% while the member said 100.00% (patches 3-4).
- A struct pointer that -O2 keeps in a register was not resolved from
its DWARF location (patch 5).
- --insn-stat was printed before the loop that accounts the samples,
so --code-with-type showed zeros (patch 6).
- The libbfd probe printed a missing bfd.h error five times per
build-test run (patch 7).
- FEATURE-DUMP didn't record llvm-perf and rust, disabling both in the
build-test builds (patch 8).
- GCC 16 caught an uninitialized T32 instruction buffer read in cs-etm
(patch 9).
- The Intel PT virtual LBR check lost every aux sample with a single
data page (patch 10).
- The dlfilter test kept samples whose IP the kernel now zeroes on a
userspace-to-kernel skid (patch 11).
- The LBR inline unwinding check failed instead of skipping when the
AMD PMU rejects branch sampling (patch 12).
In a root run on this box the suite covered 49.16% of perf's 201,180
lines; three tests failed in code this series does not change (the
POLL_HUP tracepoint regression, the AMD BRS branch sampling rejection
and the lock contention count).
The harness and the tests were developed with an AI coding assistant
(OpenCode), which drafted the script and the tests and helped debug the
failures; I reviewed every change and reproduced each failure before
fixing it.
Best regards,
- Arnaldo
Arnaldo Carvalho de Melo (12):
perf scripts: Add a coverage harness for perf
perf annotate-data: Resolve DW_OP_addrx global variables
perf tests: Exercise the flexible array member path
perf annotate-data: Count flexible array accesses for the whole struct
perf tests: Exercise data type resolution from a register
perf annotate: Print the stats after the annotations
perf tests: Silence the libbfd probe in build-test
perf build: Record the display-only features in FEATURE-DUMP
perf cs-etm: Fall back to the recorded instruction size on a failed read
perf tests: Fix the Intel PT virtual LBR check
perf test: Drop samples without an IP in the dlfilter test
perf test: Skip the LBR inline unwinding check when unsupported
tools/perf/.gitignore | 1 +
tools/perf/Makefile | 11 +-
tools/perf/Makefile.config | 4 +
tools/perf/Makefile.perf | 4 +
tools/perf/builtin-annotate.c | 10 +-
tools/perf/scripts/coverage.sh | 703 ++++++++++++++++++
tools/perf/tests/make | 2 +-
tools/perf/tests/shell/addr2line_inlines.sh | 9 +-
tools/perf/tests/shell/annotate_stats.sh | 58 ++
.../perf/tests/shell/data_type_flex_array.sh | 142 ++++
.../tests/shell/data_type_profiling_clang.sh | 108 +++
tools/perf/tests/shell/data_type_register.sh | 120 +++
tools/perf/tests/shell/script_dlfilter.sh | 2 +-
tools/perf/tests/shell/test_intel_pt.sh | 9 +-
tools/perf/util/annotate-data.c | 24 +-
tools/perf/util/cs-etm.c | 7 +-
tools/perf/util/dwarf-aux.c | 42 +-
17 files changed, 1234 insertions(+), 22 deletions(-)
create mode 100755 tools/perf/scripts/coverage.sh
create mode 100755 tools/perf/tests/shell/annotate_stats.sh
create mode 100755 tools/perf/tests/shell/data_type_flex_array.sh
create mode 100755 tools/perf/tests/shell/data_type_profiling_clang.sh
create mode 100755 tools/perf/tests/shell/data_type_register.sh
base-commit: cc905a18a647a8e3ad42cd1596baa0e08fba26eb
--
2.56.0
Hi,
On Fri, Nov 13, 2026 at 07:46:41AM +0200, Igor Velkov wrote:
> Hi,
>
> Cortex-A55 (Amlogic S905X3) reports EDDEVID.PCSample = 0, so
> coresight-cpu-debug cannot use it. The PC is available through PMPCSR
> in the external PMU frame (debug frame + 0x20000, PMDEVID.PCSample = 1).
> A lab module reading PMPCSR caught the PC of a CPU stuck on a PCIe bus
> access with IRQs off; on this GICv2 SoC the stop IPI never reaches it.
>
> Two observations:
> - A panic notifier samples too late: the other CPUs are stopped by
> then, and on this SoC reading the PMU frame of a stopped CPU raises a
> synchronous external abort. Sampling on entry to smp_send_stop()
> works.
Arm ARM, section I5.3.48 PMPCSR mentions "PMPCSR is in the Core power
domain". The challenge is ensuring that the target core remains powered
_throughout_ the access; checking its power state beforehand still
leaves a race.
For example, with CPUidle enabled, a CPU can be powered off any time so
it still race even move sampling in smp_send_stop().
This seems to be the main challenge. I'll check a bit if any guidance
for safely accessing PMPCSR.
> - Marvell has an out-of-tree patch, "coresight: cpu-debug: Add support
> to dump PMPCSR" (2023, carried in linux-yocto); I could not find it
> on the lists.
>
> Is PMPCSR support in coresight-cpu-debug planned or welcome? And how
> should such a PMU frame be described in DT: arm,coresight-cpu-debug or
> a new compatible?
Would it make sense to describe external PMU frames in the PMU node
and have cpu-debug reference its phandle? As Suzuki mentioned, this
can be reviewed on patch.
Thanks,
Leo
Hi Ian,
On Thu, Nov 12, 2026 at 11:07:55PM -0800, Ian Rogers wrote:
[...]
> Hi Leo,
>
> After commit 9648f9fc3525 ("perf cs-etm: Synthesize exception entries
> separately from branches") in perf-tools-next, perf's build-test
> (`make -C tools/perf O=/tmp/build CORESIGHT=1`, i.e. `make_with_coresight_O`)
> with GCC 15.2.0 (`gcc (Debian 15.2.0-14) 15.2.0`, `-O3`) fails with:
>
> In function ‘cs_etm__t32_instr_size’,
> inlined from ‘cs_etm__instr_size’ at util/cs-etm.c:1390:10,
> inlined from ‘cs_etm__copy_insn’ at util/cs-etm.c:1572:21:
> util/cs-etm.c:1381:28: error: ‘instrBytes’ may be used uninitialized
> [-Werror=maybe-uninitialized]
> 1381 | return ((instrBytes[1] & 0xF8) >= 0xE8) ? 4 : 2;
> | ~~~~~~~~~~^~~
> util/cs-etm.c: In function ‘cs_etm__copy_insn’:
> util/cs-etm.c:1372:12: note: ‘instrBytes’ declared here
> 1372 | u8 instrBytes[2];
> | ^~~~~~~~~~
>
> The uninitialized `instrBytes` in cs_etm__t32_instr_size() is actually
> pre-existing from commit a7ee4d625ede ("perf cs-etm: Support for ARM
> A32/T32 instruction sets in CoreSight trace"): cs_etm__frontend_mem_access()
> (via __cs_etm__mem_access()) can return 0 without writing to instrBytes
> when thread__find_map(), map__dso(), or dso__data_read_offset() fails.
> The changes around cs_etm__copy_insn() in this patch just shifted GCC's
> -O3 inlining enough for it to inline __cs_etm__mem_access() and spot the
> uninitialized read of instrBytes[1].
>
> Zero-initializing `u8 instrBytes[2] = {};` (similar to instr16/instr32 in
> cs_etm__is_svc_instr()) or checking that cs_etm__frontend_mem_access() read
> ARRAY_SIZE(instrBytes) bytes before inspecting instrBytes[1] should fix it.
See the series to fix the issue:
https://lore.kernel.org/linux-perf-users/20261113-perf_fix_gcc15_failure-v1…
Thanks for sharing the log and analysis.
This series fixes the GCC 15 build failure reported by Ian Rogers [1]
(thanks, Ian!).
Two follow-up refactoring patches use the packet’s recorded instruction
size for stack events and centralize error checking for frontend
instruction reads.
[1] https://lore.kernel.org/linux-perf-users/20261030-perf_cs_etm_fix_non_taken…
Signed-off-by: Leo Yan <leo.yan(a)arm.com>
---
Leo Yan (3):
perf cs-etm: Initialize the Thumb instruction buffer
perf cs-etm: Use the packet instruction size for stack events
perf cs-etm: Check frontend instruction reads
tools/perf/util/cs-etm.c | 83 +++++++++++++++++++++++++++++-------------------
1 file changed, 51 insertions(+), 32 deletions(-)
---
base-commit: 4af65363b11fc4fe65fcb497f68bbe4f3e3a4d2c
change-id: 20261113-perf_fix_gcc15_failure-1e31233be802
Best regards,
--
Leo Yan <leo.yan(a)arm.com>