perf: Sanitize perf directory structure, p1
Subsystems (2)
Borislav Petkov
maintainercover perf: Sanitize perf directory structure, p1
From: Borislav Petkov <[email protected]>
Hi guys,
so what better time to do that fun than during the holidays when no one else is producing patches. :-)
Anyway, here's a part one conversion of the AMD perf events facilities. Directory structure looks like this:
arch/x86/events/
|-- amd | |-- core.c | |-- ibs.c | |-- iommu.c | |-- iommu.h | `-- uncore.c |-- core.c
`-- Makefile
and I've kept the churn at a mininum. Holler if something's not kosher.
Thanks.
Borislav Petkov (5):
x86/events: Move perf_event.c
x86/events: Move perf_event_amd.c
x86/events: Move perf_event_amd_ibs.c
x86/events: Move perf_event_amd_iommu.*
x86/events: Move perf_event_amd_uncore.c
arch/x86/Kbuild | 3 ++-
arch/x86/events/Makefile | 7 +++++++
arch/x86/{kernel/cpu/perf_event_amd.c => events/amd/core.c} | 2 +-
arch/x86/{kernel/cpu/perf_event_amd_ibs.c => events/amd/ibs.c} | 2 +-
.../x86/{kernel/cpu/perf_event_amd_iommu.c => events/amd/iommu.c} | 4 ++--
.../x86/{kernel/cpu/perf_event_amd_iommu.h => events/amd/iommu.h} | 0
.../{kernel/cpu/perf_event_amd_uncore.c => events/amd/uncore.c} | 0
arch/x86/{kernel/cpu/perf_event.c => events/core.c} | 2 +-
arch/x86/kernel/cpu/Makefile | 8 +-------
9 files changed, 15 insertions(+), 13 deletions(-)
create mode 100644 arch/x86/events/Makefile
rename arch/x86/{kernel/cpu/perf_event_amd.c => events/amd/core.c} (99%)
rename arch/x86/{kernel/cpu/perf_event_amd_ibs.c => events/amd/ibs.c} (99%)
rename arch/x86/{kernel/cpu/perf_event_amd_iommu.c => events/amd/iommu.c} (99%)
rename arch/x86/{kernel/cpu/perf_event_amd_iommu.h => events/amd/iommu.h} (100%)
rename arch/x86/{kernel/cpu/perf_event_amd_uncore.c => events/amd/uncore.c} (100%)
rename arch/x86/{kernel/cpu/perf_event.c => events/core.c} (99%)Signature · 1 line
2.3.5
Borislav Petkov
maintainerRFC PATCH 1/5 x86/events: Move perf_event.c
From: Borislav Petkov <[email protected]>
Also, keep the churn at minimum by adjusting the include "perf_event.h" when each file gets moved.
---
arch/x86/Kbuild | 3 ++-
arch/x86/events/Makefile | 1 +
arch/x86/{kernel/cpu/perf_event.c => events/core.c} | 2 +-
arch/x86/kernel/cpu/Makefile | 2 --
4 files changed, 4 insertions(+), 4 deletions(-)
create mode 100644 arch/x86/events/Makefile
rename arch/x86/{kernel/cpu/perf_event.c => events/core.c} (99%)arch/x86/Kbuild +2 -1
@@ -1,6 +1,7 @@ - obj-y += entry/ +obj-$(CONFIG_PERF_EVENTS) += events/ + obj-$(CONFIG_KVM) += kvm/ # Xen paravirtualization support
arch/x86/events/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += core.o
arch/x86/events/core.c renamed from arch/x86/kernel/cpu/perf_event.c +1 -1
@@ -37,7 +37,7 @@#include <asm/desc.h> #include <asm/ldt.h> -#include "perf_event.h" +#include "../kernel/cpu/perf_event.h" struct x86_pmu x86_pmu__read_mostly ;
arch/x86/kernel/cpu/Makefile +0 -2
@@ -30,8 +30,6 @@ obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o -obj-$(CONFIG_PERF_EVENTS) += perf_event.o - ifdef CONFIG_PERF_EVENTS obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd.o perf_event_amd_uncore.o ifdef CONFIG_AMD_IOMMU
Signature · 1 line
2.3.5
Borislav Petkov
maintainerRFC PATCH 2/5 x86/events: Move perf_event_amd.c
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
---
arch/x86/events/Makefile | 2 ++
arch/x86/{kernel/cpu/perf_event_amd.c => events/amd/core.c} | 2 +-
arch/x86/kernel/cpu/Makefile | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
rename arch/x86/{kernel/cpu/perf_event_amd.c => events/amd/core.c} (99%)arch/x86/events/Makefile +2 -0
@@ -1 +1,3 @@ obj-y += core.o + +obj-$(CONFIG_CPU_SUP_AMD) += amd/core.o
arch/x86/events/amd/core.c renamed from arch/x86/kernel/cpu/perf_event_amd.c +1 -1
@@ -5,7 +5,7 @@#include <linux/slab.h> #include <asm/apicdef.h> -#include "perf_event.h" +#include "../../kernel/cpu/perf_event.h" static __initconst const u64 amd_hw_cache_event_ids [PERF_COUNT_HW_CACHE_MAX ]
arch/x86/kernel/cpu/Makefile +1 -1
@@ -31,7 +31,7 @@ obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o ifdef CONFIG_PERF_EVENTS -obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd.o perf_event_amd_uncore.o +obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_uncore.o ifdef CONFIG_AMD_IOMMU obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_iommu.o endif
Signature · 1 line
2.3.5
Borislav Petkov
maintainerRFC PATCH 3/5 x86/events: Move perf_event_amd_ibs.c
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
---
arch/x86/events/Makefile | 1 +
arch/x86/{kernel/cpu/perf_event_amd_ibs.c => events/amd/ibs.c} | 2 +-
arch/x86/kernel/cpu/Makefile | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
rename arch/x86/{kernel/cpu/perf_event_amd_ibs.c => events/amd/ibs.c} (99%)arch/x86/events/Makefile +1 -0
@@ -1,3 +1,4 @@ obj-y += core.o obj-$(CONFIG_CPU_SUP_AMD) += amd/core.o +obj-$(CONFIG_X86_LOCAL_APIC) += amd/ibs.o
arch/x86/events/amd/ibs.c renamed from arch/x86/kernel/cpu/perf_event_amd_ibs.c +1 -1
@@ -14,7 +14,7 @@#include <asm/apic.h> -#include "perf_event.h" +#include "../../kernel/cpu/perf_event.h" static u32 ibs_caps;
arch/x86/kernel/cpu/Makefile +1 -1
@@ -55,7 +55,7 @@ obj-$(CONFIG_X86_MCE) += mcheck/ obj-$(CONFIG_MTRR) += mtrr/ obj-$(CONFIG_MICROCODE) += microcode/ -obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o perf_event_amd_ibs.o +obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
Signature · 1 line
2.3.5
Borislav Petkov
maintainerRFC PATCH 4/5 x86/events: Move perf_event_amd_iommu.*
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
---
arch/x86/events/Makefile | 3 +++
arch/x86/{kernel/cpu/perf_event_amd_iommu.c => events/amd/iommu.c} | 4 ++--
arch/x86/{kernel/cpu/perf_event_amd_iommu.h => events/amd/iommu.h} | 0
arch/x86/kernel/cpu/Makefile | 3 ---
4 files changed, 5 insertions(+), 5 deletions(-)
rename arch/x86/{kernel/cpu/perf_event_amd_iommu.c => events/amd/iommu.c} (99%)
rename arch/x86/{kernel/cpu/perf_event_amd_iommu.h => events/amd/iommu.h} (100%)arch/x86/events/Makefile +3 -0
@@ -2,3 +2,6 @@ obj-y += core.o obj-$(CONFIG_CPU_SUP_AMD) += amd/core.o obj-$(CONFIG_X86_LOCAL_APIC) += amd/ibs.o +ifdef CONFIG_AMD_IOMMU +obj-$(CONFIG_CPU_SUP_AMD) += amd/iommu.o +endif
arch/x86/events/amd/iommu.c renamed from arch/x86/kernel/cpu/perf_event_amd_iommu.c +2 -2
@@ -16,8 +16,8 @@#include <linux/cpumask.h> #include <linux/slab.h> -#include "perf_event.h" -#include "perf_event_amd_iommu.h" +#include "../../kernel/cpu/perf_event.h" +#include "iommu.h" #define COUNTER_SHIFT 16
arch/x86/events/amd/iommu.h renamed from arch/x86/kernel/cpu/perf_event_amd_iommu.h +0 -0
arch/x86/kernel/cpu/Makefile +0 -3
@@ -32,9 +32,6 @@ obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o ifdef CONFIG_PERF_EVENTS obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_uncore.o -ifdef CONFIG_AMD_IOMMU -obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_iommu.o -endif obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_rapl.o perf_event_intel_cqm.o
Signature · 1 line
2.3.5
Re: [RFC PATCH 4/5] x86/events: Move perf_event_amd_iommu.*
Quoted 4 lines · Borislav Petkov
From: Borislav Petkov <[email protected]>
Cc Joerg Roedel <[email protected]>Signed-off-by Borislav Petkov <[email protected]>
Quoted 8 lines
---
arch/x86/events/Makefile | 3 +++
arch/x86/{kernel/cpu/perf_event_amd_iommu.c => events/amd/iommu.c} | 4 ++--
arch/x86/{kernel/cpu/perf_event_amd_iommu.h => events/amd/iommu.h} | 0
arch/x86/kernel/cpu/Makefile | 3 ---
4 files changed, 5 insertions(+), 5 deletions(-)
rename arch/x86/{kernel/cpu/perf_event_amd_iommu.c => events/amd/iommu.c} (99%)
rename arch/x86/{kernel/cpu/perf_event_amd_iommu.h => events/amd/iommu.h} (100%)Hmm, the arch/x86/events directory does not exist yet, is it the plan to move non-cpu event over there? It looks to be a better place for the iommu events, are there more no-cpu events to move there?
Joerg
Boris Petkov
maintainerRe: [RFC PATCH 4/5] x86/events: Move perf_event_amd_iommu.*
Quoted 3 lines · Joerg Roedel
Hmm, the
arch/x86/eventsdirectory does not exist yet, is it the plan to move non-cpu event over there? It looks to be a better place for the iommu events, are there more no-cpu events to move there?
Yeah, basically move all arch/x86/ *perf_event* stuff there.
Signature · 1 line
Sent from a small device: formatting sux and brevity is inevitable.
Borislav Petkov
maintainerRFC PATCH 5/5 x86/events: Move perf_event_amd_uncore.c
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
---
arch/x86/events/Makefile | 2 +-
arch/x86/{kernel/cpu/perf_event_amd_uncore.c => events/amd/uncore.c} | 0
arch/x86/kernel/cpu/Makefile | 1 -
3 files changed, 1 insertion(+), 2 deletions(-)
rename arch/x86/{kernel/cpu/perf_event_amd_uncore.c => events/amd/uncore.c} (100%)arch/x86/events/Makefile +1 -1
@@ -1,6 +1,6 @@ obj-y += core.o -obj-$(CONFIG_CPU_SUP_AMD) += amd/core.o +obj-$(CONFIG_CPU_SUP_AMD) += amd/core.o amd/uncore.o obj-$(CONFIG_X86_LOCAL_APIC) += amd/ibs.o ifdef CONFIG_AMD_IOMMU obj-$(CONFIG_CPU_SUP_AMD) += amd/iommu.o
arch/x86/events/amd/uncore.c renamed from arch/x86/kernel/cpu/perf_event_amd_uncore.c +0 -0
arch/x86/kernel/cpu/Makefile +0 -1
@@ -31,7 +31,6 @@ obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o ifdef CONFIG_PERF_EVENTS -obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_uncore.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_rapl.o perf_event_intel_cqm.o
Signature · 1 line
2.3.5
Quoted 18 lines · Borislav Petkov
From: Borislav Petkov <[email protected]>
Hi guys,
so what better time to do that fun than during the holidays when no one else is producing patches. :-)
Anyway, here's a part one conversion of the AMD perf events facilities. Directory structure looks like this:
arch/x86/events/|-- amd | |-- core.c | |-- ibs.c | |-- iommu.c | |-- iommu.h | `-- uncore.c |-- core.c
Quoted 3 lines
`--
Makefileand I've kept the churn at a mininum. Holler if something's not kosher.
So it is only now that I noticed that we have both 'core.c' and 'uncore.c', which is slightly bit confusing: the core.c's we have around the kernel denote core subsystem functionality - not CPU core functionality. If we have uncore.c around, confusion might ensue.
OTOH maybe it's not a big issue and we can just live with it. I'd hate to see main.c. Maybe rename 'uncore.c' to 'cpu_uncore.c'? OTOH that sounds a bit silly too. So maybe leave it as you named them.
Thanks,
Ingo
Borislav Petkov
maintainerQuoted 8 lines · Ingo Molnar
So it is only now that I noticed that we have both '
core.c' and 'uncore.c', which is slightly bit confusing: the core.c's we have around the kernel denote core subsystem functionality - not CPU core functionality. If we haveuncore.caround, confusion might ensue.OTOH maybe it's not a big issue and we can just live with it. I'd hate to see
main.c. Maybe rename 'uncore.c' to 'cpu_uncore.c'? OTOH that sounds a bit silly too. So maybe leave it as you named them.
Well, not doung anything should be ok because the *uncore* things would go to the <vendor>/ subdir:
I.e.,
arch/x86/kernel/cpu/perf_event_amd_uncore.c arch/x86/kernel/cpu/perf_event_intel_uncore.c arch/x86/kernel/cpu/perf_event_intel_uncore.h arch/x86/kernel/cpu/perf_event_intel_uncore_nhmex.c arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
will become
arch/x86/events/amd/uncore.carch/x86/events/intel/uncore.carch/x86/events/intel/uncore.harch/x86/events/intel/uncore_nhmex.carch/x86/events/intel/uncore_snb.carch/x86/events/intel/uncore_snbep.c
and core.c will be in the upper dir arch/x86/events/
Signature · 4 lines
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.Quoted 24 lines · Borislav Petkov
Quoted 8 lines · Ingo Molnar
So it is only now that I noticed that we have both '
core.c' and 'uncore.c', which is slightly bit confusing: the core.c's we have around the kernel denote core subsystem functionality - not CPU core functionality. If we haveuncore.caround, confusion might ensue.OTOH maybe it's not a big issue and we can just live with it. I'd hate to see
main.c. Maybe rename 'uncore.c' to 'cpu_uncore.c'? OTOH that sounds a bit silly too. So maybe leave it as you named them.Well, not doung anything should be ok because the *uncore* things would go to the <vendor>/ subdir:
I.e.,
arch/x86/kernel/cpu/perf_event_amd_uncore.carch/x86/kernel/cpu/perf_event_intel_uncore.carch/x86/kernel/cpu/perf_event_intel_uncore.harch/x86/kernel/cpu/perf_event_intel_uncore_nhmex.carch/x86/kernel/cpu/perf_event_intel_uncore_snb.carch/x86/kernel/cpu/perf_event_intel_uncore_snbep.cwill become
Quoted 8 lines
arch/x86/events/amd/uncore.carch/x86/events/intel/uncore.carch/x86/events/intel/uncore.harch/x86/events/intel/uncore_nhmex.carch/x86/events/intel/uncore_snb.carch/x86/events/intel/uncore_snbep.cand
core.cwill be in the upper dirarch/x86/events/
Ok, works for me. Got confused by your ascii art:
arch/x86/events/
|-- amd | |-- core.c | |-- ibs.c | |-- iommu.c | |-- iommu.h | `-- uncore.c |-- core.c
`-- Makefile
which lists events/amd/core.c.
Thanks,
Ingo
Borislav Petkov
maintainerQuoted 10 lines · Ingo Molnar
Ok, works for me. Got confused by your ascii art:
arch/x86/events/|-- amd | |-- core.c | |-- ibs.c | |-- iommu.c | |-- iommu.h | `-- uncore.c |-- core.c
Quoted 3 lines
`--
Makefilewhich lists
events/amd/core.c.
No, that's all correct. There is an amd/core.c thing:
arch/x86/{kernel/cpu/perf_event_amd.c => events/amd/core.c} | 2 +-and there's also a arch/x86/kernel/cpu/perf_event_intel.c which would want to become events/intel/core.c
Hmm, what do we call those then?
Signature · 4 lines
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.Quoted 15 lines · Borislav Petkov
Quoted 10 lines · Ingo Molnar
Ok, works for me. Got confused by your ascii art:
arch/x86/events/|-- amd | |-- core.c | |-- ibs.c | |-- iommu.c | |-- iommu.h | `-- uncore.c |-- core.cQuoted 3 lines
`--
Makefilewhich lists
events/amd/core.c.
Quoted 8 lines
No, that's all correct. There is an
amd/core.cthing:arch/x86/{kernel/cpu/perf_event_amd.c => events/amd/core.c} | 2 +-and there's also a
arch/x86/kernel/cpu/perf_event_intel.cwhich would want to becomeevents/intel/core.cHmm, what do we call those then?
core.c is fine with me!
Thanks,
Ingo