perf: Fujitsu: Add Uncore MAC/PCI PMU driver
Subsystems (2)
v5 cover perf: Fujitsu: Add Uncore MAC/PCI PMU driver
This adds two new dynamic PMUs to the Perf Events framework to program and control the Uncore MAC/PCI PMUs in Fujitsu chips.
These drivers were created with reference to drivers/perf/qcom_l3_pmu.c.
These drivers export formatting and event information to sysfs so they can be used by the perf user space tools with the syntaxes:
perf stat -e mac_iod0_mac0_ch0/ea-mac/ ls
perf stat -e mac_iod0_mac0_ch0/event=0x80/ ls
perf stat -e pci_iod0_pci0/ea-pci/ ls
perf stat -e pci_iod0_pci0/event=0x80/ ls
FUJITSU-MONAKA PMU Events Specification v1.1 URL:
https://github.com/fujitsu/FUJITSU-MONAKA
Changes in v5:
- Update PMU events for FUJITSU-MONAKA to latest(v1.1) spec.
The changed events are as follows:
- Removed events:
ea-memory-mac-read
ea-memory-mac-pwrite
- Description changed events:
read-count-return
read-count-return-pftgt-hit
read-count-return-pftgt-miss
ea-mac
ea-memory
ea-ha
ea-pci
- Modify the code as suggested. (Jonathan Cameron)
- Added include mod_devicetable.h.
- EA events that share the same description as MAC events have been removed.
These events will remain in the specification, but will be removed from the code.
These events will be supported in future enhancements as the specification changes.
- Changed MAC events with the same description to different description.
- Changed some programming styles as suggested.
- Link to v4:https://lore.kernel.org/all/[email protected]/
Koichi Okuno (2):
perf: Fujitsu: Add the Uncore MAC PMU driver
perf: Fujitsu: Add the Uncore PCI PMU driver
.../admin-guide/perf/fujitsu_mac_pmu.rst | 73 +++ .../admin-guide/perf/fujitsu_pci_pmu.rst | 50 ++ Documentation/admin-guide/perf/index.rst | 2 + drivers/perf/Kconfig | 18 + drivers/perf/Makefile | 2 + drivers/perf/fujitsu_mac_pmu.c | 569 ++++++++++++++++++ drivers/perf/fujitsu_pci_pmu.c | 553 +++++++++++++++++ 7 files changed, 1267 insertions(+) create mode 100644 Documentation/admin-guide/perf/fujitsu_mac_pmu.rst create mode 100644 Documentation/admin-guide/perf/fujitsu_pci_pmu.rst create mode 100644 drivers/perf/fujitsu_mac_pmu.c create mode 100644 drivers/perf/fujitsu_pci_pmu.c
Signature · 1 line
2.43.0
PATCH v5 1/2 perf: Fujitsu: Add the Uncore MAC PMU driver
This adds two new dynamic PMUs to the Perf Events framework to program and control the Uncore MAC PMUs in Fujitsu chips.
These drivers were created with reference to drivers/perf/qcom_l3_pmu.c.
These drivers export formatting and event information to sysfs so they can be used by the perf user space tools with the syntaxes:
perf stat -e mac_iod0_mac0_ch0/ea-mac/ ls
perf stat -e mac_iod0_mac0_ch0/event=0x80/ ls
FUJITSU-MONAKA PMU Events Specification v1.1 URL:
https://github.com/fujitsu/FUJITSU-MONAKA
--- .../admin-guide/perf/fujitsu_mac_pmu.rst | 73 +++ Documentation/admin-guide/perf/index.rst | 1 + drivers/perf/Kconfig | 9 + drivers/perf/Makefile | 1 + drivers/perf/fujitsu_mac_pmu.c | 569 ++++++++++++++++++ 5 files changed, 653 insertions(+) create mode 100644 Documentation/admin-guide/perf/fujitsu_mac_pmu.rst create mode 100644 drivers/perf/fujitsu_mac_pmu.c
Documentation/admin-guide/perf/fujitsu_mac_pmu.rst new file +73 -0
@@ -0,0 +1,73 @@ +==================================================== +Fujitsu Uncore MAC Performance Monitoring Unit (PMU) +==================================================== + +This driver supports the Uncore MAC PMUs found in Fujitsu chips. +Each MAC PMU on these chips is exposed as a uncore perf PMU with device name +mac_iod<iod>_mac<mac>_ch<ch>. + +The driver provides a description of its available events and configuration +options in sysfs, see /sys/bus/event_sources/devices/mac_iod<iod>_mac<mac>_ch<ch>/. +This driver exports: +- formats, used by perf user space and other tools to configure events +- events, used by perf user space and other tools to create events + symbolically, e.g.: + perf stat -a -e mac_iod0_mac0_ch0/event=0x21/ ls +- cpumask, used by perf user space and other tools to know on which CPUs + to open the events + +This driver supports the following events: +- cycles + This event counts MAC cycles at MAC frequency. +- read-count + This event counts the number of read requests to MAC. +- read-count-request + This event counts the number of read requests including retry to MAC. +- read-count-return + This event counts the number of responses to read requests to MAC. +- read-count-request-pftgt + This event counts the number of read requests including retry with PFTGT + flag. +- read-count-request-normal + This event counts the number of read requests including retry without PFTGT + flag. +- read-count-return-pftgt-hit + This event counts the number of responses to read requests which hit the + PFTGT buffer. +- read-count-return-pftgt-miss + This event counts the number of responses to read requests which miss the + PFTGT buffer. +- read-wait + This event counts outstanding read requests issued by DDR memory controller + per cycle. +- write-count + This event counts the number of write requests to MAC (including zero write, + full write, partial write, write cancel). +- write-count-write + This event counts the number of full write requests to MAC (not including + zero write). +- write-count-pwrite + This event counts the number of partial write requests to MAC. +- memory-read-count + This event counts the number of read requests from MAC to memory. +- memory-write-count + This event counts the number of full write requests from MAC to memory. +- memory-pwrite-count + This event counts the number of partial write requests from MAC to memory. +- ea-mac + This event counts energy consumption of MAC. +- ea-memory + This event counts energy consumption of memory. +- ea-memory-mac-write + This event counts the number of write requests from MAC to memory. +- ea-ha + This event counts energy consumption of HA. + + 'ea' is the abbreviation for 'Energy Analyzer'. + +Examples for use with perf:: + + perf stat -e mac_iod0_mac0_ch0/ea-mac/ ls + +Given that these are uncore PMUs the driver does not support sampling, therefore +"perf record" will not work. Per-task perf sessions are not supported.
Documentation/admin-guide/perf/index.rst +1 -0
@@ -29,3 +29,4 @@ Performance monitor support cxl ampere_cspmu mrvl-pem-pmu + fujitsu_mac_pmu
drivers/perf/Kconfig +9 -0
@@ -178,6 +178,15 @@ config FSL_IMX9_DDR_PMU can give information about memory throughput and other related events. +config FUJITSU_MAC_PMU + bool "Fujitsu Uncore MAC PMU" + depends on (ARM64 && (ACPI || COMPILE_TEST)) + help + Provides support for the Uncore MAC performance monitor unit (PMU) + in Fujitsu processors. + Adds the Uncore MAC PMU into the perf events subsystem for + monitoring Uncore MAC events. + config QCOM_L2_PMU bool "Qualcomm Technologies L2-cache PMU" depends on ARCH_QCOM && ARM64 && ACPI
drivers/perf/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_ARM_SMMU_V3_PMU) += arm_smmuv3_pmu.o obj-$(CONFIG_FSL_IMX8_DDR_PMU) += fsl_imx8_ddr_perf.o obj-$(CONFIG_FSL_IMX9_DDR_PMU) += fsl_imx9_ddr_perf.o obj-$(CONFIG_HISI_PMU) += hisilicon/ +obj-$(CONFIG_FUJITSU_MAC_PMU) += fujitsu_mac_pmu.o obj-$(CONFIG_QCOM_L2_PMU) += qcom_l2_pmu.o obj-$(CONFIG_QCOM_L3_PMU) += qcom_l3_pmu.o obj-$(CONFIG_RISCV_PMU) += riscv_pmu.o
drivers/perf/fujitsu_mac_pmu.c new file +569 -0
569 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v5 2/2 perf: Fujitsu: Add the Uncore PCI PMU driver
In reply to Koichi OkunoThis adds two new dynamic PMUs to the Perf Events framework to program and control the Uncore PCI PMUs in Fujitsu chips.
These drivers were created with reference to drivers/perf/qcom_l3_pmu.c.
These drivers export formatting and event information to sysfs so they can be used by the perf user space tools with the syntaxes:
perf stat -e pci_iod0_pci0/ea-pci/ ls
perf stat -e pci_iod0_pci0/event=0x80/ ls
FUJITSU-MONAKA PMU Events Specification v1.1 URL:
https://github.com/fujitsu/FUJITSU-MONAKA
--- .../admin-guide/perf/fujitsu_pci_pmu.rst | 50 ++ Documentation/admin-guide/perf/index.rst | 1 + drivers/perf/Kconfig | 9 + drivers/perf/Makefile | 1 + drivers/perf/fujitsu_pci_pmu.c | 553 ++++++++++++++++++ 5 files changed, 614 insertions(+) create mode 100644 Documentation/admin-guide/perf/fujitsu_pci_pmu.rst create mode 100644 drivers/perf/fujitsu_pci_pmu.c
Documentation/admin-guide/perf/fujitsu_pci_pmu.rst new file +50 -0
@@ -0,0 +1,50 @@ +==================================================== +Fujitsu Uncore PCI Performance Monitoring Unit (PMU) +==================================================== + +This driver supports the Uncore PCI PMUs found in Fujitsu chips. +Each PCI PMU on these chips is exposed as a uncore perf PMU with device name +pci_iod<iod>_pci<pci>. + +The driver provides a description of its available events and configuration +options in sysfs, see /sys/bus/event_sources/devices/pci_iod<iod>_pci<pci>/. +This driver exports: +- formats, used by perf user space and other tools to configure events +- events, used by perf user space and other tools to create events + symbolically, e.g.: + perf stat -a -e pci_iod0_pci0/event=0x24/ ls +- cpumask, used by perf user space and other tools to know on which CPUs + to open the events + +This driver supports the following events: +- pci-port0-cycles + This event counts PCI cycles at PCI frequency in port0. +- pci-port0-read-count + This event counts read transactions for data transfer in port0. +- pci-port0-read-count-bus + This event counts read transactions for bus usage in port0. +- pci-port0-write-count + This event counts write transactions for data transfer in port0. +- pci-port0-write-count-bus + This event counts write transactions for bus usage in port0. +- pci-port1-cycles + This event counts PCI cycles at PCI frequency in port1. +- pci-port1-read-count + This event counts read transactions for data transfer in port1. +- pci-port1-read-count-bus + This event counts read transactions for bus usage in port1. +- pci-port1-write-count + This event counts write transactions for data transfer in port1. +- pci-port1-write-count-bus + This event counts write transactions for bus usage in port1. +- ea-pci + This event counts energy consumption of PCI. + + 'ea' is the abbreviation for 'Energy Analyzer'. + +Examples for use with perf:: + + perf stat -e pci_iod0_pci0/ea-pci/ ls + +Given that these are uncore PMUs the driver does not support sampling, therefore +"perf record" will not work. Per-task perf sessions are not supported.
Documentation/admin-guide/perf/index.rst +1 -0
@@ -30,3 +30,4 @@ Performance monitor support ampere_cspmu mrvl-pem-pmu fujitsu_mac_pmu + fujitsu_pci_pmu
drivers/perf/Kconfig +9 -0
@@ -187,6 +187,15 @@ config FUJITSU_MAC_PMU Adds the Uncore MAC PMU into the perf events subsystem for monitoring Uncore MAC events. +config FUJITSU_PCI_PMU + bool "Fujitsu Uncore PCI PMU" + depends on (ARM64 && (ACPI || COMPILE_TEST)) + help + Provides support for the Uncore PCI performance monitor unit (PMU) + in Fujitsu processors. + Adds the Uncore PCI PMU into the perf events subsystem for + monitoring Uncore PCI events. + config QCOM_L2_PMU bool "Qualcomm Technologies L2-cache PMU" depends on ARCH_QCOM && ARM64 && ACPI
drivers/perf/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_FSL_IMX8_DDR_PMU) += fsl_imx8_ddr_perf.o obj-$(CONFIG_FSL_IMX9_DDR_PMU) += fsl_imx9_ddr_perf.o obj-$(CONFIG_HISI_PMU) += hisilicon/ obj-$(CONFIG_FUJITSU_MAC_PMU) += fujitsu_mac_pmu.o +obj-$(CONFIG_FUJITSU_PCI_PMU) += fujitsu_pci_pmu.o obj-$(CONFIG_QCOM_L2_PMU) += qcom_l2_pmu.o obj-$(CONFIG_QCOM_L3_PMU) += qcom_l3_pmu.o obj-$(CONFIG_RISCV_PMU) += riscv_pmu.o
drivers/perf/fujitsu_pci_pmu.c new file +553 -0
553 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH v5 2/2] perf: Fujitsu: Add the Uncore PCI PMU driver
Quoted 5 lines · Koichi Okuno
drivers/perf/fujitsu_pci_pmu.c new file +5
-0+ pcipmu->pmu = (struct pmu ) { + .parent = dev, + .task_ctx_nr = perf_invalid_context, + + .pmu_enable = fujitsu_pci__pmu_enable,
drivers/perf/fujitsu_pci_pmu.c line 490
Quoted 10 lines
drivers/perf/fujitsu_pci_pmu.c new file +10
-0+ .pmu_disable = fujitsu_pci__pmu_disable, + .event_init = fujitsu_pci__event_init, + .add = fujitsu_pci__event_add, + .del = fujitsu_pci__event_del, + .start = fujitsu_pci__event_start, + .stop = fujitsu_pci__event_stop, + .read = fujitsu_pci__event_read, + + .attr_groups = fujitsu_pci_pmu_attr_grps, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
Should these drivers not also have PERF_PMU_CAP_NO_INTERRUPT ? Per them being uncore they cannot generate samples.
Quoted 1 line
(quoted diff) +1
-0+ };
Mark Rutland
maintainerRe: [PATCH v5 2/2] perf: Fujitsu: Add the Uncore PCI PMU driver
Quoted 11 lines · Peter Zijlstra
Quoted 10 lines · Koichi Okuno
drivers/perf/fujitsu_pci_pmu.c new file +10
-0+ pcipmu->pmu = (struct pmu ) { + .parent = dev, + .task_ctx_nr = perf_invalid_context, + + .pmu_enable = fujitsu_pci__pmu_enable, + .pmu_disable = fujitsu_pci__pmu_disable, + .event_init = fujitsu_pci__event_init, + .add = fujitsu_pci__event_add, + .del = fujitsu_pci__event_del, + .start = fujitsu_pci__event_start,
Quoted 8 lines
drivers/perf/fujitsu_pci_pmu.c line 490
Quoted 5 lines
drivers/perf/fujitsu_pci_pmu.c new file +5
-0+ .stop = fujitsu_pci__event_stop, + .read = fujitsu_pci__event_read, + + .attr_groups = fujitsu_pci_pmu_attr_grps, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE,Should these drivers not also have
PERF_PMU_CAP_NO_INTERRUPT? Per them being uncore they cannot generate samples.
These PMUs actually have an interrupt, so that might be a bit confusing. That said, the counters seem to be 64-bit, so the interrupt doesn't seem practically necessary today.
Either way, the fujitsu_pci__event_init() function rejects sampling events, so it correctly rejects sampling events.
IMO, it'd be a bit nicer to do the inverse, and have the perf core reject sampling events by default for non-CPU PMUs.
Mark.
Re: [PATCH v5 2/2] perf: Fujitsu: Add the Uncore PCI PMU driver
Quoted 21 lines · Mark Rutland
Quoted 11 lines · Peter Zijlstra
Quoted 10 lines · Koichi Okuno
drivers/perf/fujitsu_pci_pmu.c new file +10
-0+ pcipmu->pmu = (struct pmu ) { + .parent = dev, + .task_ctx_nr = perf_invalid_context, + + .pmu_enable = fujitsu_pci__pmu_enable, + .pmu_disable = fujitsu_pci__pmu_disable, + .event_init = fujitsu_pci__event_init, + .add = fujitsu_pci__event_add, + .del = fujitsu_pci__event_del, + .start = fujitsu_pci__event_start,Quoted 8 lines
drivers/perf/fujitsu_pci_pmu.c line 490
Quoted 5 lines
drivers/perf/fujitsu_pci_pmu.c new file +5
-0+ .stop = fujitsu_pci__event_stop, + .read = fujitsu_pci__event_read, + + .attr_groups = fujitsu_pci_pmu_attr_grps, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE,Should these drivers not also have
PERF_PMU_CAP_NO_INTERRUPT? Per them being uncore they cannot generate samples.
Quoted 3 lines
These PMUs actually have an interrupt, so that might be a bit confusing. That said, the counters seem to be 64-bit, so the interrupt doesn't seem practically necessary today.
Yeah, I saw they had an interrupt. But them being uncore they must not sample, and NO_INTERRUPT means not being able to sample.
Naming urgh :-)
Quoted 5 lines
Either way, the
fujitsu_pci__event_init()function rejects sampling events, so it correctly rejects sampling events.IMO, it'd be a bit nicer to do the inverse, and have the perf core reject sampling events by default for non-CPU PMUs.
Yeah, there's lots of cleanup to be done. Quite possibly also some unification between the various drivers.
Just need someone that knows what they're doing that has spare time, know anybody like that? :-)
Mark Rutland
maintainerRe: [PATCH v5 2/2] perf: Fujitsu: Add the Uncore PCI PMU driver
Quoted 22 lines · Peter Zijlstra
Quoted 21 lines · Mark Rutland
Quoted 19 lines · Peter Zijlstra
Quoted 5 lines · Koichi Okuno
drivers/perf/fujitsu_pci_pmu.c new file +5
-0+ pcipmu->pmu = (struct pmu ) { + .parent = dev, + .task_ctx_nr = perf_invalid_context, + + .pmu_enable = fujitsu_pci__pmu_enable,drivers/perf/fujitsu_pci_pmu.c line 490
Quoted 10 lines
drivers/perf/fujitsu_pci_pmu.c new file +10
-0+ .pmu_disable = fujitsu_pci__pmu_disable, + .event_init = fujitsu_pci__event_init, + .add = fujitsu_pci__event_add, + .del = fujitsu_pci__event_del, + .start = fujitsu_pci__event_start, + .stop = fujitsu_pci__event_stop, + .read = fujitsu_pci__event_read, + + .attr_groups = fujitsu_pci_pmu_attr_grps, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE,Should these drivers not also have
PERF_PMU_CAP_NO_INTERRUPT? Per them being uncore they cannot generate samples.
Quoted 8 lines
Quoted 3 lines
These PMUs actually have an interrupt, so that might be a bit confusing. That said, the counters seem to be 64-bit, so the interrupt doesn't seem practically necessary today.
Yeah, I saw they had an interrupt. But them being uncore they must not sample, and
NO_INTERRUPTmeans not being able to sample.Naming urgh :-)
Yeah :)
FWIW, that came to mind due to:
https://lore.kernel.org/lkml/[email protected]/
... and if NO_INTERRUPT would be better-named as NO_SAMPLING, that might be a good opportunity to clean that up.
Quoted 11 lines
Quoted 5 lines
Either way, the
fujitsu_pci__event_init()function rejects sampling events, so it correctly rejects sampling events.IMO, it'd be a bit nicer to do the inverse, and have the perf core reject sampling events by default for non-CPU PMUs.
Yeah, there's lots of cleanup to be done. Quite possibly also some unification between the various drivers.
Just need someone that knows what they're doing that has spare time, know anybody like that? :-)
I think a few folk likle that live in the nearest hall of mirrors...
If you're happy with that in concept, I can see about getting someone to look at that -- the general idea has come up a few times.
Mark.
Re: [PATCH v5 2/2] perf: Fujitsu: Add the Uncore PCI PMU driver
Quoted 30 lines · Mark Rutland
Quoted 29 lines · Peter Zijlstra
Quoted 21 lines · Mark Rutland
Quoted 11 lines · Peter Zijlstra
Quoted 10 lines · Koichi Okuno
drivers/perf/fujitsu_pci_pmu.c new file +10
-0+ pcipmu->pmu = (struct pmu ) { + .parent = dev, + .task_ctx_nr = perf_invalid_context, + + .pmu_enable = fujitsu_pci__pmu_enable, + .pmu_disable = fujitsu_pci__pmu_disable, + .event_init = fujitsu_pci__event_init, + .add = fujitsu_pci__event_add, + .del = fujitsu_pci__event_del, + .start = fujitsu_pci__event_start,Quoted 8 lines
drivers/perf/fujitsu_pci_pmu.c line 490
Quoted 5 lines
drivers/perf/fujitsu_pci_pmu.c new file +5
-0+ .stop = fujitsu_pci__event_stop, + .read = fujitsu_pci__event_read, + + .attr_groups = fujitsu_pci_pmu_attr_grps, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE,Should these drivers not also have
PERF_PMU_CAP_NO_INTERRUPT? Per them being uncore they cannot generate samples.Quoted 3 lines
These PMUs actually have an interrupt, so that might be a bit confusing. That said, the counters seem to be 64-bit, so the interrupt doesn't seem practically necessary today.
Yeah, I saw they had an interrupt. But them being uncore they must not sample, and
NO_INTERRUPTmeans not being able to sample.
Quoted 7 lines
Quoted 1 line
Naming urgh :-)
Yeah :)
FWIW, that came to mind due to:
Oh hey, look at that.. Clearly that is still stuck in my unread pile :/
Quoted 2 lines
... and if
NO_INTERRUPTwould be better-named asNO_SAMPLING, that might be a good opportunity to clean that up.
Yeah, that's more or less what it does, look at the few sites in perf/events/core.c that test it.
Quoted 10 lines
Quoted 5 lines
Yeah, there's lots of cleanup to be done. Quite possibly also some unification between the various drivers.
Just need someone that knows what they're doing that has spare time, know anybody like that? :-)
I think a few folk likle that live in the nearest hall of mirrors...
If you're happy with that in concept, I can see about getting someone to look at that -- the general idea has come up a few times.
Sure.
RE: [PATCH v5 2/2] perf: Fujitsu: Add the Uncore PCI PMU driver
In reply to Peter ZijlstraHi, Peter
Sorry for the late reply.
Quoted 14 lines · Koichi Okuno
Quoted 13 lines
drivers/perf/fujitsu_pci_pmu.c new file +13
-0+ pcipmu->pmu = (struct pmu ) { + .parent = dev, + .task_ctx_nr = perf_invalid_context, + + .pmu_enable = fujitsu_pci__pmu_enable, + .pmu_disable = fujitsu_pci__pmu_disable, + .event_init = fujitsu_pci__event_init, + .add = fujitsu_pci__event_add, + .del = fujitsu_pci__event_del, + .start = fujitsu_pci__event_start, + .stop = fujitsu_pci__event_stop, + .read = fujitsu_pci__event_read, +
Quoted 5 lines
drivers/perf/fujitsu_pci_pmu.c line 490
Quoted 2 lines
Quoted 1 line
drivers/perf/fujitsu_pci_pmu.c new file +1
-0+ .attr_groups = fujitsu_pci_pmu_attr_grps,drivers/perf/fujitsu_pci_pmu.c new file +1
-0+ .capabilities = PERF_PMU_CAP_NO_EXCLUDE,Should these drivers not also have
PERF_PMU_CAP_NO_INTERRUPT? Per them being uncore they cannot generate samples.
Even now, the fujitsu_pci__event_init() function rejects sampling events before checking PERF_PMU_CAP_NO_INTERRUPT in core.c. However, I think it is correct to have PERF_PMU_CAP_NO_INTERRUPT which means not being able to sample, so I will add NO_INTERRUPT in the next version.
Best Regards,
Koichi Okuno
Mark Rutland
maintainerRe: [PATCH v5 2/2] perf: Fujitsu: Add the Uncore PCI PMU driver
Quoted 24 lines · Koichi Okuno (Fujitsu)
Hi, Peter
Sorry for the late reply.
Quoted 14 lines · Koichi Okuno
Quoted 13 lines
drivers/perf/fujitsu_pci_pmu.c new file +13
-0+ pcipmu->pmu = (struct pmu ) { + .parent = dev, + .task_ctx_nr = perf_invalid_context, + + .pmu_enable = fujitsu_pci__pmu_enable, + .pmu_disable = fujitsu_pci__pmu_disable, + .event_init = fujitsu_pci__event_init, + .add = fujitsu_pci__event_add, + .del = fujitsu_pci__event_del, + .start = fujitsu_pci__event_start, + .stop = fujitsu_pci__event_stop, + .read = fujitsu_pci__event_read, +Quoted 5 lines
drivers/perf/fujitsu_pci_pmu.c line 490
Quoted 2 lines
Quoted 1 line
drivers/perf/fujitsu_pci_pmu.c new file +1
-0+ .attr_groups = fujitsu_pci_pmu_attr_grps,drivers/perf/fujitsu_pci_pmu.c new file +1
-0+ .capabilities = PERF_PMU_CAP_NO_EXCLUDE,Should these drivers not also have
PERF_PMU_CAP_NO_INTERRUPT? Per them being uncore they cannot generate samples.
Quoted 5 lines
Even now, the
fujitsu_pci__event_init()function rejects sampling events before checkingPERF_PMU_CAP_NO_INTERRUPTincore.c. However, I think it is correct to havePERF_PMU_CAP_NO_INTERRUPTwhich means not being able to sample, so I will addNO_INTERRUPTin the next version.
Sorry to give contradictory feeback, but given that the majority of PMU drivers under drivers/perf/ don't set PERF_PMU_CAP_NO_INTERRUPT, and explicitly reject sampling events, I'd prefer to do the same for consistency.
Peter, are you happy with that for now?
Overall it would be better for PMUs to export a positive "I support sampling" flag, and maybe rename/replace PERF_PMU_CAP_NO_INTERRUPT accordingly, which I'd be happy to look at in future.
Mark.