The connections between CoreSight sources, links and sinks is not obvious
without documentation or access to the device tree / ACPI definitions for
the platform.
This patchset provides sysfs links to enable the user to follow the trace
patch from source to sink.
Components in the trace path are updated to have a connections sysfs
group, which collates all the links for that component.
The CTI components which exist aside from the main trace patch, also
have an added connections directory showing connections to other
CoreSight devices.
This patchset applies on top of the recent CTI patchset [1].
Adaptation of an original patchset [2] from Suzuki, reusing 2 patches
unchanged with update to 3rd adapt to the new common code for trace
path and CTI component links & add a default connections group.
Tested on Juno r1, DB410c; kernel 5.5-rc1
[1] https://lists.linaro.org/pipermail/coresight/2019-December/003504.html
[2] https://lists.linaro.org/pipermail/coresight/2019-May/002803.html
Changes since v2:
1) Fixed issues with signature ordering noted by Suzuki.
2) Alterations to main CTI set[1] to overcome issue noted by Matthieu.
Changes since v1:
1) Code from original v4 CTI set moved here so that all connections related
code in this set.
2) Connections directory mandatory for all CoreSight components and
generated as part of the registration process.
Mike Leach (3):
coresight: Add generic sysfs link creation functions.
coresight: cti: Add in sysfs links to other coresight devices.
coresight: docs: Add information about the topology representations.
Suzuki K Poulose (3):
coresight: Pass coresight_device for coresight_release_platform_data
coresight: add return value for fixup connections
coresight: Expose device connections via sysfs
.../trace/coresight/coresight-ect.rst | 5 +-
Documentation/trace/coresight/coresight.rst | 85 ++++++++
drivers/hwtracing/coresight/Makefile | 3 +-
drivers/hwtracing/coresight/coresight-cti.c | 41 +++-
.../hwtracing/coresight/coresight-platform.c | 2 +-
drivers/hwtracing/coresight/coresight-priv.h | 12 +-
drivers/hwtracing/coresight/coresight-sysfs.c | 204 ++++++++++++++++++
drivers/hwtracing/coresight/coresight.c | 75 ++++---
include/linux/coresight.h | 22 ++
9 files changed, 420 insertions(+), 29 deletions(-)
create mode 100644 drivers/hwtracing/coresight/coresight-sysfs.c
--
2.17.1
On Wed, 11 Dec 2019 at 18:01, Joey Jiao <notifications(a)github.com> wrote:
> Another point is I cannot see any sink here:
> ls -l /sys/bus/event_source/devices
Please stop using different fonts in your email - it is very hard to read.
Here is the output I get on my reference platform:
root@linaro-developer:/sys/bus/event_source/devices/cs_etm# ls
cpu0 cpu3 format power type
cpu1 cpu4 nr_addr_filters sinks uevent
cpu2 cpu5 perf_event_mux_interval_ms subsystem
You should have a "sinks" directory in there where all the sinks are
listed. If you don't the kernel you are using is either too old, the DTB
isn't describing sinks correctly, the extra set of patches that were added
on top of (whatever) tree you are using is incomplete or a mix of those.
I suggest you purchase a dragonboard 410c and see how coresight works on a
mainline kernel on that platform. From there you'll be able to
troubleshoot your way backward on your current platform. Last but not
least and to repeat my advice from a previous email, please spend time to
really understand the documentation available on a v5.4 kernel - it will
make your life (and mine) a lot easier. If there is something in there
that is not clear or needs more details, send us a patch and it will be our
pleasure to consider it.
/cs_etm/ total 0
> lrwxrwxrwx. 1 root root 0 Dec 8 13:00 cpu0 ->
> ../platform/soc/7040000.etm/coresight-etm0 lrwxrwxrwx. 1 root root 0 Dec 8
> 13:00 cpu1 -> ../platform/soc/7140000.etm/coresight-etm1 lrwxrwxrwx. 1 root
> root 0 Dec 8 13:00 cpu2 -> ../platform/soc/7240000.etm/coresight-etm2
> lrwxrwxrwx. 1 root root 0 Dec 8 13:00 cpu3 ->
> ../platform/soc/7340000.etm/coresight-etm3
> lrwxrwxrwx. 1 root root 0 Dec 8 13:00 cpu4 ->
> ../platform/soc/7440000.etm/coresight-etm4
> lrwxrwxrwx. 1 root root 0 Dec 8 13:00 cpu5 ->
> ../platform/soc/7540000.etm/coresight-etm5 lrwxrwxrwx. 1 root root 0 Dec 8
> 13:00 cpu6 -> ../platform/soc/7640000.etm/coresight-etm6
> lrwxrwxrwx. 1 root root 0 Dec 8 13:00 cpu7 ->
> ../platform/soc/7740000.etm/coresight-etm7
> drwxr-xr-x. 2 root root 0 Dec 8 12:58 format
> -r--r--r--. 1 root root 4096 Dec 8 12:58 nr_addr_filters -rw-r--r--. 1
> root root 4096 Dec 8 13:00 perf_event_mux_interval_ms
> drwxr-xr-x. 2 root root 0 Dec 8 13:00 power lrwxrwxrwx. 1 root root 0 Dec
> 8 13:00 subsystem -> ../../bus/event_source -r--r--r--. 1 root root 4096
> Dec 8 12:58 type
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/Linaro/perf-opencsd/issues/3?email_source=notifications&…>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAELPWYRU3JEY4MAU5YOUELQY…>
> .
>
As I asked in a previous reply to you, please CC the coresight mailing list
when looking for support. Future requests for help without the coresight
mailing list will not be answered.
On Wed, 11 Dec 2019 at 17:59, Joey Jiao <notifications(a)github.com> wrote:
> I'm building from https://github.com/Linaro/perf-opencsd/commits/master
> on target
>
Why use such an old branch? And yesterday you said you were using a 4.19
kernel... And your listing indicated you have the generic naming
convention patches while this tree doesn't have them? Moreover you haven't
answered my questions to yesterday's email.
> /data/workspace/perf-opencsd# ./tools/perf/perf record -e
> cs_etm/(a)t048000.tmc/u --per-thread ls failed to set config "t048000.tmc" on
> event cs_etm/(a)t048000.tmc/u with 2 (No such file or directory)
>
> What should I replace the @t048000.tmc for?
>
—
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/Linaro/perf-opencsd/issues/3?email_source=notifications&…>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAELPWYZFHF3HVDAHLITW53QY…>
> .
>
Add API usage document for sysfs API in CTI driver.
Signed-off-by: Mike Leach <mike.leach(a)linaro.org>
---
.../testing/sysfs-bus-coresight-devices-cti | 221 ++++++++++++++++++
1 file changed, 221 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-cti
diff --git a/Documentation/ABI/testing/sysfs-bus-coresight-devices-cti b/Documentation/ABI/testing/sysfs-bus-coresight-devices-cti
new file mode 100644
index 000000000000..5ed54d196a17
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-coresight-devices-cti
@@ -0,0 +1,221 @@
+What: /sys/bus/coresight/devices/<cti-name>/enable
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Enable/Disable the CTI hardware.
+
+What: /sys/bus/coresight/devices/<cti-name>/ctmid
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Display the associated CTM ID
+
+What: /sys/bus/coresight/devices/<cti-name>/nr_trigger_cons
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Number of devices connected to triggers on this CTI
+
+What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/name
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Name of connected device <N>
+
+What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/in_signals
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Input trigger signals from connected device <N>
+
+What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/in_types
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Functional types for the input trigger signals
+ from connected device <N>
+
+What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/out_signals
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Output trigger signals to connected device <N>
+
+What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/out_types
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Functional types for the output trigger signals
+ to connected device <N>
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/inout_sel
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Select the index for inen and outen registers.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/inen
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Read or write the CTIINEN register selected by inout_sel.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/outen
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Read or write the CTIOUTEN register selected by inout_sel.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/gate
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Read or write CTIGATE register.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/asicctl
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Read or write ASICCTL register.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/intack
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Write the INTACK register.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/appset
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Set CTIAPPSET register to activate channel. Read back to
+ determine current value of register.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/appclear
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Write APPCLEAR register to deactivate channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/apppulse
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Write APPPULSE to pulse a channel active for one clock
+ cycle.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/chinstatus
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) Read current status of channel inputs.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/choutstatus
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) read current status of channel outputs.
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/triginstatus
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) read current status of input trigger signals
+
+What: /sys/bus/coresight/devices/<cti-name>/regs/trigoutstatus
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) read current status of output trigger signals.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/trigin_attach
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Attach a CTI input trigger to a CTM channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/trigin_detach
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Detach a CTI input trigger from a CTM channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/trigout_attach
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Attach a CTI output trigger to a CTM channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/trigout_detach
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Detach a CTI output trigger from a CTM channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_gate_enable
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Enable CTIGATE for single channel (W) or list enabled
+ channels through the gate (R).
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_gate_disable
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Disable CTIGATE for single channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_set
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Activate a single channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_clear
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Deactivate a single channel.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_pulse
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Pulse a single channel - activate for a single clock cycle.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/trigout_filtered
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) List of output triggers filtered across all connections.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/trig_filter_enable
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Enable or disable trigger output signal filtering.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_inuse
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) show channels with at least one attached trigger signal.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_free
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (R) show channels with no attached trigger signals.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_xtrigs_view
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (RW) Write channel number to select a channel to view, read to
+ see triggers attached to selected channel on this CTI.
+
+What: /sys/bus/coresight/devices/<cti-name>/channels/chan_xtrigs_reset
+Date: Jan 2020
+KernelVersion 5.6
+Contact: Mike Leach or Mathieu Poirier
+Description: (W) Clear all channel / trigger programming.
--
2.17.1