x86/perf/intel/uncore: Make Intel uncore modular
Subsystems (2)
PATCH v4 1/2 x86/perf/intel/uncore: Make Intel uncore modular
From: Kan Liang <[email protected]>
This patch makes Intel uncore pmu driver modular.
By default, the uncore driver will be built in the kernel. If it is configured as module, the supported cpu model can be auto loaded. This patch also cleans up the code of cpu_init and pci_init.
---
No Changes since V3
Changes since V2:
- Add const __initconst for all struct intel_uncore_init_fun
Changes since V1:
- should use _begin _done, not _done _done.
Changes since Thomas Gleixner's version
- Move codes to new location
- The module can be autoprobe/load.
- Clean up the code of cpu_init and pci_init.
arch/x86/Kconfig | 6 +- arch/x86/Kconfig.perf | 11 +++ arch/x86/events/Makefile | 8 +- arch/x86/events/intel/Makefile | 6 ++ arch/x86/events/intel/uncore.c | 216 ++++++++++++++++++++++++----------------- 5 files changed, 147 insertions(+), 100 deletions(-) create mode 100644 arch/x86/Kconfig.perf create mode 100644 arch/x86/events/intel/Makefile
arch/x86/Kconfig +2 -4
@@ -164,10 +164,6 @@ config INSTRUCTION_DECODER def_bool y depends on KPROBES || PERF_EVENTS || UPROBES -config PERF_EVENTS_INTEL_UNCORE - def_bool y - depends on PERF_EVENTS && CPU_SUP_INTEL && PCI - config OUTPUT_FORMAT string default "elf32-i386" if X86_32
@@ -1046,6 +1042,8 @@ config X86_THERMAL_VECTOR def_bool y depends on X86_MCE_INTEL +source "arch/x86/Kconfig.perf" + config X86_LEGACY_VM86 bool "Legacy VM86 support" default n
arch/x86/Kconfig.perf new file +11 -0
@@ -0,0 +1,11 @@ +menu "Performance monitoring" + +config PERF_EVENTS_INTEL_UNCORE + tristate "Intel uncore performance events" + depends on PERF_EVENTS && CPU_SUP_INTEL && PCI + default y + ---help--- + Include support for Intel uncore performance events. These are + available on NehalemEX and more modern processors. + +endmenu
arch/x86/events/Makefile +2 -6
@@ -5,9 +5,5 @@ obj-$(CONFIG_X86_LOCAL_APIC) += amd/ibs.o msr.o ifdef CONFIG_AMD_IOMMU obj-$(CONFIG_CPU_SUP_AMD) += amd/iommu.o endif -obj-$(CONFIG_CPU_SUP_INTEL) += intel/core.o intel/bts.o intel/cqm.o -obj-$(CONFIG_CPU_SUP_INTEL) += intel/cstate.o intel/ds.o intel/knc.o -obj-$(CONFIG_CPU_SUP_INTEL) += intel/lbr.o intel/p4.o intel/p6.o intel/pt.o -obj-$(CONFIG_CPU_SUP_INTEL) += intel/rapl.o msr.o -obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel/uncore.o intel/uncore_nhmex.o -obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel/uncore_snb.o intel/uncore_snbep.o +obj-$(CONFIG_CPU_SUP_INTEL) += msr.o +obj-$(CONFIG_CPU_SUP_INTEL) += intel/
arch/x86/events/intel/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +obj-$(CONFIG_CPU_SUP_INTEL) += core.o bts.o cqm.o +obj-$(CONFIG_CPU_SUP_INTEL) += cstate.o ds.o knc.o +obj-$(CONFIG_CPU_SUP_INTEL) += lbr.o p4.o p6.o pt.o +obj-$(CONFIG_CPU_SUP_INTEL) += rapl.o +obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel-uncore.o +intel-uncore-objs := uncore.o uncore_nhmex.o uncore_snb.o uncore_snbep.o
arch/x86/events/intel/uncore.c +126 -90
285 lines not on this page · raw message
Signature · 1 line
2.5.0
PATCH v4 2/2 x86/perf/intel/uncore: Make Intel rapl modular
From: Kan Liang <[email protected]>
This patch makes Intel rapl pmu driver modular.
By default, the rapl driver will be built in the kernel. If it is configured as module, the supported cpu model can be auto loaded. This patch also cleans up the code of rapl_pmu_init.
---
Changes since V3:
- The driver needs to migrate its stuff away before the core code gets notified about the cpu going down
Changes since V2:
- Add const __initconst for all struct intel_rapl_init_fun
Changes since V1:
- should use _begin _done, not _done _done.
Changes since Thomas Gleixner's version
- Move codes to new location
- The module can be autoprobe/load.
- Clean up the code of rapl_pmu_init.
arch/x86/Kconfig.perf | 8 +++ arch/x86/events/intel/Makefile | 3 +- arch/x86/events/intel/rapl.c | 121 ++++++++++++++++++++++++++++------------- 3 files changed, 94 insertions(+), 38 deletions(-)
arch/x86/Kconfig.perf +8 -0
@@ -8,4 +8,12 @@ config PERF_EVENTS_INTEL_UNCORE Include support for Intel uncore performance events. These are available on NehalemEX and more modern processors. +config PERF_EVENTS_INTEL_RAPL + tristate "Intel rapl performance events" + depends on PERF_EVENTS && CPU_SUP_INTEL && PCI + default y + ---help--- + Include support for Intel rapl performance events for power + monitoring on modern processors. + endmenu
arch/x86/events/intel/Makefile +2 -1
@@ -1,6 +1,7 @@ obj-$(CONFIG_CPU_SUP_INTEL) += core.o bts.o cqm.o obj-$(CONFIG_CPU_SUP_INTEL) += cstate.o ds.o knc.o obj-$(CONFIG_CPU_SUP_INTEL) += lbr.o p4.o p6.o pt.o -obj-$(CONFIG_CPU_SUP_INTEL) += rapl.o +obj-$(CONFIG_PERF_EVENTS_INTEL_RAPL) += intel-rapl.o +intel-rapl-objs := rapl.o obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel-uncore.o intel-uncore-objs := uncore.o uncore_nhmex.o uncore_snb.o uncore_snbep.o
arch/x86/events/intel/rapl.c +84 -37
163 lines not on this page · raw message
Signature · 1 line
2.5.0
tip-bot for Kan Liang
merge bot[tip:perf/core] x86/perf/intel/uncore: Make the Intel uncore PMU driver modular
In reply to [email protected]x86/perf/intel/uncore: Make the Intel uncore PMU driver modular
Commit-ID: e633c65a1d5859da170a83d537d9762c07d12213 Gitweb: http://git.kernel.org/tip/e633c65a1d5859da170a83d537d9762c07d12213 Author: Kan Liang <[email protected]> AuthorDate: Sun, 20 Mar 2016 01:33:36 -0700 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 31 Mar 2016 10:30:34 +0200
x86/perf/intel/uncore: Make the Intel uncore PMU driver modular
By default, the uncore driver will be built into the kernel. If it is configured as a module, the supported CPU model can be auto loaded.
This patch also cleans up the code of uncore_cpu_init() and uncore_pci_init().
--- arch/x86/Kconfig | 6 +- arch/x86/Kconfig.perf | 11 +++ arch/x86/events/Makefile | 9 +- arch/x86/events/intel/Makefile | 6 ++ arch/x86/events/intel/uncore.c | 216 ++++++++++++++++++++++++----------------- 5 files changed, 148 insertions(+), 100 deletions(-)
arch/x86/Kconfig +2 -4
@@ -160,10 +160,6 @@ config INSTRUCTION_DECODER def_bool y depends on KPROBES || PERF_EVENTS || UPROBES -config PERF_EVENTS_INTEL_UNCORE - def_bool y - depends on PERF_EVENTS && CPU_SUP_INTEL && PCI - config OUTPUT_FORMAT string default "elf32-i386" if X86_32
@@ -1042,6 +1038,8 @@ config X86_THERMAL_VECTOR def_bool y depends on X86_MCE_INTEL +source "arch/x86/Kconfig.perf" + config X86_LEGACY_VM86 bool "Legacy VM86 support" default n
arch/x86/Kconfig.perf new file +11 -0
@@ -0,0 +1,11 @@ +menu "Performance monitoring" + +config PERF_EVENTS_INTEL_UNCORE + tristate "Intel uncore performance events" + depends on PERF_EVENTS && CPU_SUP_INTEL && PCI + default y + ---help--- + Include support for Intel uncore performance events. These are + available on NehalemEX and more modern processors. + +endmenu
arch/x86/events/Makefile +3 -6
@@ -6,9 +6,6 @@ obj-$(CONFIG_X86_LOCAL_APIC) += amd/ibs.o msr.o ifdef CONFIG_AMD_IOMMU obj-$(CONFIG_CPU_SUP_AMD) += amd/iommu.o endif -obj-$(CONFIG_CPU_SUP_INTEL) += intel/core.o intel/bts.o intel/cqm.o -obj-$(CONFIG_CPU_SUP_INTEL) += intel/cstate.o intel/ds.o intel/knc.o -obj-$(CONFIG_CPU_SUP_INTEL) += intel/lbr.o intel/p4.o intel/p6.o intel/pt.o -obj-$(CONFIG_CPU_SUP_INTEL) += intel/rapl.o msr.o -obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel/uncore.o intel/uncore_nhmex.o -obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel/uncore_snb.o intel/uncore_snbep.o + +obj-$(CONFIG_CPU_SUP_INTEL) += msr.o +obj-$(CONFIG_CPU_SUP_INTEL) += intel/
arch/x86/events/intel/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +obj-$(CONFIG_CPU_SUP_INTEL) += core.o bts.o cqm.o +obj-$(CONFIG_CPU_SUP_INTEL) += cstate.o ds.o knc.o +obj-$(CONFIG_CPU_SUP_INTEL) += lbr.o p4.o p6.o pt.o +obj-$(CONFIG_CPU_SUP_INTEL) += rapl.o +obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += intel-uncore.o +intel-uncore-objs := uncore.o uncore_nhmex.o uncore_snb.o uncore_snbep.o
arch/x86/events/intel/uncore.c +126 -90
285 lines not on this page · raw message