diff mbox series

[v2,3/3] Documentation: trace: Add documentation for Coresight Dummy Trace

Message ID 20230324061608.33609-4-quic_hazha@quicinc.com
State New
Headers show
Series Add support to configure Coresight Dummy subunit | expand

Commit Message

Hao Zhang March 24, 2023, 6:16 a.m. UTC
Add documentation for Coresight Dummy Trace under trace/coresight.

Signed-off-by: Hao Zhang <quic_hazha@quicinc.com>
---
 .../trace/coresight/coresight-dummy.rst       | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/trace/coresight/coresight-dummy.rst

Comments

Hao Zhang March 27, 2023, 6:05 a.m. UTC | #1
Hi Suzuki,

On 3/24/2023 7:00 PM, Suzuki K Poulose wrote:
> On 24/03/2023 06:16, Hao Zhang wrote:
>> Add documentation for Coresight Dummy Trace under trace/coresight.
>>
>> Signed-off-by: Hao Zhang <quic_hazha@quicinc.com>
>> ---
>>   .../trace/coresight/coresight-dummy.rst       | 58 +++++++++++++++++++
>>   1 file changed, 58 insertions(+)
>>   create mode 100644 Documentation/trace/coresight/coresight-dummy.rst
>>
>> diff --git a/Documentation/trace/coresight/coresight-dummy.rst 
>> b/Documentation/trace/coresight/coresight-dummy.rst
>> new file mode 100644
>> index 000000000000..819cabab8623
>> --- /dev/null
>> +++ b/Documentation/trace/coresight/coresight-dummy.rst
>> @@ -0,0 +1,58 @@
>> +.. SPDX-License-Identifier: GPL-2.0
>> +
>> +=============================
>> +Coresight Dummy Trace Module
>> +=============================
>> +
>> +    :Author:   Hao Zhang <quic_hazha@quicinc.com>
>> +    :Date:     March 2023
>> +
>> +Introduction
>> +---------------------------
>> +
>> +Coresight Dummy Trace Module is for the specific devices that HLOS don't
> 
> Please do not use cryptic abbreviations, please use "kernel"
> 
Sure, I will change it to "kernel".
> 
>> +have permission to access or configure. 
> 
> Such as Coresight sink EUD, some
>> +TPDMs etc. 
> Say "e.g., CoreSight TPDMs on Qualcomm platforms.:
> 
> So there need driver to register dummy devices as Coresight
>> +devices.
> 
> Add:
> 
> "It may also be used to define components that may not have any
> programming interfaces (e.g, static links), so that paths can
> be established in the driver.
> "
> 
>   Provide Coresight API for dummy device operations, such as
>> +enabling and disabling dummy devices. Build the Coresight path for dummy
>> +sink or dummy source for debugging.
> 
I will take your advice in the next version of patch.
> 
> I think the following content may not be needed as they are part
> of the standard source/sink type devices, nothing specific to
> dummy devices.
> 
> --- vvvvv ---
>> +
>> +Sysfs files and directories
>> +---------------------------
>> +
>> +Root: ``/sys/bus/coresight/devices/dummy<N>``
>> +
>> +----
>> +
>> +:File:            ``enable_source`` (RW)
>> +:Notes:
>> +    - > 0 : enable the datasets of dummy source.
>> +
>> +    - = 0 : disable the datasets of dummy source.
>> +
>> +:Syntax:
>> +    ``echo 1 > enable_source``
>> +
>> +----
>> +
>> +:File:            ``enable_sink`` (RW)
>> +:Notes:
>> +    - > 0 : enable the datasets of dummy sink.
>> +
>> +    - = 0 : disable the datasets of dummy sink.
>> +
>> +:Syntax:
>> +    ``echo 1 > enable_sink``
>> +
>> +----
>> +
> 
> --- You may remove the above ^^^ ----
>
I will remove the above notes in the next version of patch.

Thanks,
Hao

>> +Config details
>> +---------------------------
>> +
>> +There are two types of nodes, dummy sink and dummy source. The nodes
>> +should be observed at the coresight path
>> +"/sys/bus/coresight/devices".
>> +e.g.
>> +/sys/bus/coresight/devices # ls -l | grep dummy
>> +dummy0 -> ../../../devices/platform/soc@0/soc@0:dummy_source/dummy0
>> +dummy1 -> ../../../devices/platform/soc@0/soc@0:dummy_sink/dummy1
> 
> Suzuki
>
Bagas Sanjaya March 27, 2023, 9:06 a.m. UTC | #2
On Fri, Mar 24, 2023 at 02:16:08PM +0800, Hao Zhang wrote:
> +Sysfs files and directories
> +---------------------------
> +
> +Root: ``/sys/bus/coresight/devices/dummy<N>``
> +
> +----
> +
> +:File:            ``enable_source`` (RW)
> +:Notes:
> +    - > 0 : enable the datasets of dummy source.
> +
> +    - = 0 : disable the datasets of dummy source.
> +
> +:Syntax:
> +    ``echo 1 > enable_source``
> +
> +----
> +
> +:File:            ``enable_sink`` (RW)
> +:Notes:
> +    - > 0 : enable the datasets of dummy sink.
> +
> +    - = 0 : disable the datasets of dummy sink.
> +
> +:Syntax:
> +    ``echo 1 > enable_sink``

Is enable_{source,sink} integer-valued or bit (0/1)? In other words, is
it OK to `echo 2` to both sysfs files?

> +
> +----
> +
> +Config details
> +---------------------------
> +
> +There are two types of nodes, dummy sink and dummy source. The nodes
> +should be observed at the coresight path
> +"/sys/bus/coresight/devices".

For consistency, inline this sysfs also (thus
``/sys/bus/coresight/devices``.

> +e.g.
e.g.:: (make the shell snippet below code block)
> +/sys/bus/coresight/devices # ls -l | grep dummy
IMO I prefer `PS1=\$` (that is, omit the directory). Alternatively,
you can write `ls -l /sys/bus/coresight/devices | grep dummy` (specify
the directory to `ls`).

Thanks.
Greg Kroah-Hartman March 27, 2023, 9:13 a.m. UTC | #3
On Fri, Mar 24, 2023 at 02:16:08PM +0800, Hao Zhang wrote:
> Add documentation for Coresight Dummy Trace under trace/coresight.
> 
> Signed-off-by: Hao Zhang <quic_hazha@quicinc.com>
> ---
>  .../trace/coresight/coresight-dummy.rst       | 58 +++++++++++++++++++
>  1 file changed, 58 insertions(+)
>  create mode 100644 Documentation/trace/coresight/coresight-dummy.rst
> 
> diff --git a/Documentation/trace/coresight/coresight-dummy.rst b/Documentation/trace/coresight/coresight-dummy.rst
> new file mode 100644
> index 000000000000..819cabab8623
> --- /dev/null
> +++ b/Documentation/trace/coresight/coresight-dummy.rst
> @@ -0,0 +1,58 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +=============================
> +Coresight Dummy Trace Module
> +=============================
> +
> +    :Author:   Hao Zhang <quic_hazha@quicinc.com>
> +    :Date:     March 2023
> +
> +Introduction
> +---------------------------
> +
> +Coresight Dummy Trace Module is for the specific devices that HLOS don't
> +have permission to access or configure. Such as Coresight sink EUD, some
> +TPDMs etc. So there need driver to register dummy devices as Coresight
> +devices. Provide Coresight API for dummy device operations, such as
> +enabling and disabling dummy devices. Build the Coresight path for dummy
> +sink or dummy source for debugging.
> +
> +Sysfs files and directories
> +---------------------------
> +
> +Root: ``/sys/bus/coresight/devices/dummy<N>``

sysfs files are documented in Documentation/ABI/ not in random .rst
files, sorry.  Please use the correct format described there, not a
random one like this :)

thanks,

greg k-h
Hao Zhang March 28, 2023, 1:45 a.m. UTC | #4
Hi Greg,

On 3/27/2023 5:13 PM, Greg Kroah-Hartman wrote:
> On Fri, Mar 24, 2023 at 02:16:08PM +0800, Hao Zhang wrote:
>> Add documentation for Coresight Dummy Trace under trace/coresight.
>>
>> Signed-off-by: Hao Zhang <quic_hazha@quicinc.com>
>> ---
>>   .../trace/coresight/coresight-dummy.rst       | 58 +++++++++++++++++++
>>   1 file changed, 58 insertions(+)
>>   create mode 100644 Documentation/trace/coresight/coresight-dummy.rst
>>
>> diff --git a/Documentation/trace/coresight/coresight-dummy.rst b/Documentation/trace/coresight/coresight-dummy.rst
>> new file mode 100644
>> index 000000000000..819cabab8623
>> --- /dev/null
>> +++ b/Documentation/trace/coresight/coresight-dummy.rst
>> @@ -0,0 +1,58 @@
>> +.. SPDX-License-Identifier: GPL-2.0
>> +
>> +=============================
>> +Coresight Dummy Trace Module
>> +=============================
>> +
>> +    :Author:   Hao Zhang <quic_hazha@quicinc.com>
>> +    :Date:     March 2023
>> +
>> +Introduction
>> +---------------------------
>> +
>> +Coresight Dummy Trace Module is for the specific devices that HLOS don't
>> +have permission to access or configure. Such as Coresight sink EUD, some
>> +TPDMs etc. So there need driver to register dummy devices as Coresight
>> +devices. Provide Coresight API for dummy device operations, such as
>> +enabling and disabling dummy devices. Build the Coresight path for dummy
>> +sink or dummy source for debugging.
>> +
>> +Sysfs files and directories
>> +---------------------------
>> +
>> +Root: ``/sys/bus/coresight/devices/dummy<N>``
> 
> sysfs files are documented in Documentation/ABI/ not in random .rst
> files, sorry.  Please use the correct format described there, not a
> random one like this :)
> 
> thanks,
> 
> greg k-h

Thanks for your review, I will correct the format in the next version of 
patch.

Thanks,
Hao
Hao Zhang March 28, 2023, 8:07 a.m. UTC | #5
Hi Bagas,

On 3/27/2023 5:06 PM, Bagas Sanjaya wrote:
> On Fri, Mar 24, 2023 at 02:16:08PM +0800, Hao Zhang wrote:
>> +Sysfs files and directories
>> +---------------------------
>> +
>> +Root: ``/sys/bus/coresight/devices/dummy<N>``
>> +
>> +----
>> +
>> +:File:            ``enable_source`` (RW)
>> +:Notes:
>> +    - > 0 : enable the datasets of dummy source.
>> +
>> +    - = 0 : disable the datasets of dummy source.
>> +
>> +:Syntax:
>> +    ``echo 1 > enable_source``
>> +
>> +----
>> +
>> +:File:            ``enable_sink`` (RW)
>> +:Notes:
>> +    - > 0 : enable the datasets of dummy sink.
>> +
>> +    - = 0 : disable the datasets of dummy sink.
>> +
>> +:Syntax:
>> +    ``echo 1 > enable_sink``
> 
> Is enable_{source,sink} integer-valued or bit (0/1)? In other words, is
> it OK to `echo 2` to both sysfs files?

It should be the integer value, that is OK to "echo 2" to the sysfs files.

>> +
>> +----
>> +
>> +Config details
>> +---------------------------
>> +
>> +There are two types of nodes, dummy sink and dummy source. The nodes
>> +should be observed at the coresight path
>> +"/sys/bus/coresight/devices".
> 
> For consistency, inline this sysfs also (thus
> ``/sys/bus/coresight/devices``.
> 
>> +e.g.
> e.g.:: (make the shell snippet below code block)

I will correct it in the next version of patch.

>> +/sys/bus/coresight/devices # ls -l | grep dummy
> IMO I prefer `PS1=\$` (that is, omit the directory). Alternatively,
> you can write `ls -l /sys/bus/coresight/devices | grep dummy` (specify
> the directory to `ls`).
> 
> Thanks.
> 

Thanks for your comments, I will take your advice in the next version of 
patch.

Thanks,
Hao
diff mbox series

Patch

diff --git a/Documentation/trace/coresight/coresight-dummy.rst b/Documentation/trace/coresight/coresight-dummy.rst
new file mode 100644
index 000000000000..819cabab8623
--- /dev/null
+++ b/Documentation/trace/coresight/coresight-dummy.rst
@@ -0,0 +1,58 @@ 
+.. SPDX-License-Identifier: GPL-2.0
+
+=============================
+Coresight Dummy Trace Module
+=============================
+
+    :Author:   Hao Zhang <quic_hazha@quicinc.com>
+    :Date:     March 2023
+
+Introduction
+---------------------------
+
+Coresight Dummy Trace Module is for the specific devices that HLOS don't
+have permission to access or configure. Such as Coresight sink EUD, some
+TPDMs etc. So there need driver to register dummy devices as Coresight
+devices. Provide Coresight API for dummy device operations, such as
+enabling and disabling dummy devices. Build the Coresight path for dummy
+sink or dummy source for debugging.
+
+Sysfs files and directories
+---------------------------
+
+Root: ``/sys/bus/coresight/devices/dummy<N>``
+
+----
+
+:File:            ``enable_source`` (RW)
+:Notes:
+    - > 0 : enable the datasets of dummy source.
+
+    - = 0 : disable the datasets of dummy source.
+
+:Syntax:
+    ``echo 1 > enable_source``
+
+----
+
+:File:            ``enable_sink`` (RW)
+:Notes:
+    - > 0 : enable the datasets of dummy sink.
+
+    - = 0 : disable the datasets of dummy sink.
+
+:Syntax:
+    ``echo 1 > enable_sink``
+
+----
+
+Config details
+---------------------------
+
+There are two types of nodes, dummy sink and dummy source. The nodes
+should be observed at the coresight path
+"/sys/bus/coresight/devices".
+e.g.
+/sys/bus/coresight/devices # ls -l | grep dummy
+dummy0 -> ../../../devices/platform/soc@0/soc@0:dummy_source/dummy0
+dummy1 -> ../../../devices/platform/soc@0/soc@0:dummy_sink/dummy1