<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/include/linux/coresight.h, branch v6.14-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>coresight: Add support for trace filtering by source</title>
<updated>2024-12-13T10:25:15+00:00</updated>
<author>
<name>Tao Zhang</name>
<email>quic_taozha@quicinc.com</email>
</author>
<published>2024-12-13T10:07:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ec9903d6cc34e61b77e609a0425e7a0a804fb95a'/>
<id>ec9903d6cc34e61b77e609a0425e7a0a804fb95a</id>
<content type='text'>
Some replicators have hard coded filtering of "trace" data, based on the
source device. This is different from the trace filtering based on
TraceID, available in the standard programmable replicators. e.g.,
Qualcomm replicators have filtering based on custom trace protocol
format and is not programmable.

The source device could be connected to the replicator via intermediate
components (e.g., a funnel). Thus we need platform information from
the firmware tables to decide the source device corresponding to a
given output port from the replicator. Given this affects "trace
path building" and traversing the path back from the sink to source,
add the concept of "filtering by source" to the generic coresight
connection.

The specified source will be marked like below in the Devicetree.
test-replicator {
    ... ... ... ...
    out-ports {
        ... ... ... ...
        port@0 {
            reg = &lt;0&gt;;
            xyz: endpoint {
                remote-endpoint = &lt;&amp;zyx&gt;;
                filter-source = &lt;&amp;source_1&gt;; &lt;-- To specify the source to
            };                           be filtered out here.
        };

        port@1 {
            reg = &lt;1&gt;;
            abc: endpoint {
                remote-endpoint = &lt;&amp;cba&gt;;
                filter-source = &lt;&amp;source_2&gt;; &lt;-- To specify the source to
            };                           be filtered out here.
        };
    };
};

Signed-off-by: Tao Zhang &lt;quic_taozha@quicinc.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241213100731.25914-4-quic_taozha@quicinc.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some replicators have hard coded filtering of "trace" data, based on the
source device. This is different from the trace filtering based on
TraceID, available in the standard programmable replicators. e.g.,
Qualcomm replicators have filtering based on custom trace protocol
format and is not programmable.

The source device could be connected to the replicator via intermediate
components (e.g., a funnel). Thus we need platform information from
the firmware tables to decide the source device corresponding to a
given output port from the replicator. Given this affects "trace
path building" and traversing the path back from the sink to source,
add the concept of "filtering by source" to the generic coresight
connection.

The specified source will be marked like below in the Devicetree.
test-replicator {
    ... ... ... ...
    out-ports {
        ... ... ... ...
        port@0 {
            reg = &lt;0&gt;;
            xyz: endpoint {
                remote-endpoint = &lt;&amp;zyx&gt;;
                filter-source = &lt;&amp;source_1&gt;; &lt;-- To specify the source to
            };                           be filtered out here.
        };

        port@1 {
            reg = &lt;1&gt;;
            abc: endpoint {
                remote-endpoint = &lt;&amp;cba&gt;;
                filter-source = &lt;&amp;source_2&gt;; &lt;-- To specify the source to
            };                           be filtered out here.
        };
    };
};

Signed-off-by: Tao Zhang &lt;quic_taozha@quicinc.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241213100731.25914-4-quic_taozha@quicinc.com
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Add a helper to check if a device is source</title>
<updated>2024-12-13T10:25:14+00:00</updated>
<author>
<name>Tao Zhang</name>
<email>quic_taozha@quicinc.com</email>
</author>
<published>2024-12-13T10:07:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=62374ce1876be26b3f33575680e67ca69a59db54'/>
<id>62374ce1876be26b3f33575680e67ca69a59db54</id>
<content type='text'>
Since there are a lot of places in the code to check whether the
device is source, add a helper to check it.

Signed-off-by: Tao Zhang &lt;quic_taozha@quicinc.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241213100731.25914-3-quic_taozha@quicinc.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since there are a lot of places in the code to check whether the
device is source, add a helper to check it.

Signed-off-by: Tao Zhang &lt;quic_taozha@quicinc.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241213100731.25914-3-quic_taozha@quicinc.com
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Add support to get static id for system trace sources</title>
<updated>2024-12-11T10:15:37+00:00</updated>
<author>
<name>Mao Jinlong</name>
<email>quic_jinlmao@quicinc.com</email>
</author>
<published>2024-11-21T06:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fd9b7e8e9fbc23d69fa4accc881dea2cf13a2e2e'/>
<id>fd9b7e8e9fbc23d69fa4accc881dea2cf13a2e2e</id>
<content type='text'>
Dynamic trace id was introduced in coresight subsystem, so trace id is
allocated dynamically. However, some hardware ATB source has static trace
id and it cannot be changed via software programming. For such source,
it can call coresight_get_static_trace_id to get the fixed trace id from
device node and pass id to coresight_trace_id_get_static_system_id to
reserve the id.

Signed-off-by: Mao Jinlong &lt;quic_jinlmao@quicinc.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241121062829.11571-3-quic_jinlmao@quicinc.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dynamic trace id was introduced in coresight subsystem, so trace id is
allocated dynamically. However, some hardware ATB source has static trace
id and it cannot be changed via software programming. For such source,
it can call coresight_get_static_trace_id to get the fixed trace id from
device node and pass id to coresight_trace_id_get_static_system_id to
reserve the id.

Signed-off-by: Mao Jinlong &lt;quic_jinlmao@quicinc.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241121062829.11571-3-quic_jinlmao@quicinc.com
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Drop atomics in connection refcounts</title>
<updated>2024-12-11T10:15:25+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@linaro.org</email>
</author>
<published>2024-11-28T12:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5aec7c065fba0c56d6c1ea5d629395210f174be8'/>
<id>5aec7c065fba0c56d6c1ea5d629395210f174be8</id>
<content type='text'>
These belong to the device being enabled or disabled and are only ever
used inside the device's spinlock. Remove the atomics to not imply that
there are any other concurrent accesses.

If atomics were necessary I don't think they would have been enough
anyway. There would be nothing to prevent an enable or disable running
concurrently if not for the spinlock.

Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Reviewed-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241128121414.2425119-1-james.clark@linaro.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These belong to the device being enabled or disabled and are only ever
used inside the device's spinlock. Remove the atomics to not imply that
there are any other concurrent accesses.

If atomics were necessary I don't think they would have been enough
anyway. There would be nothing to prevent an enable or disable running
concurrently if not for the spinlock.

Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Reviewed-by: Yeoreum Yun &lt;yeoreum.yun@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20241128121414.2425119-1-james.clark@linaro.org
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Make trace ID map spinlock local to the map</title>
<updated>2024-08-20T14:02:38+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2024-07-22T10:11:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=988d40a4d4e7d671305bea501562a5d1a1d479fa'/>
<id>988d40a4d4e7d671305bea501562a5d1a1d479fa</id>
<content type='text'>
Reduce contention on the lock by replacing the global lock with one for
each map.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-18-james.clark@linaro.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reduce contention on the lock by replacing the global lock with one for
each map.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-18-james.clark@linaro.org
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Remove pending trace ID release mechanism</title>
<updated>2024-08-20T14:02:38+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2024-07-22T10:11:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=de0029fdde86092c75472c92e56a962f4edee0f6'/>
<id>de0029fdde86092c75472c92e56a962f4edee0f6</id>
<content type='text'>
Pending the release of IDs was a way of managing concurrent sysfs and
Perf sessions in a single global ID map. Perf may have finished while
sysfs hadn't, and Perf shouldn't release the IDs in use by sysfs and
vice versa.

Now that Perf uses its own exclusive ID maps, pending release doesn't
result in any different behavior than just releasing all IDs when the
last Perf session finishes. As part of the per-sink trace ID change, we
would have still had to make the pending mechanism work on a per-sink
basis, due to the overlapping ID allocations, so instead of making that
more complicated, just remove it.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-16-james.clark@linaro.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pending the release of IDs was a way of managing concurrent sysfs and
Perf sessions in a single global ID map. Perf may have finished while
sysfs hadn't, and Perf shouldn't release the IDs in use by sysfs and
vice versa.

Now that Perf uses its own exclusive ID maps, pending release doesn't
result in any different behavior than just releasing all IDs when the
last Perf session finishes. As part of the per-sink trace ID change, we
would have still had to make the pending mechanism work on a per-sink
basis, due to the overlapping ID allocations, so instead of making that
more complicated, just remove it.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-16-james.clark@linaro.org
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Use per-sink trace ID maps for Perf sessions</title>
<updated>2024-08-20T14:02:38+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2024-07-22T10:11:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5ad628a7617607baac53745f8025638b967470a2'/>
<id>5ad628a7617607baac53745f8025638b967470a2</id>
<content type='text'>
This will allow sessions with more than CORESIGHT_TRACE_IDS_MAX ETMs
as long as there are fewer than that many ETMs connected to each sink.

Each sink owns its own trace ID map, and any Perf session connecting to
that sink will allocate from it, even if the sink is currently in use by
other users. This is similar to the existing behavior where the dynamic
trace IDs are constant as long as there is any concurrent Perf session
active. It's not completely optimal because slightly more IDs will be
used than necessary, but the optimal solution involves tracking the PIDs
of each session and allocating ID maps based on the session owner. This
is difficult to do with the combination of per-thread and per-cpu modes
and some scheduling issues. The complexity of this isn't likely to worth
it because even with multiple users they'd just see a difference in the
ordering of ID allocations rather than hitting any limits (unless the
hardware does have too many ETMs connected to one sink).

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-15-james.clark@linaro.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will allow sessions with more than CORESIGHT_TRACE_IDS_MAX ETMs
as long as there are fewer than that many ETMs connected to each sink.

Each sink owns its own trace ID map, and any Perf session connecting to
that sink will allocate from it, even if the sink is currently in use by
other users. This is similar to the existing behavior where the dynamic
trace IDs are constant as long as there is any concurrent Perf session
active. It's not completely optimal because slightly more IDs will be
used than necessary, but the optimal solution involves tracking the PIDs
of each session and allocating ID maps based on the session owner. This
is difficult to do with the combination of per-thread and per-cpu modes
and some scheduling issues. The complexity of this isn't likely to worth
it because even with multiple users they'd just see a difference in the
ordering of ID allocations rather than hitting any limits (unless the
hardware does have too many ETMs connected to one sink).

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-15-james.clark@linaro.org
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Make CPU id map a property of a trace ID map</title>
<updated>2024-08-20T14:02:38+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2024-07-22T10:11:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d53c8253c7822fbc524adcd950e7c6de6a229c99'/>
<id>d53c8253c7822fbc524adcd950e7c6de6a229c99</id>
<content type='text'>
The global CPU ID mappings won't work for per-sink ID maps so move it to
the ID map struct. coresight_trace_id_release_all_pending() is hard
coded to operate on the default map, but once Perf sessions use their
own maps the pending release mechanism will be deleted. So it doesn't
need to be extended to accept a trace ID map argument at this point.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Tested-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-14-james.clark@linaro.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The global CPU ID mappings won't work for per-sink ID maps so move it to
the ID map struct. coresight_trace_id_release_all_pending() is hard
coded to operate on the default map, but once Perf sessions use their
own maps the pending release mechanism will be deleted. So it doesn't
need to be extended to accept a trace ID map argument at this point.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Tested-by: Leo Yan &lt;leo.yan@arm.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-14-james.clark@linaro.org
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Move struct coresight_trace_id_map to common header</title>
<updated>2024-08-20T14:02:37+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2024-07-22T10:11:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=acb0184fe9bca3bb7103dadc76ba9d38c969ca86'/>
<id>acb0184fe9bca3bb7103dadc76ba9d38c969ca86</id>
<content type='text'>
The trace ID maps will need to be created and stored by the core and
Perf code so move the definition up to the common header.

Reviewed-by: Anshuman Khandual &lt;anshuman.khandual@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Tested-by: Leo Yan &lt;leo.yan@arm.com&gt;
Tested-by: Ganapatrao Kulkarni &lt;gankulkarni@os.amperecomputing.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-12-james.clark@linaro.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The trace ID maps will need to be created and stored by the core and
Perf code so move the definition up to the common header.

Reviewed-by: Anshuman Khandual &lt;anshuman.khandual@arm.com&gt;
Reviewed-by: Mike Leach &lt;mike.leach@linaro.org&gt;
Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Tested-by: Leo Yan &lt;leo.yan@arm.com&gt;
Tested-by: Ganapatrao Kulkarni &lt;gankulkarni@os.amperecomputing.com&gt;
Signed-off-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240722101202.26915-12-james.clark@linaro.org
</pre>
</div>
</content>
</entry>
<entry>
<title>coresight: Remove duplicate linux/amba/bus.h header</title>
<updated>2024-04-24T13:22:41+00:00</updated>
<author>
<name>Jiapeng Chong</name>
<email>jiapeng.chong@linux.alibaba.com</email>
</author>
<published>2024-04-24T02:24:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e8293395b9caa57e38cc05b9102d4ec7835b0a0f'/>
<id>e8293395b9caa57e38cc05b9102d4ec7835b0a0f</id>
<content type='text'>
./include/linux/coresight.h: linux/amba/bus.h is included more than once.

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8869
Signed-off-by: Jiapeng Chong &lt;jiapeng.chong@linux.alibaba.com&gt;
Reviewed-by: James Clark &lt;james.clark@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240424022420.58516-1-jiapeng.chong@linux.alibaba.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
./include/linux/coresight.h: linux/amba/bus.h is included more than once.

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8869
Signed-off-by: Jiapeng Chong &lt;jiapeng.chong@linux.alibaba.com&gt;
Reviewed-by: James Clark &lt;james.clark@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Link: https://lore.kernel.org/r/20240424022420.58516-1-jiapeng.chong@linux.alibaba.com
</pre>
</div>
</content>
</entry>
</feed>
