Skip to contentSkip to conversation

perf/dwc_pcie: Fix the swapped event numbers as well as the documentation

PATCH Applied Ilkka Koskinen 3 participants 7 messages Dec 5, 2024 – Dec 9, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover perf/dwc_pcie: Fix the swapped event numbers as well as the documentation

According to the versions of Designware Cores PCI Express Controller Databook I found, the eventid for "L1 aux" is 0x08 and "TX L0s and RX L0S" is 0x09.

Shuai and Jing, could you verify that your document matches ours and the events are indeed swapped in the driver at the moment?

Cheers, Ilkka

Ilkka Koskinen (2):
perf/dwc_pcie: Fix the event numbers
Documentation: dwc_pcie_pmu: Fix the mnemonics and eventid

 Documentation/admin-guide/perf/dwc_pcie_pmu.rst | 6 +++---
 drivers/perf/dwc_pcie_pmu.c                     | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.47.0
#1 lore raw

PATCH 1/2 perf/dwc_pcie: Fix the event numbers

According to Databook, L1 aux is event number 0x08 and TX L0s and RX L0S is 0x09. Fix the event numbers for the two events.

---
 drivers/perf/dwc_pcie_pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/perf/dwc_pcie_pmu.c +2 -2
index 9cbea9675e21..890cf3bb43a2 100644
@@ -199,8 +199,8 @@ static struct attribute *dwc_pcie_pmu_time_event_attrs[] = {
 	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_1, 0x05),
 	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_2, 0x06),
 	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(CFG_RCVRY, 0x07),
-	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(TX_RX_L0S, 0x08),
-	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_AUX, 0x09),
+	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_AUX, 0x08),
+	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(TX_RX_L0S, 0x09),
 
 	/* Group #1 */
 	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(tx_pcie_tlp_data_payload, 0x20),
Signature · 1 line
2.47.0
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] perf/dwc_pcie: Fix the event numbers

Quoted 14 lines · Ilkka Koskinen

According to Databook, L1 aux is event number 0x08 and TX L0s and RX L0S is 0x09. Fix the event numbers for the two events.

---
  drivers/perf/dwc_pcie_pmu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/perf/dwc_pcie_pmu.c +0 -0
index 9cbea9675e21..890cf3bb43a2 100644

drivers/perf/dwc_pcie_pmu.c static struct attribute *dwc_pcie_pmu_time_event_attrs[] = { · line 206

Quoted 10 lines
drivers/perf/dwc_pcie_pmu.c +2 -2
@@ -199,8 +199,8 @@ static struct attribute *dwc_pcie_pmu_time_event_attrs[] = {
  	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_1, 0x05),
  	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_2, 0x06),
  	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(CFG_RCVRY, 0x07),
-	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(TX_RX_L0S, 0x08),
-	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_AUX, 0x09),
+	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(L1_AUX, 0x08),
+	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(TX_RX_L0S, 0x09),
 
  	/* Group #1 */
  	DWC_PCIE_PMU_TIME_BASE_EVENT_ATTR(tx_pcie_tlp_data_payload, 0x20),

LGTM.

Thanks.

Best Regards,
Shuai

#3 lore raw

PATCH 2/2 Documentation: dwc_pcie_pmu: Fix the mnemonics and eventid

In reply to Ilkka Koskinen

Fix the event id and type in the example. In addition, the recent fix, which addressed the mnemonics with mixed case, didn't fix the document. Match the names with the driver.

---
 Documentation/admin-guide/perf/dwc_pcie_pmu.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/admin-guide/perf/dwc_pcie_pmu.rst +3 -3
index 39b8e1fdd0cd..cb376f335f40 100644
@@ -60,7 +60,7 @@ description of available events and configuration options in sysfs, see
 The "format" directory describes format of the config fields of the
 perf_event_attr structure. The "events" directory provides configuration
 templates for all documented events.  For example,
-"Rx_PCIe_TLP_Data_Payload" is an equivalent of "eventid=0x22,type=0x1".
+"rx_pcie_tlp_data_payload" is an equivalent of "eventid=0x21,type=0x0".
 
 The "perf list" command shall list the available events from sysfs, e.g.::
 
@@ -79,8 +79,8 @@ Example usage of counting PCIe RX TLP data payload (Units of bytes)::
 
 The average RX/TX bandwidth can be calculated using the following formula:
 
-    PCIe RX Bandwidth = Rx_PCIe_TLP_Data_Payload / Measure_Time_Window
-    PCIe TX Bandwidth = Tx_PCIe_TLP_Data_Payload / Measure_Time_Window
+    PCIe RX Bandwidth = rx_pcie_tlp_data_payload / Measure_Time_Window
+    PCIe TX Bandwidth = tx_pcie_tlp_data_payload / Measure_Time_Window
 
 Lane Event Usage
 -------------------------------
Signature · 1 line
2.47.0
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] Documentation: dwc_pcie_pmu: Fix the mnemonics and eventid

Quoted 23 lines · Ilkka Koskinen

Fix the event id and type in the example. In addition, the recent fix, which addressed the mnemonics with mixed case, didn't fix the document. Match the names with the driver.

---
  Documentation/admin-guide/perf/dwc_pcie_pmu.rst | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/admin-guide/perf/dwc_pcie_pmu.rst +1 -1
index 39b8e1fdd0cd..cb376f335f40 100644
@@ -60,7 +60,7 @@ description of available events and configuration options in sysfs, see
  The "format" directory describes format of the config fields of the
  perf_event_attr structure. The "events" directory provides configuration
  templates for all documented events.  For example,
-"Rx_PCIe_TLP_Data_Payload" is an equivalent of "eventid=0x22,type=0x1".
+"rx_pcie_tlp_data_payload" is an equivalent of "eventid=0x21,type=0x0".
 
  The "perf list" command shall list the available events from sysfs, e.g.::
 

Documentation/admin-guide/perf/dwc_pcie_pmu.rst Example usage of counting PCIe RX TLP data payload (Units of bytes):: · line 86

Quoted 10 lines
Documentation/admin-guide/perf/dwc_pcie_pmu.rst +2 -2
@@ -79,8 +79,8 @@ Example usage of counting PCIe RX TLP data payload (Units of bytes)::
 
  The average RX/TX bandwidth can be calculated using the following formula:
 
-    PCIe RX Bandwidth = Rx_PCIe_TLP_Data_Payload / Measure_Time_Window
-    PCIe TX Bandwidth = Tx_PCIe_TLP_Data_Payload / Measure_Time_Window
+    PCIe RX Bandwidth = rx_pcie_tlp_data_payload / Measure_Time_Window
+    PCIe TX Bandwidth = tx_pcie_tlp_data_payload / Measure_Time_Window
 
  Lane Event Usage
  -------------------------------

LGTM.

Thanks.

Best Regards,
Shuai

maintainer
#5 lore raw
In reply to Ilkka Koskinen
Quoted 5 lines · Ilkka Koskinen

According to the versions of Designware Cores PCI Express Controller Databook I found, the eventid for "L1 aux" is 0x08 and "TX L0s and RX L0S" is 0x09.

Shuai and Jing, could you verify that your document matches ours and the events are indeed swapped in the driver at the moment?

Yep, it is a typo.

Quoted 2 lines

Cheers, Ilkka

Thanks for the fixes :)

Best Regards,
Shuai

Quoted 11 lines

Ilkka Koskinen (2):
perf/dwc_pcie: Fix the event numbers
Documentation: dwc_pcie_pmu: Fix the mnemonics and eventid

  Documentation/admin-guide/perf/dwc_pcie_pmu.rst | 6 +++---
  drivers/perf/dwc_pcie_pmu.c                     | 4 ++--
  2 files changed, 5 insertions(+), 5 deletions(-)
maintainer Applied
#6 lore raw
In reply to Ilkka Koskinen
Quoted 9 lines · Ilkka Koskinen

According to the versions of Designware Cores PCI Express Controller Databook I found, the eventid for "L1 aux" is 0x08 and "TX L0s and RX L0S" is 0x09.

Shuai and Jing, could you verify that your document matches ours and the events are indeed swapped in the driver at the moment?

Cheers, Ilkka

[...]

Applied to will (for-next/perf), thanks!

[1/2] perf/dwc_pcie: Fix the event numbers

      https://git.kernel.org/will/c/e64c22cc2e61
[2/2] Documentation: dwc_pcie_pmu: Fix the mnemonics and eventid
      https://git.kernel.org/will/c/8632306e093c

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev