Skip to content

Commit 5d1a5c4

Browse files
committed
Merge tag 'coresight-next-v6.15' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next
Suzuki writes: coresight: updates for Linux v6.15 CoreSight self-hosted tracing driver subsystem update for Linux v6.15. The update includes: - CoreSight trace capture for Panic/Watchdog timeouts - Fixes to ETM4x driver to synchronize register reads as required by the TRM - Support for Qualcomm CoreSight TMC Control Unit driver - Conversion of device locks to raw_spinlock for components that are used by the Perf mode. - Miscellaneous fixes for the subsystem Signed-off-by: Suzuki K Poulose <[email protected]> * tag 'coresight-next-v6.15' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/coresight/linux: (41 commits) Coresight: Fix a NULL vs IS_ERR() bug in probe coresight: configfs: Constify struct config_item_type coresight: docs: Remove target sink from examples coresight/ultrasoc: change smb_drv_data spinlock's type to raw_spinlock_t coresight-tmc: change tmc_drvdata spinlock's type to raw_spinlock_t coresight-replicator: change replicator_drvdata spinlock's type to raw_spinlock_t coresight-funnel: change funnel_drvdata spinlock's type to raw_spinlock_t coresight-etb10: change etb_drvdata spinlock's type to raw_spinlock_t coresight-cti: change cti_drvdata spinlock's type to raw_spinlock_t coresight: change coresight_trace_id_map's lock type to raw_spinlock_t coresight-etm4x: change etmv4_drvdata spinlock type to raw_spinlock_t coresight: change coresight_device lock type to raw_spinlock_t coresight: add verification process for coresight_etm_get_trace_id Coresight: Add Coresight TMC Control Unit driver dt-bindings: arm: Add Coresight TMC Control Unit hardware Coresight: Change functions to accept the coresight_path Coresight: Change to read the trace ID from coresight_path Coresight: Allocate trace ID after building the path Coresight: Introduce a new struct coresight_path Coresight: Use coresight_etm_get_trace_id() in traceid_show() ...
2 parents a24b18a + 5442d22 commit 5d1a5c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2452
-553
lines changed

Documentation/ABI/testing/sysfs-bus-coresight-devices-tpdm

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,18 @@ Contact: Jinlong Mao (QUIC) <[email protected]>, Tao Zhang (QUIC) <quic_t
257257
Description:
258258
(RW) Set/Get the MSR(mux select register) for the CMB subunit
259259
TPDM.
260+
261+
What: /sys/bus/coresight/devices/<tpdm-name>/mcmb_trig_lane
262+
Date: Feb 2025
263+
KernelVersion 6.15
264+
Contact: Jinlong Mao (QUIC) <[email protected]>, Tao Zhang (QUIC) <[email protected]>
265+
Description:
266+
(RW) Set/Get which lane participates in the output pattern
267+
match cross trigger mechanism for the MCMB subunit TPDM.
268+
269+
What: /sys/bus/coresight/devices/<tpdm-name>/mcmb_lanes_select
270+
Date: Feb 2025
271+
KernelVersion 6.15
272+
Contact: Jinlong Mao (QUIC) <[email protected]>, Tao Zhang (QUIC) <[email protected]>
273+
Description:
274+
(RW) Set/Get the enablement of the individual lane.

Documentation/devicetree/bindings/arm/arm,coresight-tmc.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,29 @@ properties:
101101
and ETF configurations.
102102
$ref: /schemas/graph.yaml#/properties/port
103103

104+
memory-region:
105+
items:
106+
- description: Reserved trace buffer memory for ETR and ETF sinks.
107+
For ETR, this reserved memory region is used for trace data capture.
108+
Same region is used for trace data retention as well after a panic
109+
or watchdog reset.
110+
This reserved memory region is used as trace buffer or used for trace
111+
data retention only if specifically selected by the user in sysfs
112+
interface.
113+
The default memory usage models for ETR in sysfs/perf modes are
114+
otherwise unaltered.
115+
116+
For ETF, this reserved memory region is used by default for
117+
retention of trace data synced from internal SRAM after a panic
118+
or watchdog reset.
119+
- description: Reserved meta data memory. Used for ETR and ETF sinks
120+
for storing metadata.
121+
122+
memory-region-names:
123+
items:
124+
- const: tracedata
125+
- const: metadata
126+
104127
required:
105128
- compatible
106129
- reg
@@ -115,6 +138,9 @@ examples:
115138
etr@20070000 {
116139
compatible = "arm,coresight-tmc", "arm,primecell";
117140
reg = <0x20070000 0x1000>;
141+
memory-region = <&etr_trace_mem_reserved>,
142+
<&etr_mdata_mem_reserved>;
143+
memory-region-names = "tracedata", "metadata";
118144
119145
clocks = <&oscclk6a>;
120146
clock-names = "apb_pclk";
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/arm/qcom,coresight-ctcu.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: CoreSight TMC Control Unit
8+
9+
maintainers:
10+
- Yuanfang Zhang <[email protected]>
11+
- Mao Jinlong <[email protected]>
12+
- Jie Gan <[email protected]>
13+
14+
description: |
15+
The Trace Memory Controller(TMC) is used for Embedded Trace Buffer(ETB),
16+
Embedded Trace FIFO(ETF) and Embedded Trace Router(ETR) configurations.
17+
The configuration mode (ETB, ETF, ETR) is discovered at boot time when
18+
the device is probed.
19+
20+
The Coresight TMC Control unit controls various Coresight behaviors.
21+
It works as a helper device when connected to TMC ETR device.
22+
It is responsible for controlling the data filter function based on
23+
the source device's Trace ID for TMC ETR device. The trace data with
24+
that Trace id can get into ETR's buffer while other trace data gets
25+
ignored.
26+
27+
properties:
28+
compatible:
29+
enum:
30+
- qcom,sa8775p-ctcu
31+
32+
reg:
33+
maxItems: 1
34+
35+
clocks:
36+
maxItems: 1
37+
38+
clock-names:
39+
items:
40+
- const: apb
41+
42+
in-ports:
43+
$ref: /schemas/graph.yaml#/properties/ports
44+
45+
patternProperties:
46+
'^port(@[0-1])?$':
47+
description: Input connections from CoreSight Trace bus
48+
$ref: /schemas/graph.yaml#/properties/port
49+
50+
required:
51+
- compatible
52+
- reg
53+
- in-ports
54+
55+
additionalProperties: false
56+
57+
examples:
58+
- |
59+
ctcu@1001000 {
60+
compatible = "qcom,sa8775p-ctcu";
61+
reg = <0x1001000 0x1000>;
62+
63+
clocks = <&aoss_qmp>;
64+
clock-names = "apb";
65+
66+
in-ports {
67+
#address-cells = <1>;
68+
#size-cells = <0>;
69+
70+
port@0 {
71+
reg = <0>;
72+
ctcu_in_port0: endpoint {
73+
remote-endpoint = <&etr0_out_port>;
74+
};
75+
};
76+
77+
port@1 {
78+
reg = <1>;
79+
ctcu_in_port1: endpoint {
80+
remote-endpoint = <&etr1_out_port>;
81+
};
82+
};
83+
};
84+
};

Documentation/devicetree/bindings/arm/qcom,coresight-tpda.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ properties:
5555
- const: arm,primecell
5656

5757
reg:
58-
minItems: 1
59-
maxItems: 2
58+
maxItems: 1
6059

6160
clocks:
6261
maxItems: 1

Documentation/devicetree/bindings/arm/qcom,coresight-tpdm.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ properties:
4141
- const: arm,primecell
4242

4343
reg:
44-
minItems: 1
45-
maxItems: 2
44+
maxItems: 1
4645

4746
qcom,dsb-element-bits:
4847
description:

Documentation/trace/coresight/coresight.rst

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -462,44 +462,35 @@ queried by the perf command line tool:
462462

463463
cs_etm// [Kernel PMU event]
464464

465-
linaro@linaro-nano:~$
466-
467465
Regardless of the number of tracers available in a system (usually equal to the
468466
amount of processor cores), the "cs_etm" PMU will be listed only once.
469467

470468
A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
471-
listed along with configuration options within forward slashes '/'. Since a
472-
Coresight system will typically have more than one sink, the name of the sink to
473-
work with needs to be specified as an event option.
474-
On newer kernels the available sinks are listed in sysFS under
469+
provided along with configuration options within forward slashes '/' (see
470+
`Config option formats`_).
471+
472+
Advanced Perf framework usage
473+
-----------------------------
474+
475+
Sink selection
476+
~~~~~~~~~~~~~~
477+
478+
An appropriate sink will be selected automatically for use with Perf, but since
479+
there will typically be more than one sink, the name of the sink to use may be
480+
specified as a special config option prefixed with '@'.
481+
482+
The available sinks are listed in sysFS under
475483
($SYSFS)/bus/event_source/devices/cs_etm/sinks/::
476484

477485
root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
478486
tmc_etf0 tmc_etr0 tpiu0
479487

480-
On older kernels, this may need to be found from the list of coresight devices,
481-
available under ($SYSFS)/bus/coresight/devices/::
482-
483-
root:~# ls /sys/bus/coresight/devices/
484-
etm0 etm1 etm2 etm3 etm4 etm5 funnel0
485-
funnel1 funnel2 replicator0 stm0 tmc_etf0 tmc_etr0 tpiu0
486488
root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
487489

488-
As mentioned above in section "Device Naming scheme", the names of the devices could
489-
look different from what is used in the example above. One must use the device names
490-
as it appears under the sysFS.
491-
492-
The syntax within the forward slashes '/' is important. The '@' character
493-
tells the parser that a sink is about to be specified and that this is the sink
494-
to use for the trace session.
495-
496490
More information on the above and other example on how to use Coresight with
497491
the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub
498492
repository [#third]_.
499493

500-
Advanced perf framework usage
501-
-----------------------------
502-
503494
AutoFDO analysis using the perf tools
504495
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
505496

@@ -508,7 +499,7 @@ perf can be used to record and analyze trace of programs.
508499
Execution can be recorded using 'perf record' with the cs_etm event,
509500
specifying the name of the sink to record to, e.g::
510501

511-
perf record -e cs_etm/@tmc_etr0/u --per-thread
502+
perf record -e cs_etm//u --per-thread
512503

513504
The 'perf report' and 'perf script' commands can be used to analyze execution,
514505
synthesizing instruction and branch events from the instruction trace.
@@ -572,7 +563,7 @@ sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tuto
572563
Bubble sorting array of 30000 elements
573564
5910 ms
574565

575-
$ perf record -e cs_etm/@tmc_etr0/u --per-thread taskset -c 2 ./sort
566+
$ perf record -e cs_etm//u --per-thread taskset -c 2 ./sort
576567
Bubble sorting array of 30000 elements
577568
12543 ms
578569
[ perf record: Woken up 35 times to write data ]

0 commit comments

Comments
 (0)