On Thu, Jul 02, 2020 at 11:39:34AM +0100, Mike Leach wrote:
[...]
Due to the way perf works, the sinks/<name> contains a value known as the sinkid - this is a string hash of <name>. This 32 bit hash is what is passed between kernel and user space perf, not the string. As a result the following is possible (from my DB410 system):-
root@linaro-developer:/home/linaro/perf-tests# ls /sys/devices/cs_etm/sinks/ tmc_etf0 tmc_etr0 tpiu0 root@linaro-developer:/home/linaro/perf-tests# cat /sys/devices/cs_etm/sinks/tmc_etr0 0xa6509eae root@linaro-developer:/home/linaro/perf-tests# ./perf record -e cs_etm/sinkid=0xa6509eae/ --per-thread uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.157 MB perf.data ]
Just follow up Mike's suggestion, you could apply below change to dump more info for source and sink connections. This would be a good start point to verify your suspected issues.
---8<---
diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 84f1dcb69827..935c75a9ad4b 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -226,6 +226,8 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, sink = coresight_get_enabled_sink(true); }
+ printk("%s: specified sink name %s\n", __func__, dev_name(&sink->dev)); + if (!sink) goto err;
@@ -253,6 +255,9 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, continue; }
+ printk("%s: create path %s->%s\n", __func__, + dev_name(&csdev->dev), dev_name(&sink->dev)); + /* * Building a path doesn't enable it, it simply builds a * list of devices from source to sink that can be
I can see the kernel logs:
root@debian:~# perf record -e cs_etm/@tmc_etr0/ --per-thread uname [ 284.320559] etm_setup_aux: specified sink name tmc_etr0 [ 284.325815] etm_setup_aux: create path etm0->tmc_etr0 [ 284.330927] etm_setup_aux: create path etm1->tmc_etr0 [ 284.336006] etm_setup_aux: create path etm2->tmc_etr0 [ 284.341083] etm_setup_aux: create path etm3->tmc_etr0 [ 284.346158] etm_setup_aux: create path etm4->tmc_etr0 [ 284.351233] etm_setup_aux: create path etm5->tmc_etr0
Thanks, Leo