The system on chip (SoC) consists of main APSS(Applications processor
subsytem) and additional processors like modem, lpass. There is
coresight-etm driver for etm trace of APSS. Coresight remote etm driver
is for enabling and disabling the etm trace of remote processors.
It uses QMI interface to communicate with remote processors' software
and uses coresight framework to configure the connection from remote
etm source to TMC sinks.
Example to capture the remote etm trace:
Enable source:
echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
echo 1 > /sys/bus/coresight/devices/remote_etm0/enable_source
Capture the trace:
cat /dev/tmc_etf0 > /data/remote_etm.bin
Disable source:
echo 0 > /sys/bus/coresight/devices/remote_etm0/enable_source
Change since V2:
1. Change qcom,inst-id to qcom,qmi-id
2. Fix the error in code for type of remote_etm_remove
3. Depend on QMI helper in Kconfig
Changes since V1:
1. Remove unused content
2. Use CORESIGHT_DEV_SUBTYPE_SOURCE_OTHERS as remote etm source type.
3. Use enabled instead of enable in driver data.
4. Validate instance id value where it's read from the DT.
Mao Jinlong (2):
dt-bindings: arm: Add qcom,qmi-id for remote etm
coresight: Add remote etm support
.../arm/qcom,coresight-remote-etm.yaml | 10 +
drivers/hwtracing/coresight/Kconfig | 13 +
drivers/hwtracing/coresight/Makefile | 1 +
drivers/hwtracing/coresight/coresight-qmi.h | 89 +++++
.../coresight/coresight-remote-etm.c | 307 ++++++++++++++++++
5 files changed, 420 insertions(+)
create mode 100644 drivers/hwtracing/coresight/coresight-qmi.h
create mode 100644 drivers/hwtracing/coresight/coresight-remote-etm.c
--
2.41.0
On Mon, 12 Aug 2024 12:30:43 +0800, Jie Gan wrote:
> The coresight_disable_source_sysfs function should verify the
> mode of the coresight device before disabling the source.
>
> However, the mode for the TPDM device is always set to
> CS_MODE_DISABLED, resulting in the check consistently failing.
> As a result, TPDM cannot be properly disabled.
>
> [...]
Applied, thanks!
[1/1] Coresight: Set correct cs_mode for TPDM to fix disable issue
https://git.kernel.org/coresight/c/14f5fa9b5fcbe2b3d5098893aba6ad62254d2ef6
Best regards,
--
Suzuki K Poulose <suzuki.poulose(a)arm.com>
On Mon, 12 Aug 2024 12:28:44 +0800, Jie Gan wrote:
> The coresight_disable_source_sysfs function should verify the
> mode of the coresight device before disabling the source.
> However, the mode for the dummy source device is always set to
> CS_MODE_DISABLED, resulting in the check consistently failing.
> As a result, dummy source cannot be properly disabled.
>
> Configure CS_MODE_SYSFS/CS_MODE_PERF during the enablement.
> Configure CS_MODE_DISABLED during the disablement.
>
> [...]
Applied, thanks!
[1/1] Coresight: Set correct cs_mode for dummy source to fix disable issue
https://git.kernel.org/coresight/c/e6b64cda393efd84709ab3df2e42d36d36d7553e
Best regards,
--
Suzuki K Poulose <suzuki.poulose(a)arm.com>
On Thu, 08 Aug 2024 17:12:36 +0200, Javier Carrasco wrote:
> This series removes accesses to the device `fwnode` to iterate over its
> own child nodes. Using the `device_for_each_child_node` macro provides
> direct access to the device child nodes, and given that in all cases
> they are only required within the loop, the scoped variant of the macro
> can be used.
>
> It has been stated in previous discussions [1] that `device_for_each_*`
> should be used to access device child nodes, removing the need to access
> its internal fwnode, and restricting `fwnode_for_each_*` to traversing
> subnodes when required.
>
> [...]
Applied, to coresight next tree. Thanks!
[1/3] coresight: cti: use device_* to iterate over device child nodes
https://git.kernel.org/coresight/c/daca644d0c9e0
Best regards,
--
Suzuki K Poulose <suzuki.poulose(a)arm.com>
A new branch of OpenCSD is now available:- ocsd-consistency-checks-1.5.4-rc1
This adds in a number of consistency tests to try to detect when
clients provide incorrect program images used for decode.
Correct decode is dependent on getting the correct program image to
walk looking for waypoints (branch instructions etc) to associate with
the E/N atoms in the trace.
Checks are enabled using operation flags in decoder creation:-
OCSD_C_API ocsd_err_t ocsd_dt_create_decoder(const dcd_tree_handle_t handle,
const char *decoder_name,
const int create_flags,
const void *decoder_cfg,
unsigned char *pCSID
);
Added flags for the create_flags parameter:
OCSD_OPFLG_N_UNCOND_DIR_BR_CHK
Check for N atom on unconditional direct branches - unconditional
branches should always have associated E atoms.
This option will generate an error and reset and resync the decoder if
the target of the direct branch is not the next instruction.
Some ETM IP will incorrectly trace taken branches to the next
instruction as not taken branches - so this allows for these cases
OCSD_OPFLG_STRICT_N_UNCOND_BR_CHK
Check for N atom on all unconditional branches.
This includes any direct and indirect unconditional branches. This
check may be used if it is known the ETM IP does not have the issue
mentioned above.
OCSD_OPFLG_CHK_RANGE_CONTINUE
Inconsistent range continuity on not taken branches.
If a range has been output the ends on a non taken branch, it is
expected that the next range will start at the end address of the
previous range.
If any of these checks fail then a OCSD_GEN_TRC_ELEM_NO_SYNC packet
with a reason of UNSYNC_BAD_IMAGE will be output.
Clients can choose which flags to use. By default all checks are off -
to minimise possible performance hit.
Regards
Mike
--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
On Thu, 8 Aug 2024 at 16:12, Javier Carrasco
<javier.carrasco.cruz(a)gmail.com> wrote:
>
> Drop the manual access to the fwnode of the device to iterate over its
> child nodes. `device_for_each_child_node` macro provides direct access
> to the child nodes, and given that they are only required within the
> loop, the scoped variant of the macro can be used.
>
> Use the `device_for_each_child_node_scoped` macro to iterate over the
> direct child nodes of the device.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
> ---
> drivers/hwtracing/coresight/coresight-cti-platform.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
> index ccef04f27f12..d0ae10bf6128 100644
> --- a/drivers/hwtracing/coresight/coresight-cti-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
> @@ -416,20 +416,16 @@ static int cti_plat_create_impdef_connections(struct device *dev,
> struct cti_drvdata *drvdata)
> {
> int rc = 0;
> - struct fwnode_handle *fwnode = dev_fwnode(dev);
> - struct fwnode_handle *child = NULL;
>
> - if (IS_ERR_OR_NULL(fwnode))
> + if (IS_ERR_OR_NULL(dev_fwnode(dev)))
> return -EINVAL;
>
> - fwnode_for_each_child_node(fwnode, child) {
> + device_for_each_child_node_scoped(dev, child) {
> if (cti_plat_node_name_eq(child, CTI_DT_CONNS))
> - rc = cti_plat_create_connection(dev, drvdata,
> - child);
> + rc = cti_plat_create_connection(dev, drvdata, child);
> if (rc != 0)
> break;
> }
> - fwnode_handle_put(child);
>
> return rc;
> }
>
> --
> 2.43.0
>
Reviewed-by: Mike Leach <mike.leach(a)linaro.org>
--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
The system on chip (SoC) consists of main APSS(Applications processor
subsytem) and additional processors like modem, lpass. There is
coresight-etm driver for etm trace of APSS. Coresight remote etm driver
is for enabling and disabling the etm trace of remote processors.
It uses QMI interface to communicate with remote processors' software
and uses coresight framework to configure the connection from remote
etm source to TMC sinks.
Example to capture the remote etm trace:
Enable source:
echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
echo 1 > /sys/bus/coresight/devices/remote_etm0/enable_source
Capture the trace:
cat /dev/tmc_etf0 > /data/remote_etm.bin
Disable source:
echo 0 > /sys/bus/coresight/devices/remote_etm0/enable_source
Changes since V1:
1. Remove unused content
2. Use CORESIGHT_DEV_SUBTYPE_SOURCE_OTHERS as remote etm source type.
3. Use enabled instead of enable in driver data.
4. Validate instance id value where it's read from the DT.
Mao Jinlong (2):
dt-bindings: arm: Add qcom,inst-id for remote etm
coresight: Add remote etm support
.../arm/qcom,coresight-remote-etm.yaml | 10 +
drivers/hwtracing/coresight/Kconfig | 13 +
drivers/hwtracing/coresight/Makefile | 1 +
drivers/hwtracing/coresight/coresight-qmi.h | 89 +++++
.../coresight/coresight-remote-etm.c | 308 ++++++++++++++++++
5 files changed, 421 insertions(+)
create mode 100644 drivers/hwtracing/coresight/coresight-qmi.h
create mode 100644 drivers/hwtracing/coresight/coresight-remote-etm.c
--
2.41.0
In our hardware design, by combining a funnel and a replicator, it
implement a hardware device with one-to-one correspondence between
output ports and input ports. The programming usage on this device
is the same as funnel. The software uses a funnel and a static
replicator to implement the driver of this device. Since original
funnels only support a single output connection and original
replicator only support a single input connection, the code needs
to be modified to support this new feature. The following is a
typical topology diagram of multi-port output mechanism.
|----------| |---------| |----------| |---------|
| TPDM 0 | | Source0 | | Source 1 | | TPDM 1 |
|----------| |---------| |----------| |---------|
| | | |
| | | |
| --------- | | |
| | | |
| | | |
| | | |
\-------------/ ---------------------- |
\ Funnel 0 / | |
----------- | ------------------------------
| | |
| | |
\------------------/
\ Funnel 1 / ----|
\--------------/ |
| |----> Combine a funnel and a
| | static replicator
/-----------------\ |
/ replicator 0 \ ----|
/---------------------\
| | |
| | |-----------|
| |---------| |
| |TPDM0 |TPDM1
| \-----------------/
| \ TPDA 0 /
| \-------------/
| |
| |
|Source0/1 |
\-------------------------------/
\ Funnel 2 /
\---------------------------/
Changes in V2:
1. Change the reference for endpoint property in dt-binding.
-- Krzysztof Kozlowski
2. Change the property name "filter_src" to "filter-src".
-- Krzysztof Kozlowski
3. Fix the errors in running 'make dt_binding_check'.
-- Rob Herring
4. Pass in the source parameter instead of path.
-- Suzuki K Poulose
5. Reset the "filter_src_dev" if the "src" csdev is being removed.
-- Suzuki K Poulose
6. Add a warning if the "filter_src_dev" is of not the
type DEV_TYPE_SOURCE.
-- Suzuki K Poulose
7. Optimize the procedure for handling all possible cases.
-- Suzuki K Poulose
Changes in V1:
1. Add a static replicator connect to a funnel to implement the
correspondence between the output ports and the input ports on
funnels.
-- Suzuki K Poulose
2. Add filter_src_dev and filter_src_dev phandle to
"coresight_connection" struct, and populate them if there is one.
-- Suzuki K Poulose
3. To look at the phandle and then fixup/remove the filter_src
device in fixup/remove connections.
-- Suzuki K Poulose
4. When TPDA reads DSB/CMB element size, it is implemented by
looking up filter src device in the connections.
-- Suzuki K Poulose
Tao Zhang (3):
dt-bindings: arm: qcom,coresight-static-replicator: Add property for
source filtering
coresight: Add source filtering for multi-port output
coresight-tpda: Optimize the function of reading element size
.../arm/arm,coresight-static-replicator.yaml | 19 ++-
drivers/hwtracing/coresight/coresight-core.c | 125 ++++++++++++++++--
.../hwtracing/coresight/coresight-platform.c | 18 +++
drivers/hwtracing/coresight/coresight-tpda.c | 3 +-
include/linux/coresight.h | 5 +
5 files changed, 155 insertions(+), 15 deletions(-)
--
2.17.1
On 08/08/2024 1:58 pm, Adrian Hunter wrote:
> On 6/08/24 23:41, Leo Yan wrote:
>> The auxtrace__evsel_is_auxtrace() function invokes the callback
>> .evsel_is_auxtrace() to check if an event is an AUX trace. In the
>> low-level code, every AUX trace module provides its callback to
>> compare the PMU type.
>>
>> This commit refactors auxtrace__evsel_is_auxtrace() by simply
>> calling evsel__is_aux_event() rather than using the callback function.
>> As a result, the callback .evsel_is_auxtrace() is no longer needed, so
>> the definition and implementations are removed.
>
> evsel__is_aux_event() assumes it is on the target machine e.g.
> being called from perf record. It indirectly reads from sysfs
> to find PMUs, which will not necessarily be the same a different
> machine.
>
> For example, what happens if a perf data file from one arch is
> being processed on a machine from another arch.
>
I think this does go a bit wrong. If I open an SPE file on x86 it finds
the intel_pt PMU which both have the same type number. But because
that's also an auxtrace one it appears to work.