linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation: coresight: Update the generic device names
@ 2019-05-30 15:11 Suzuki K Poulose
  2019-06-03 19:01 ` Mathieu Poirier
  0 siblings, 1 reply; 7+ messages in thread
From: Suzuki K Poulose @ 2019-05-30 15:11 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mathieu Poirier, Jonathan Corbet, coresight, Suzuki K Poulose,
	linux-kernel, leo.yan

Update the documentation to reflect the new naming scheme with
latest changes.

Reported-by: Leo Yan <leo.yan@linaro.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 Documentation/trace/coresight.txt | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt
index efbc832..7b427cf 100644
--- a/Documentation/trace/coresight.txt
+++ b/Documentation/trace/coresight.txt
@@ -326,16 +326,20 @@ amount of processor cores), the "cs_etm" PMU will be listed only once.
 A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
 listed along with configuration options within forward slashes '/'.  Since a
 Coresight system will typically have more than one sink, the name of the sink to
-work with needs to be specified as an event option.  Names for sink to choose
-from are listed in sysFS under ($SYSFS)/bus/coresight/devices:
+work with needs to be specified as an event option.
+On newer kernels the available sinks are listed in sysFS under:
+($SYSFS)/bus/event_source/devices/cs_etm/sinks/
 
-	root@linaro-nano:~# ls /sys/bus/coresight/devices/
-		20010000.etf   20040000.funnel  20100000.stm  22040000.etm
-		22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu
-		20070000.etr     20120000.replicator  220c0000.funnel
-		23040000.etm  23140000.etm     23340000.etm
+	root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
+	tmc_etf0  tmc_etr0  tpiu0
 
-	root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program
+On older kernels, this may need to be found from the list of coresight devices,
+available under ($SYSFS)/bus/coresight/devices/:
+
+	root@localhost:/sys/bus/coresight/devices# ls
+	etm0  etm1  etm2  etm3  etm4  etm5  funnel0  funnel1  funnel2  replicator0  stm0 tmc_etf0  tmc_etr0  tpiu0
+
+	root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
 
 The syntax within the forward slashes '/' is important.  The '@' character
 tells the parser that a sink is about to be specified and that this is the sink
@@ -352,7 +356,7 @@ perf can be used to record and analyze trace of programs.
 Execution can be recorded using 'perf record' with the cs_etm event,
 specifying the name of the sink to record to, e.g:
 
-    perf record -e cs_etm/@20070000.etr/u --per-thread
+    perf record -e cs_etm/@tmc_etr0/u --per-thread
 
 The 'perf report' and 'perf script' commands can be used to analyze execution,
 synthesizing instruction and branch events from the instruction trace.
@@ -381,7 +385,7 @@ sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tuto
 	Bubble sorting array of 30000 elements
 	5910 ms
 
-	$ perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 ./sort
+	$ perf record -e cs_etm/@tmc_etr0/u --per-thread taskset -c 2 ./sort
 	Bubble sorting array of 30000 elements
 	12543 ms
 	[ perf record: Woken up 35 times to write data ]
@@ -405,7 +409,7 @@ than the program flow through the code.
 As with any other CoreSight component, specifics about the STM tracer can be
 found in sysfs with more information on each entry being found in [1]:
 
-root@genericarmv8:~# ls /sys/bus/coresight/devices/20100000.stm
+root@genericarmv8:~# ls /sys/bus/coresight/devices/stm0
 enable_source   hwevent_select  port_enable     subsystem       uevent
 hwevent_enable  mgmt            port_select     traceid
 root@genericarmv8:~#
@@ -413,14 +417,14 @@ root@genericarmv8:~#
 Like any other source a sink needs to be identified and the STM enabled before
 being used:
 
-root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20010000.etf/enable_sink
-root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20100000.stm/enable_source
+root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
+root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/stm0/enable_source
 
 From there user space applications can request and use channels using the devfs
 interface provided for that purpose by the generic STM API:
 
-root@genericarmv8:~# ls -l /dev/20100000.stm
-crw-------    1 root     root       10,  61 Jan  3 18:11 /dev/20100000.stm
+root@genericarmv8:~# ls -l /dev/stm0
+crw-------    1 root     root       10,  61 Jan  3 18:11 /dev/stm0
 root@genericarmv8:~#
 
 Details on how to use the generic STM API can be found here [2].
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Documentation: coresight: Update the generic device names
  2019-05-30 15:11 [PATCH] Documentation: coresight: Update the generic device names Suzuki K Poulose
@ 2019-06-03 19:01 ` Mathieu Poirier
  2019-06-06 16:21   ` Suzuki K Poulose
  0 siblings, 1 reply; 7+ messages in thread
From: Mathieu Poirier @ 2019-06-03 19:01 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: coresight, Jonathan Corbet, linux-kernel, linux-arm-kernel, leo.yan

Hi Suzuki,

On Thu, May 30, 2019 at 04:11:17PM +0100, Suzuki K Poulose wrote:
> Update the documentation to reflect the new naming scheme with
> latest changes.
> 
> Reported-by: Leo Yan <leo.yan@linaro.org>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  Documentation/trace/coresight.txt | 34 +++++++++++++++++++---------------
>  1 file changed, 19 insertions(+), 15 deletions(-)
> 
> diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt
> index efbc832..7b427cf 100644
> --- a/Documentation/trace/coresight.txt
> +++ b/Documentation/trace/coresight.txt
> @@ -326,16 +326,20 @@ amount of processor cores), the "cs_etm" PMU will be listed only once.
>  A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
>  listed along with configuration options within forward slashes '/'.  Since a
>  Coresight system will typically have more than one sink, the name of the sink to
> -work with needs to be specified as an event option.  Names for sink to choose
> -from are listed in sysFS under ($SYSFS)/bus/coresight/devices:
> +work with needs to be specified as an event option.
> +On newer kernels the available sinks are listed in sysFS under:
> +($SYSFS)/bus/event_source/devices/cs_etm/sinks/
>  
> -	root@linaro-nano:~# ls /sys/bus/coresight/devices/
> -		20010000.etf   20040000.funnel  20100000.stm  22040000.etm
> -		22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu
> -		20070000.etr     20120000.replicator  220c0000.funnel
> -		23040000.etm  23140000.etm     23340000.etm
> +	root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
> +	tmc_etf0  tmc_etr0  tpiu0
>  
> -	root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program
> +On older kernels, this may need to be found from the list of coresight devices,
> +available under ($SYSFS)/bus/coresight/devices/:
> +
> +	root@localhost:/sys/bus/coresight/devices# ls
> +	etm0  etm1  etm2  etm3  etm4  etm5  funnel0  funnel1  funnel2  replicator0  stm0 tmc_etf0  tmc_etr0  tpiu0
> +
> +	root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program

On the "older" kernels you are referring to one would find the original naming
convention.  Everything else looks good to me.

Mathieu

>  
>  The syntax within the forward slashes '/' is important.  The '@' character
>  tells the parser that a sink is about to be specified and that this is the sink
> @@ -352,7 +356,7 @@ perf can be used to record and analyze trace of programs.
>  Execution can be recorded using 'perf record' with the cs_etm event,
>  specifying the name of the sink to record to, e.g:
>  
> -    perf record -e cs_etm/@20070000.etr/u --per-thread
> +    perf record -e cs_etm/@tmc_etr0/u --per-thread
>  
>  The 'perf report' and 'perf script' commands can be used to analyze execution,
>  synthesizing instruction and branch events from the instruction trace.
> @@ -381,7 +385,7 @@ sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tuto
>  	Bubble sorting array of 30000 elements
>  	5910 ms
>  
> -	$ perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 ./sort
> +	$ perf record -e cs_etm/@tmc_etr0/u --per-thread taskset -c 2 ./sort
>  	Bubble sorting array of 30000 elements
>  	12543 ms
>  	[ perf record: Woken up 35 times to write data ]
> @@ -405,7 +409,7 @@ than the program flow through the code.
>  As with any other CoreSight component, specifics about the STM tracer can be
>  found in sysfs with more information on each entry being found in [1]:
>  
> -root@genericarmv8:~# ls /sys/bus/coresight/devices/20100000.stm
> +root@genericarmv8:~# ls /sys/bus/coresight/devices/stm0
>  enable_source   hwevent_select  port_enable     subsystem       uevent
>  hwevent_enable  mgmt            port_select     traceid
>  root@genericarmv8:~#
> @@ -413,14 +417,14 @@ root@genericarmv8:~#
>  Like any other source a sink needs to be identified and the STM enabled before
>  being used:
>  
> -root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20010000.etf/enable_sink
> -root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20100000.stm/enable_source
> +root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
> +root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/stm0/enable_source
>  
>  From there user space applications can request and use channels using the devfs
>  interface provided for that purpose by the generic STM API:
>  
> -root@genericarmv8:~# ls -l /dev/20100000.stm
> -crw-------    1 root     root       10,  61 Jan  3 18:11 /dev/20100000.stm
> +root@genericarmv8:~# ls -l /dev/stm0
> +crw-------    1 root     root       10,  61 Jan  3 18:11 /dev/stm0
>  root@genericarmv8:~#
>  
>  Details on how to use the generic STM API can be found here [2].
> -- 
> 2.7.4
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Documentation: coresight: Update the generic device names
  2019-06-03 19:01 ` Mathieu Poirier
@ 2019-06-06 16:21   ` Suzuki K Poulose
  2019-06-07  2:21     ` Leo Yan
  0 siblings, 1 reply; 7+ messages in thread
From: Suzuki K Poulose @ 2019-06-06 16:21 UTC (permalink / raw)
  To: mathieu.poirier
  Cc: coresight, corbet, linux-kernel, linux-arm-kernel, leo.yan

Hi Mathieu,

On 03/06/2019 20:01, Mathieu Poirier wrote:
> Hi Suzuki,
> 
> On Thu, May 30, 2019 at 04:11:17PM +0100, Suzuki K Poulose wrote:
>> Update the documentation to reflect the new naming scheme with
>> latest changes.
>>
>> Reported-by: Leo Yan <leo.yan@linaro.org>
>> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>>   Documentation/trace/coresight.txt | 34 +++++++++++++++++++---------------
>>   1 file changed, 19 insertions(+), 15 deletions(-)
>>
>> diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt
>> index efbc832..7b427cf 100644
>> --- a/Documentation/trace/coresight.txt
>> +++ b/Documentation/trace/coresight.txt
>> @@ -326,16 +326,20 @@ amount of processor cores), the "cs_etm" PMU will be listed only once.
>>   A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
>>   listed along with configuration options within forward slashes '/'.  Since a
>>   Coresight system will typically have more than one sink, the name of the sink to
>> -work with needs to be specified as an event option.  Names for sink to choose
>> -from are listed in sysFS under ($SYSFS)/bus/coresight/devices:
>> +work with needs to be specified as an event option.
>> +On newer kernels the available sinks are listed in sysFS under:
>> +($SYSFS)/bus/event_source/devices/cs_etm/sinks/
>>   
>> -	root@linaro-nano:~# ls /sys/bus/coresight/devices/
>> -		20010000.etf   20040000.funnel  20100000.stm  22040000.etm
>> -		22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu
>> -		20070000.etr     20120000.replicator  220c0000.funnel
>> -		23040000.etm  23140000.etm     23340000.etm
>> +	root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
>> +	tmc_etf0  tmc_etr0  tpiu0
>>   
>> -	root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program
>> +On older kernels, this may need to be found from the list of coresight devices,
>> +available under ($SYSFS)/bus/coresight/devices/:
>> +
>> +	root@localhost:/sys/bus/coresight/devices# ls
>> +	etm0  etm1  etm2  etm3  etm4  etm5  funnel0  funnel1  funnel2  replicator0  stm0 tmc_etf0  tmc_etr0  tpiu0
>> +
>> +	root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
> 
> On the "older" kernels you are referring to one would find the original naming
> convention.  Everything else looks good to me.

True, but do we care what we see there ? All we care about is the location,
where to find them. I could fix it, if you think thats needed.

Cheers
Suzuki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Documentation: coresight: Update the generic device names
  2019-06-06 16:21   ` Suzuki K Poulose
@ 2019-06-07  2:21     ` Leo Yan
  2019-06-07  8:40       ` Suzuki K Poulose
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Yan @ 2019-06-07  2:21 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: coresight, corbet, linux-arm-kernel, mathieu.poirier, linux-kernel

Hi Suzuki,

On Thu, Jun 06, 2019 at 05:21:19PM +0100, Suzuki K Poulose wrote:
> Hi Mathieu,
> 
> On 03/06/2019 20:01, Mathieu Poirier wrote:
> > Hi Suzuki,
> > 
> > On Thu, May 30, 2019 at 04:11:17PM +0100, Suzuki K Poulose wrote:
> > > Update the documentation to reflect the new naming scheme with
> > > latest changes.
> > > 
> > > Reported-by: Leo Yan <leo.yan@linaro.org>
> > > Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> > > Cc: Jonathan Corbet <corbet@lwn.net>
> > > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> > > ---
> > >   Documentation/trace/coresight.txt | 34 +++++++++++++++++++---------------
> > >   1 file changed, 19 insertions(+), 15 deletions(-)
> > > 
> > > diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt
> > > index efbc832..7b427cf 100644
> > > --- a/Documentation/trace/coresight.txt
> > > +++ b/Documentation/trace/coresight.txt
> > > @@ -326,16 +326,20 @@ amount of processor cores), the "cs_etm" PMU will be listed only once.
> > >   A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
> > >   listed along with configuration options within forward slashes '/'.  Since a
> > >   Coresight system will typically have more than one sink, the name of the sink to
> > > -work with needs to be specified as an event option.  Names for sink to choose
> > > -from are listed in sysFS under ($SYSFS)/bus/coresight/devices:
> > > +work with needs to be specified as an event option.
> > > +On newer kernels the available sinks are listed in sysFS under:
> > > +($SYSFS)/bus/event_source/devices/cs_etm/sinks/
> > > -	root@linaro-nano:~# ls /sys/bus/coresight/devices/
> > > -		20010000.etf   20040000.funnel  20100000.stm  22040000.etm
> > > -		22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu
> > > -		20070000.etr     20120000.replicator  220c0000.funnel
> > > -		23040000.etm  23140000.etm     23340000.etm
> > > +	root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
> > > +	tmc_etf0  tmc_etr0  tpiu0
> > > -	root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program
> > > +On older kernels, this may need to be found from the list of coresight devices,
> > > +available under ($SYSFS)/bus/coresight/devices/:
> > > +
> > > +	root@localhost:/sys/bus/coresight/devices# ls
> > > +	etm0  etm1  etm2  etm3  etm4  etm5  funnel0  funnel1  funnel2  replicator0  stm0 tmc_etf0  tmc_etr0  tpiu0
> > > +
> > > +	root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
> > 
> > On the "older" kernels you are referring to one would find the original naming
> > convention.  Everything else looks good to me.
> 
> True, but do we care what we see there ? All we care about is the location,
> where to find them. I could fix it, if you think thats needed.

IIUC, either the old kernel or newer kernel, both we can find the event
from ($SYSFS)/bus/event_source/devices/cs_etm/sinks/; the only
difference between them is the naming convention.

So the doc can use the same location to find event for both new and
old kernel, and explain the naming convention difference?

Thanks,
Leo Yan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Documentation: coresight: Update the generic device names
  2019-06-07  2:21     ` Leo Yan
@ 2019-06-07  8:40       ` Suzuki K Poulose
  2019-06-07 13:42         ` Leo Yan
  2019-06-07 15:58         ` Mathieu Poirier
  0 siblings, 2 replies; 7+ messages in thread
From: Suzuki K Poulose @ 2019-06-07  8:40 UTC (permalink / raw)
  To: leo.yan
  Cc: coresight, corbet, linux-arm-kernel, mathieu.poirier, linux-kernel

Hi Leo,

>>>>    A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
>>>>    listed along with configuration options within forward slashes '/'.  Since a
>>>>    Coresight system will typically have more than one sink, the name of the sink to
>>>> -work with needs to be specified as an event option.  Names for sink to choose
>>>> -from are listed in sysFS under ($SYSFS)/bus/coresight/devices:
>>>> +work with needs to be specified as an event option.
>>>> +On newer kernels the available sinks are listed in sysFS under:
>>>> +($SYSFS)/bus/event_source/devices/cs_etm/sinks/
>>>> -	root@linaro-nano:~# ls /sys/bus/coresight/devices/
>>>> -		20010000.etf   20040000.funnel  20100000.stm  22040000.etm
>>>> -		22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu
>>>> -		20070000.etr     20120000.replicator  220c0000.funnel
>>>> -		23040000.etm  23140000.etm     23340000.etm
>>>> +	root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
>>>> +	tmc_etf0  tmc_etr0  tpiu0
>>>> -	root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program
>>>> +On older kernels, this may need to be found from the list of coresight devices,
>>>> +available under ($SYSFS)/bus/coresight/devices/:
>>>> +
>>>> +	root@localhost:/sys/bus/coresight/devices# ls
>>>> +	etm0  etm1  etm2  etm3  etm4  etm5  funnel0  funnel1  funnel2  replicator0  stm0 tmc_etf0  tmc_etr0  tpiu0
>>>> +
>>>> +	root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
>>>
>>> On the "older" kernels you are referring to one would find the original naming
>>> convention.  Everything else looks good to me.
>>
>> True, but do we care what we see there ? All we care about is the location,
>> where to find them. I could fix it, if you think thats needed.
> 
> IIUC, either the old kernel or newer kernel, both we can find the event
> from ($SYSFS)/bus/event_source/devices/cs_etm/sinks/; the only
> difference between them is the naming convention.

The cs_etm/sinks was only added with the CPU-wide trace support. So, if someone
refers to this document alone and then tries to do something on on older kernel,
which is quite possible for a production device running a stable kernel, {s,}he
might be surprised.

> 
> So the doc can use the same location to find event for both new and
> old kernel, and explain the naming convention difference?

My question is really, does the naming convention matter ? What you see
under the directory is the name. But yes, I am open to add a section to
explain the fact that we changed the naming scheme, if everyone agrees
to it.

Cheers
Suzuki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Documentation: coresight: Update the generic device names
  2019-06-07  8:40       ` Suzuki K Poulose
@ 2019-06-07 13:42         ` Leo Yan
  2019-06-07 15:58         ` Mathieu Poirier
  1 sibling, 0 replies; 7+ messages in thread
From: Leo Yan @ 2019-06-07 13:42 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: coresight, corbet, linux-arm-kernel, mathieu.poirier, linux-kernel

Hi Suzuki,

On Fri, Jun 07, 2019 at 09:40:48AM +0100, Suzuki K Poulose wrote:
> Hi Leo,
> 
> > > > >    A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
> > > > >    listed along with configuration options within forward slashes '/'.  Since a
> > > > >    Coresight system will typically have more than one sink, the name of the sink to
> > > > > -work with needs to be specified as an event option.  Names for sink to choose
> > > > > -from are listed in sysFS under ($SYSFS)/bus/coresight/devices:
> > > > > +work with needs to be specified as an event option.
> > > > > +On newer kernels the available sinks are listed in sysFS under:
> > > > > +($SYSFS)/bus/event_source/devices/cs_etm/sinks/
> > > > > -	root@linaro-nano:~# ls /sys/bus/coresight/devices/
> > > > > -		20010000.etf   20040000.funnel  20100000.stm  22040000.etm
> > > > > -		22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu
> > > > > -		20070000.etr     20120000.replicator  220c0000.funnel
> > > > > -		23040000.etm  23140000.etm     23340000.etm
> > > > > +	root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
> > > > > +	tmc_etf0  tmc_etr0  tpiu0
> > > > > -	root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program
> > > > > +On older kernels, this may need to be found from the list of coresight devices,
> > > > > +available under ($SYSFS)/bus/coresight/devices/:
> > > > > +
> > > > > +	root@localhost:/sys/bus/coresight/devices# ls
> > > > > +	etm0  etm1  etm2  etm3  etm4  etm5  funnel0  funnel1  funnel2  replicator0  stm0 tmc_etf0  tmc_etr0  tpiu0
> > > > > +
> > > > > +	root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
> > > > 
> > > > On the "older" kernels you are referring to one would find the original naming
> > > > convention.  Everything else looks good to me.
> > > 
> > > True, but do we care what we see there ? All we care about is the location,
> > > where to find them. I could fix it, if you think thats needed.
> > 
> > IIUC, either the old kernel or newer kernel, both we can find the event
> > from ($SYSFS)/bus/event_source/devices/cs_etm/sinks/; the only
> > difference between them is the naming convention.
> 
> The cs_etm/sinks was only added with the CPU-wide trace support. So, if someone
> refers to this document alone and then tries to do something on on older kernel,
> which is quite possible for a production device running a stable kernel, {s,}he
> might be surprised.

Okay, understand now.  Thanks for clarification.

> > So the doc can use the same location to find event for both new and
> > old kernel, and explain the naming convention difference?
> 
> My question is really, does the naming convention matter ? What you see
> under the directory is the name. But yes, I am open to add a section to
> explain the fact that we changed the naming scheme, if everyone agrees
> to it.

The naming convention is not important for the developers who are
familiar with CoreSight development; later who is the first time to
access kernel CoreSight modules and don't know the history for naming
scheme, the related documentation will be friendly and reduce the
barrier for using it.

I have no strong opinion for this, seems to me another choice is to
describe the older kernel with old naming scheme, something like below:

On older kernels, this may need to be found from the list of coresight devices,
available under ($SYSFS)/bus/coresight/devices/ with old naming scheme:

    root@linaro-nano:~# ls /sys/bus/coresight/devices/
    	20010000.etf   20040000.funnel  20100000.stm  22040000.etm> Cheers
    	22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu > Suzuki
    	20070000.etr     20120000.replicator  220c0000.funnel
    	23040000.etm  23140000.etm     23340000.etm

    root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program


Thanks,
Leo Yan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Documentation: coresight: Update the generic device names
  2019-06-07  8:40       ` Suzuki K Poulose
  2019-06-07 13:42         ` Leo Yan
@ 2019-06-07 15:58         ` Mathieu Poirier
  1 sibling, 0 replies; 7+ messages in thread
From: Mathieu Poirier @ 2019-06-07 15:58 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: Coresight ML, Jon Corbet, Linux Kernel Mailing List,
	linux-arm-kernel, Leo Yan

On Fri, 7 Jun 2019 at 02:40, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>
> Hi Leo,
>
> >>>>    A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
> >>>>    listed along with configuration options within forward slashes '/'.  Since a
> >>>>    Coresight system will typically have more than one sink, the name of the sink to
> >>>> -work with needs to be specified as an event option.  Names for sink to choose
> >>>> -from are listed in sysFS under ($SYSFS)/bus/coresight/devices:
> >>>> +work with needs to be specified as an event option.
> >>>> +On newer kernels the available sinks are listed in sysFS under:
> >>>> +($SYSFS)/bus/event_source/devices/cs_etm/sinks/
> >>>> -  root@linaro-nano:~# ls /sys/bus/coresight/devices/
> >>>> -          20010000.etf   20040000.funnel  20100000.stm  22040000.etm
> >>>> -          22140000.etm  230c0000.funnel  23240000.etm 20030000.tpiu
> >>>> -          20070000.etr     20120000.replicator  220c0000.funnel
> >>>> -          23040000.etm  23140000.etm     23340000.etm
> >>>> +  root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
> >>>> +  tmc_etf0  tmc_etr0  tpiu0
> >>>> -  root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program
> >>>> +On older kernels, this may need to be found from the list of coresight devices,
> >>>> +available under ($SYSFS)/bus/coresight/devices/:
> >>>> +
> >>>> +  root@localhost:/sys/bus/coresight/devices# ls
> >>>> +  etm0  etm1  etm2  etm3  etm4  etm5  funnel0  funnel1  funnel2  replicator0  stm0 tmc_etf0  tmc_etr0  tpiu0
> >>>> +
> >>>> +  root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
> >>>
> >>> On the "older" kernels you are referring to one would find the original naming
> >>> convention.  Everything else looks good to me.
> >>
> >> True, but do we care what we see there ? All we care about is the location,
> >> where to find them. I could fix it, if you think thats needed.
> >
> > IIUC, either the old kernel or newer kernel, both we can find the event
> > from ($SYSFS)/bus/event_source/devices/cs_etm/sinks/; the only
> > difference between them is the naming convention.
>
> The cs_etm/sinks was only added with the CPU-wide trace support. So, if someone
> refers to this document alone and then tries to do something on on older kernel,
> which is quite possible for a production device running a stable kernel, {s,}he
> might be surprised.
>
> >
> > So the doc can use the same location to find event for both new and
> > old kernel, and explain the naming convention difference?
>
> My question is really, does the naming convention matter ? What you see
> under the directory is the name. But yes, I am open to add a section to
> explain the fact that we changed the naming scheme, if everyone agrees
> to it.

I think it would be preferable to mention the change - just a small
section that describes what happened and the reason for doing so will
be fine.

>
> Cheers
> Suzuki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-07 15:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-30 15:11 [PATCH] Documentation: coresight: Update the generic device names Suzuki K Poulose
2019-06-03 19:01 ` Mathieu Poirier
2019-06-06 16:21   ` Suzuki K Poulose
2019-06-07  2:21     ` Leo Yan
2019-06-07  8:40       ` Suzuki K Poulose
2019-06-07 13:42         ` Leo Yan
2019-06-07 15:58         ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).