Re: [PATCH v2 1/2] drivers/perf: hisi: Add driver for HiSilicon PCIe PMU

2021-04-13 Thread liuqi (BA)



Hi John,

On 2021/4/13 1:21, John Garry wrote:

On 12/04/2021 14:34, liuqi (BA) wrote:


Hi John,

Thanks for reviewing this.
On 2021/4/9 18:22, John Garry wrote:

On 09/04/2021 10:05, Qi Liu wrote:

PCIe PMU Root Complex Integrated End Point(RCiEP) device is supported
to sample bandwidth, latency, buffer occupation etc.

Each PMU RCiEP device monitors multiple Root Ports, and each RCiEP is
registered as a PMU in /sys/bus/event_source/devices, so users can
select target PMU, and use filter to do further sets.


side note: it would be good to mention what baseline the series is based 
on in the cover letter



Got it, will add it, thanks.



Filtering options contains:
event    - select the event.
subevent - select the subevent.
port - select target Root Ports. Information of Root Ports
 are shown under sysfs.
bdf  - select requester_id of target EP device.
trig_len - set trigger condition for starting event statistics.
trigger_mode - set trigger mode. 0 means starting to statistic when
 bigger than trigger condition, and 1 means smaller.
thr_len  - set threshold for statistics.
thr_mode - set threshold mode. 0 means count when bigger than
 threshold, and 1 means smaller.

Signed-off-by: Qi Liu 
---
   MAINTAINERS    |    6 +
   drivers/perf/Kconfig   |    2 +
   drivers/perf/Makefile  |    1 +
   drivers/perf/pci/Kconfig   |   16 +
   drivers/perf/pci/Makefile  |    2 +
   drivers/perf/pci/hisilicon/Makefile    |    5 +
   drivers/perf/pci/hisilicon/hisi_pcie_pmu.c | 1011

   include/linux/cpuhotplug.h |    1 +
   8 files changed, 1044 insertions(+)
   create mode 100644 drivers/perf/pci/Kconfig
   create mode 100644 drivers/perf/pci/Makefile
   create mode 100644 drivers/perf/pci/hisilicon/Makefile
   create mode 100644 drivers/perf/pci/hisilicon/hisi_pcie_pmu.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 3353de0..46c7861 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8023,6 +8023,12 @@ W:    http://www.hisilicon.com
   F:    Documentation/admin-guide/perf/hisi-pmu.rst
   F:    drivers/perf/hisilicon
+HISILICON PCIE PMU DRIVER
+M:    Qi Liu 
+S:    Maintained
+F:    Documentation/admin-guide/perf/hisi-pcie-pmu.rst


nit: this does not exist yet...


thanks, I'll move this add-maintainer-part to the second patch.


that's why I advocate the documentation first :)

ok, I'll move document as the first patch.



+F:    drivers/perf/pci/hisilicon/hisi_pcie_pmu.c
+
   HISILICON QM AND ZIP Controller DRIVER
   M:    Zhou Wang 
   L:    linux-cry...@vger.kernel.org
diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
index 3075cf1..99d4760 100644
--- a/drivers/perf/Kconfig
+++ b/drivers/perf/Kconfig
@@ -139,4 +139,6 @@ config ARM_DMC620_PMU
   source "drivers/perf/hisilicon/Kconfig"
+source "drivers/perf/pci/Kconfig"
+
   endmenu
diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile
index 5260b11..1208c08 100644
--- a/drivers/perf/Makefile
+++ b/drivers/perf/Makefile
@@ -14,3 +14,4 @@ obj-$(CONFIG_THUNDERX2_PMU) += thunderx2_pmu.o
   obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
   obj-$(CONFIG_ARM_SPE_PMU) += arm_spe_pmu.o
   obj-$(CONFIG_ARM_DMC620_PMU) += arm_dmc620_pmu.o
+obj-y += pci/
diff --git a/drivers/perf/pci/Kconfig b/drivers/perf/pci/Kconfig
new file mode 100644
index 000..a119486
--- /dev/null
+++ b/drivers/perf/pci/Kconfig
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# PCIe Performance Monitor Drivers
+#
+menu "PCIe Performance Monitor"
+
+config HISI_PCIE_PMU
+    tristate "HiSilicon PCIE PERF PMU"
+    depends on ARM64 && PCI && HISI_PMU


What from HISI_PMU is needed? I couldn't find anything here

The event_sysfs_show() and format_sysfs_show() function of
hisi_uncore_pmu.h can be reused in hisi_pcie_pmu.c, So I add path in
Makefile and include "hisi_uncore_pmu.h".


Right, but it would be nice to be able to build this under COMPILE_TEST. 
CONFIG_HISI_PMU cannot be built under COMPILE_TEST, so nice to not 
depend on it.


So you could put hisi_event_sysfs_show() as a static inline in 
hisi_uncore_pmu.h, so the dependency can be removed


Having said that, there is nothing really hisi specific in those 
functions like hisi_event_sysfs_show().


Can't we just create generic functions here?

hisi_event_sysfs_show() == cci400_pmu_cycle_event_show() == 
xgene_pmu_event_show()



Got it, will address this.





+    help
+  Provide support for HiSilicon PCIe performance monitoring unit
(PMU)
+  RCiEP devices.
+  Adds the PCIe PMU into perf events system for monitoring 
latency,

+  bandwidth etc.
+







[...]

+static bool hisi_pcie_pmu_valid_filter(struct perf_event *event,
+   struct hisi_pcie_pmu *pcie_pmu)
+{
+    u32 subev_idx = hisi_

Re: [PATCH v2 1/2] drivers/perf: hisi: Add driver for HiSilicon PCIe PMU

2021-04-12 Thread liuqi (BA)



Hi John,

Thanks for reviewing this.
On 2021/4/9 18:22, John Garry wrote:

On 09/04/2021 10:05, Qi Liu wrote:

PCIe PMU Root Complex Integrated End Point(RCiEP) device is supported
to sample bandwidth, latency, buffer occupation etc.

Each PMU RCiEP device monitors multiple Root Ports, and each RCiEP is
registered as a PMU in /sys/bus/event_source/devices, so users can
select target PMU, and use filter to do further sets.

Filtering options contains:
event    - select the event.
subevent - select the subevent.
port - select target Root Ports. Information of Root Ports
    are shown under sysfs.
bdf  - select requester_id of target EP device.
trig_len - set trigger condition for starting event statistics.
trigger_mode - set trigger mode. 0 means starting to statistic when
    bigger than trigger condition, and 1 means smaller.
thr_len  - set threshold for statistics.
thr_mode - set threshold mode. 0 means count when bigger than
    threshold, and 1 means smaller.

Signed-off-by: Qi Liu 
---
  MAINTAINERS    |    6 +
  drivers/perf/Kconfig   |    2 +
  drivers/perf/Makefile  |    1 +
  drivers/perf/pci/Kconfig   |   16 +
  drivers/perf/pci/Makefile  |    2 +
  drivers/perf/pci/hisilicon/Makefile    |    5 +
  drivers/perf/pci/hisilicon/hisi_pcie_pmu.c | 1011 


  include/linux/cpuhotplug.h |    1 +
  8 files changed, 1044 insertions(+)
  create mode 100644 drivers/perf/pci/Kconfig
  create mode 100644 drivers/perf/pci/Makefile
  create mode 100644 drivers/perf/pci/hisilicon/Makefile
  create mode 100644 drivers/perf/pci/hisilicon/hisi_pcie_pmu.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 3353de0..46c7861 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8023,6 +8023,12 @@ W:    http://www.hisilicon.com
  F:    Documentation/admin-guide/perf/hisi-pmu.rst
  F:    drivers/perf/hisilicon
+HISILICON PCIE PMU DRIVER
+M:    Qi Liu 
+S:    Maintained
+F:    Documentation/admin-guide/perf/hisi-pcie-pmu.rst


nit: this does not exist yet...


thanks, I'll move this add-maintainer-part to the second patch.

+F:    drivers/perf/pci/hisilicon/hisi_pcie_pmu.c
+
  HISILICON QM AND ZIP Controller DRIVER
  M:    Zhou Wang 
  L:    linux-cry...@vger.kernel.org
diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
index 3075cf1..99d4760 100644
--- a/drivers/perf/Kconfig
+++ b/drivers/perf/Kconfig
@@ -139,4 +139,6 @@ config ARM_DMC620_PMU
  source "drivers/perf/hisilicon/Kconfig"
+source "drivers/perf/pci/Kconfig"
+
  endmenu
diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile
index 5260b11..1208c08 100644
--- a/drivers/perf/Makefile
+++ b/drivers/perf/Makefile
@@ -14,3 +14,4 @@ obj-$(CONFIG_THUNDERX2_PMU) += thunderx2_pmu.o
  obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
  obj-$(CONFIG_ARM_SPE_PMU) += arm_spe_pmu.o
  obj-$(CONFIG_ARM_DMC620_PMU) += arm_dmc620_pmu.o
+obj-y += pci/
diff --git a/drivers/perf/pci/Kconfig b/drivers/perf/pci/Kconfig
new file mode 100644
index 000..a119486
--- /dev/null
+++ b/drivers/perf/pci/Kconfig
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# PCIe Performance Monitor Drivers
+#
+menu "PCIe Performance Monitor"
+
+config HISI_PCIE_PMU
+    tristate "HiSilicon PCIE PERF PMU"
+    depends on ARM64 && PCI && HISI_PMU


What from HISI_PMU is needed? I couldn't find anything here
The event_sysfs_show() and format_sysfs_show() function of 
hisi_uncore_pmu.h can be reused in hisi_pcie_pmu.c, So I add path in 
Makefile and include "hisi_uncore_pmu.h".





+    help
+  Provide support for HiSilicon PCIe performance monitoring unit 
(PMU)

+  RCiEP devices.
+  Adds the PCIe PMU into perf events system for monitoring latency,
+  bandwidth etc.
+
+endmenu
diff --git a/drivers/perf/pci/Makefile b/drivers/perf/pci/Makefile
new file mode 100644
index 000..a56b1a9
--- /dev/null
+++ b/drivers/perf/pci/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += hisilicon/
diff --git a/drivers/perf/pci/hisilicon/Makefile 
b/drivers/perf/pci/hisilicon/Makefile

new file mode 100644
index 000..6f99f52
--- /dev/null
+++ b/drivers/perf/pci/hisilicon/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+ccflags-y :=  -I $(srctree)/drivers/perf/hisilicon
+
+obj-$(CONFIG_HISI_PCIE_PMU) += hisi_pcie_pmu.o
diff --git a/drivers/perf/pci/hisilicon/hisi_pcie_pmu.c 
b/drivers/perf/pci/hisilicon/hisi_pcie_pmu.c

new file mode 100644
index 000..ac0e444
--- /dev/null
+++ b/drivers/perf/pci/hisilicon/hisi_pcie_pmu.c
@@ -0,0 +1,1011 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * This driver adds support for PCIe PMU RCiEP device. Related
+ * perf events are bandwidth, bandwidth utilization, latency
+ * etc.
+ *
+ * Copyright (C) 2021 HiSilicon Limited
+ * Author: Qi Liu
+ */
+#include 
+#include 
+#include 
+#include 

Re: linux-next: build warnings after merge of the arm-perf tree

2021-03-29 Thread liuqi (BA)




On 2021/3/29 16:47, Will Deacon wrote:

On Fri, Mar 26, 2021 at 05:07:41PM +0800, Shaokun Zhang wrote:

Apologies for the mistake.

Will, shall I send a new version v5 to fix this issue or other?


Please send additional patches on top now that these are queued.

Thanks,

Will

.

We'll send a new patch to fix these warnings today, apologies for the 
mistake again.


Thanks,
Qi



Re: [PATCH] coresight: core: Fix typo in coresight-core.c

2021-03-22 Thread liuqi (BA)




On 2021/3/22 22:38, Suzuki K Poulose wrote:

On 22/03/2021 13:11, Qi Liu wrote:

Fix up one typo: compoment->component.

Fixes: 8e264c52e1da  ("coresight: core: Allow the coresight core 
driver to be built as a module")

Signed-off-by: Qi Liu 


Thanks for the patch. I will queue this.

.

Hi Suzuki,

Randy pointed out it should be "components" here, so I'll send a v2 with 
this fixed.

Thanks,
Qi



Re: [PATCH] coresight: core: Fix typo in coresight-core.c

2021-03-22 Thread liuqi (BA)




On 2021/3/23 0:55, Randy Dunlap wrote:

On 3/22/21 7:38 AM, Suzuki K Poulose wrote:

On 22/03/2021 13:11, Qi Liu wrote:

Fix up one typo: compoment->component.

Fixes: 8e264c52e1da  ("coresight: core: Allow the coresight core driver to be built 
as a module")
Signed-off-by: Qi Liu 


Thanks for the patch. I will queue this.


should be "both components"


Thanks,will fix it next version.

Qi



Re: [Linuxarm] Re: [PATCH 2/3] drivers/perf: convert sysfs scnprintf family to sysfs_emit_at

2021-03-18 Thread liuqi (BA)




On 2021/3/17 22:57, Joe Perches wrote:

On Wed, 2021-03-17 at 17:41 +0800, Qi Liu wrote:

Use the generic sysfs_emit_at() function take place of scnprintf()

[]

diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c

[]

@@ -328,41 +328,37 @@ static ssize_t arm_ccn_pmu_event_show(struct device *dev,
    struct arm_ccn_pmu_event, attr);
    ssize_t res;
  


-   res = scnprintf(buf, PAGE_SIZE, "type=0x%x", event->type);
+   res = sysfs_emit(buf, "type=0x%x", event->type);
    if (event->event)
-   res += scnprintf(buf + res, PAGE_SIZE - res, ",event=0x%x",
+   res += sysfs_emit_at(buf + res, res, ",event=0x%x",
    event->event);


sysfs_emit_at should always use buf, not buf + offset.
res should be int and is the offset from buf for the output

so the form should be similar to

int len;

len = sysfs_emit(buf, "type=0x%x", event->type);
if (event->event) {
len += sysfs_emit_at(buf, len, ",event=0x%x", event->event);

etc...


Hi Joe,

I'll fix the use of sysfs_emit_at in next version, thanks.
But I think it's better to keep the res as ssize_t, as the return value 
of this function is ssize_t.


Thanks,

Qi


___
Linuxarm mailing list -- linux...@openeuler.org
To unsubscribe send an email to linuxarm-le...@openeuler.org





Re: [PATCH v4 4/5] perf stat: Enable iostat mode for x86 platforms

2021-03-10 Thread liuqi (BA)




On 2021/3/11 0:19, Alexander Antonov wrote:


On 3/9/2021 10:51 AM, liuqi (BA) wrote:

Hi Alexander,

On 2021/2/3 21:58, Alexander Antonov wrote:

This functionality is based on recently introduced sysfs attributes
for Intel® Xeon® Scalable processor family (code name Skylake-SP):
Commit bb42b3d39781 ("perf/x86/intel/uncore: Expose an Uncore unit to
IIO PMON mapping")

Mode is intended to provide four I/O performance metrics in MB per each
PCIe root port:
  - Inbound Read: I/O devices below root port read from the host memory
  - Inbound Write: I/O devices below root port write to the host memory
  - Outbound Read: CPU reads from I/O devices below root port
  - Outbound Write: CPU writes to I/O devices below root port

Each metric requiries only one uncore event which increments at every 4B
transfer in corresponding direction. The formulas to compute metrics
are generic:
 #EventCount * 4B / (1024 * 1024)

Signed-off-by: Alexander Antonov
---
  tools/perf/Documentation/perf-iostat.txt |  88 ++
  tools/perf/Makefile.perf |   5 +-
  tools/perf/arch/x86/util/Build   |   1 +
  tools/perf/arch/x86/util/iostat.c    | 345 +++
  tools/perf/command-list.txt  |   1 +
  tools/perf/perf-iostat.sh    |  12 +
  6 files changed, 451 insertions(+), 1 deletion(-)
  create mode 100644 tools/perf/Documentation/perf-iostat.txt
  create mode 100644 tools/perf/perf-iostat.sh

diff --git a/tools/perf/Documentation/perf-iostat.txt 
b/tools/perf/Documentation/perf-iostat.txt

new file mode 100644
index ..165176944031
--- /dev/null
+++ b/tools/perf/Documentation/perf-iostat.txt
@@ -0,0 +1,88 @@
+perf-iostat(1)
+===
+
+NAME
+
+perf-iostat - Show I/O performance metrics
+
+SYNOPSIS
+
+[verse]
+'perf iostat' list
+'perf iostat'  --  []
+
+DESCRIPTION
+---
+Mode is intended to provide four I/O performance metrics per each 
PCIe root port:

+
+- Inbound Read   - I/O devices below root port read from the host 
memory, in MB

+
+- Inbound Write  - I/O devices below root port write to the host 
memory, in MB

+
+- Outbound Read  - CPU reads from I/O devices below root port, in MB
+
+- Outbound Write - CPU writes to I/O devices below root port, in MB
+
+OPTIONS
+---
+...::
+    Any command you can specify in a shell.
+
+list::
+    List all PCIe root ports.


I noticed that "iostat" commond and cmd_iostat() callback function is 
not registered in cmd_struct in perf.c. So I think "perf iostat list" 
perhaps can not work properly.


I also test this patchset on x86 platform, and here is the log:

root@ubuntu:/home/lq# ./perf iostat list
perf: 'iostat' is not a perf-command. See 'perf --help'.
root@ubuntu:/home/lq# ./perf stat --iostat
^C
 Performance counter stats for 'system wide':

   port Inbound Read(MB)    Inbound Write(MB) Outbound 
Read(MB)   Outbound Write(MB)

:00    0 0    0  0
:80    0 0    0  0
:17    0 0    0  0
:85    0 0    0  0
:3a    0 0    0  0
:ae    0 0    0  0
:5d    0 0    0  0
:d7    0 0    0  0

   0.611303832 seconds time elapsed


root@ubuntu:/home/lq# ./perf stat --iostat=:17
^C
 Performance counter stats for 'system wide':

   port Inbound Read(MB)    Inbound Write(MB) Outbound 
Read(MB)   Outbound Write(MB)

:17    0 0    0  0

   0.521317572 seconds time elapsed

So how does following perf iostat list work, did I miss something?

Thanks,
Qi


Hello,

The 'iostat' mode uses aliases mechanism in perf same as 'perf archive' and
in this case you don't need to add function callback into cmd_struct.
For example, the command 'perf iostat list' will be converted to
'perf stat --iostat=list'.

After building the perf tool you should have two shell scripts in 
tools/perf

directory and one of them is executable, for example:
# make -C tools/perf
# ls -l tools/perf/perf-iostat*
-rwxr-xr-x 1 root root 290 Mar 10 18:17 perf-iostat
-rw-r--r-- 1 root root 290 Feb  3 15:14 perf-iostat.sh

It should be possible to run 'perf iostat' from build directory:
# cd tools/perf
# ./perf iostat list
S0-uncore_iio_0<:00>
S1-uncore_iio_0<:80>
S0-uncore_iio_1<:17>
S1-uncore_iio_1<:85>
S0-uncore_iio_2<:3a>
S1-uncore_iio_2<:ae>
S0-uncore_iio_3<:5d>
S1-uncore_iio_3<:d7>

Also you can copy 'perf-iostat' to ~/libexec/perf-core/ or just run 
'make install'


# make install
# cp perf /usr/bin/
# ls -lh ~/libexec/perf-

Re: [PATCH v4 4/5] perf stat: Enable iostat mode for x86 platforms

2021-03-08 Thread liuqi (BA)

Hi Alexander,

On 2021/2/3 21:58, Alexander Antonov wrote:

This functionality is based on recently introduced sysfs attributes
for Intel® Xeon® Scalable processor family (code name Skylake-SP):
Commit bb42b3d39781 ("perf/x86/intel/uncore: Expose an Uncore unit to
IIO PMON mapping")

Mode is intended to provide four I/O performance metrics in MB per each
PCIe root port:
  - Inbound Read: I/O devices below root port read from the host memory
  - Inbound Write: I/O devices below root port write to the host memory
  - Outbound Read: CPU reads from I/O devices below root port
  - Outbound Write: CPU writes to I/O devices below root port

Each metric requiries only one uncore event which increments at every 4B
transfer in corresponding direction. The formulas to compute metrics
are generic:
 #EventCount * 4B / (1024 * 1024)

Signed-off-by: Alexander Antonov
---
  tools/perf/Documentation/perf-iostat.txt |  88 ++
  tools/perf/Makefile.perf |   5 +-
  tools/perf/arch/x86/util/Build   |   1 +
  tools/perf/arch/x86/util/iostat.c| 345 +++
  tools/perf/command-list.txt  |   1 +
  tools/perf/perf-iostat.sh|  12 +
  6 files changed, 451 insertions(+), 1 deletion(-)
  create mode 100644 tools/perf/Documentation/perf-iostat.txt
  create mode 100644 tools/perf/perf-iostat.sh

diff --git a/tools/perf/Documentation/perf-iostat.txt 
b/tools/perf/Documentation/perf-iostat.txt
new file mode 100644
index ..165176944031
--- /dev/null
+++ b/tools/perf/Documentation/perf-iostat.txt
@@ -0,0 +1,88 @@
+perf-iostat(1)
+===
+
+NAME
+
+perf-iostat - Show I/O performance metrics
+
+SYNOPSIS
+
+[verse]
+'perf iostat' list
+'perf iostat'  --  []
+
+DESCRIPTION
+---
+Mode is intended to provide four I/O performance metrics per each PCIe root 
port:
+
+- Inbound Read   - I/O devices below root port read from the host memory, in MB
+
+- Inbound Write  - I/O devices below root port write to the host memory, in MB
+
+- Outbound Read  - CPU reads from I/O devices below root port, in MB
+
+- Outbound Write - CPU writes to I/O devices below root port, in MB
+
+OPTIONS
+---
+...::
+   Any command you can specify in a shell.
+
+list::
+   List all PCIe root ports.


I noticed that "iostat" commond and cmd_iostat() callback function is 
not registered in cmd_struct in perf.c. So I think "perf iostat list" 
perhaps can not work properly.


I also test this patchset on x86 platform, and here is the log:

root@ubuntu:/home/lq# ./perf iostat list
perf: 'iostat' is not a perf-command. See 'perf --help'.
root@ubuntu:/home/lq# ./perf stat --iostat
^C
 Performance counter stats for 'system wide':

   port Inbound Read(MB)Inbound Write(MB)Outbound 
Read(MB)   Outbound Write(MB)
:00000 
 0
:80000 
 0
:17000 
 0
:85000 
 0
:3a000 
 0
:ae000 
 0
:5d000 
 0
:d7000 
 0


   0.611303832 seconds time elapsed


root@ubuntu:/home/lq# ./perf stat --iostat=:17
^C
 Performance counter stats for 'system wide':

   port Inbound Read(MB)Inbound Write(MB)Outbound 
Read(MB)   Outbound Write(MB)
:17000 
 0


   0.521317572 seconds time elapsed

So how does following perf iostat list work, did I miss something?

Thanks,
Qi


+
+::
+   Select the root ports for monitoring. Comma-separated list is supported.
+
+EXAMPLES
+
+
+1. List all PCIe root ports (example for 2-S platform):
+
+   $ perf iostat list
+   S0-uncore_iio_0<:00>
+   S1-uncore_iio_0<:80>
+   S0-uncore_iio_1<:17>
+   S1-uncore_iio_1<:85>
+   S0-uncore_iio_2<:3a>
+   S1-uncore_iio_2<:ae>
+   S0-uncore_iio_3<:5d>
+   S1-uncore_iio_3<:d7>




Re: [PATCH] coresight: Remove duplicate header files of coresight drivers

2021-02-01 Thread liuqi (BA)




On 2021/2/2 1:05, Mathieu Poirier wrote:

Good day,

On Mon, Feb 01, 2021 at 09:02:44PM +0800, Qi Liu wrote:

Remove duplicate included header files, as coresight-priv.h is included in
these coresight drivers.

Signed-off-by: Qi Liu 
---
  drivers/hwtracing/coresight/coresight-catu.c | 2 --
  drivers/hwtracing/coresight/coresight-core.c | 3 ---
  drivers/hwtracing/coresight/coresight-cpu-debug.c| 3 ---
  drivers/hwtracing/coresight/coresight-cti-core.c | 3 ---
  drivers/hwtracing/coresight/coresight-cti-platform.c | 1 -
  drivers/hwtracing/coresight/coresight-cti.h  | 1 -
  drivers/hwtracing/coresight/coresight-etb10.c| 4 
  drivers/hwtracing/coresight/coresight-etm-perf.c | 1 -
  drivers/hwtracing/coresight/coresight-etm3x-sysfs.c  | 1 -
  drivers/hwtracing/coresight/coresight-etm4x-core.c   | 5 -
  drivers/hwtracing/coresight/coresight-etm4x-sysfs.c  | 1 -
  drivers/hwtracing/coresight/coresight-funnel.c   | 3 ---
  drivers/hwtracing/coresight/coresight-platform.c | 2 --
  drivers/hwtracing/coresight/coresight-replicator.c   | 3 ---
  drivers/hwtracing/coresight/coresight-stm.c  | 3 ---
  drivers/hwtracing/coresight/coresight-tmc-core.c | 3 ---
  drivers/hwtracing/coresight/coresight-tmc-etf.c  | 1 -
  drivers/hwtracing/coresight/coresight-tmc-etr.c  | 1 -
  drivers/hwtracing/coresight/coresight-tpiu.c | 4 
  19 files changed, 45 deletions(-)


The idea is to make sure every file stands on its own without dependencies on
other header files.  Otherwise it is difficult and expensive to move files
around or make changes to any header file.   As such I will not move forward
with this set.

Thanks,
Mathieu


Hi Mathieu,

got it, thanks :).

Qi




diff --git a/drivers/hwtracing/coresight/coresight-catu.c 
b/drivers/hwtracing/coresight/coresight-catu.c
index a61313f..fcc0367 100644
--- a/drivers/hwtracing/coresight/coresight-catu.c
+++ b/drivers/hwtracing/coresight/coresight-catu.c
@@ -7,10 +7,8 @@
   * Author: Suzuki K Poulose 
   */

-#include 
  #include 
  #include 
-#include 
  #include 
  #include 

diff --git a/drivers/hwtracing/coresight/coresight-core.c 
b/drivers/hwtracing/coresight/coresight-core.c
index 4ba801d..5fb8b12 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -7,17 +7,14 @@
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 
-#include 

  #include "coresight-etm-perf.h"
  #include "coresight-priv.h"
diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c 
b/drivers/hwtracing/coresight/coresight-cpu-debug.c
index e1d2324..f8df512 100644
--- a/drivers/hwtracing/coresight/coresight-cpu-debug.c
+++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c
@@ -4,15 +4,12 @@
   *
   * Author: Leo Yan 
   */
-#include 
-#include 
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 
  #include 
diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c 
b/drivers/hwtracing/coresight/coresight-cti-core.c
index 61dbc1a..ed7ab82 100644
--- a/drivers/hwtracing/coresight/coresight-cti-core.c
+++ b/drivers/hwtracing/coresight/coresight-cti-core.c
@@ -4,18 +4,15 @@
   * Author: Mike Leach 
   */

-#include 
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 

diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c 
b/drivers/hwtracing/coresight/coresight-cti-platform.c
index ccef04f..60b0580 100644
--- a/drivers/hwtracing/coresight/coresight-cti-platform.c
+++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
@@ -2,7 +2,6 @@
  /*
   * Copyright (c) 2019, The Linaro Limited. All rights reserved.
   */
-#include 
  #include 
  #include 
  #include 
diff --git a/drivers/hwtracing/coresight/coresight-cti.h 
b/drivers/hwtracing/coresight/coresight-cti.h
index acf7b54..0a3b313 100644
--- a/drivers/hwtracing/coresight/coresight-cti.h
+++ b/drivers/hwtracing/coresight/coresight-cti.h
@@ -7,7 +7,6 @@
  #ifndef _CORESIGHT_CORESIGHT_CTI_H
  #define _CORESIGHT_CORESIGHT_CTI_H

-#include 
  #include 
  #include 
  #include 
diff --git a/drivers/hwtracing/coresight/coresight-etb10.c 
b/drivers/hwtracing/coresight/coresight-etb10.c
index 0cf6f0b..8d5bc04 100644
--- a/drivers/hwtracing/coresight/coresight-etb10.c
+++ b/drivers/hwtracing/coresight/coresight-etb10.c
@@ -10,17 +10,13 @@
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
-#include 
  #include 
-#include 
-#include 
  #include 
  #include 
  #include 
diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c 
b/drivers/hwtracing/coresight/coresight-etm-perf.c
index bdc34ca..01aba63 100644
--- a/drivers/hwtracing/coresight/coresight-etm-perf.c
+++