perf: Kernel updates
Subsystems (6)
PATCH 3/4 perf: use static variant of perf_event_overflow in core.c
In reply to Robert RichterNo need to have an additional function layer.
--- kernel/events/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/events/core.c +1 -1
@@ -5349,7 +5349,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)if (regs && !perf_exclude_event (event, regs)) {if (!(event->attr.exclude_idle &&is_idle_task (current))) -if (perf_event_overflow (event, &data, regs)) +if (__perf_event_overflow (event,1 , &data, regs)) ret =HRTIMER_NORESTART ; }
Signature · 1 line
1.7.8.4
cover perf: Kernel updates
Enclosed some changes made while working with the code. Mostly trivial but worth to add.
-Robert
Robert Richter (4):
perf: Trivial cleanup of duplicate code
perf, x86: Fix cmpxchg() usage in amd_put_event_constraints()
perf: use static variant of perf_event_overflow in core.c
perf: Remove PERF_COUNTERS config option
arch/arm/configs/bcmring_defconfig | 2 +- arch/powerpc/configs/chroma_defconfig | 2 +- arch/powerpc/configs/gamecube_defconfig | 2 +- arch/powerpc/configs/wii_defconfig | 2 +- arch/sh/configs/sh7785lcr_32bit_defconfig | 2 +- arch/sparc/configs/sparc64_defconfig | 2 +- arch/x86/kernel/cpu/perf_event.c | 3 --- arch/x86/kernel/cpu/perf_event_amd.c | 4 +--- init/Kconfig | 14 +------------- kernel/events/core.c | 2 +- 10 files changed, 9 insertions(+), 26 deletions(-)
Signature · 1 line
1.7.8.4
PATCH 2/4 perf, x86: Fix cmpxchg() usage in amd_put_event_constraints()
Now the return value of cmpxchg() is used to match an event. The change removes the duplicate event comparison and traverses the list until an event was removed. This also fixes the following warning:
arch/x86/kernel/cpu/perf_event_amd.c:170: warning: value computed is not used
--- arch/x86/kernel/cpu/perf_event_amd.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/perf_event_amd.c +1 -3
@@ -210,10 +210,8 @@ static void amd_put_event_constraints(struct cpu_hw_events *cpuc,* when we come here */ for (i =0 ; i < x86_pmu.num_counters; i++) { -if (nb->owners[i] == event) { -cmpxchg (nb->owners+i, event,NULL ); +if (cmpxchg (nb->owners + i, event,NULL ) == event)break ; - } } }
Signature · 1 line
1.7.8.4
PATCH 1/4 perf: Trivial cleanup of duplicate code
In reply to Robert RichterRemoving duplicate code.
--- arch/x86/kernel/cpu/perf_event.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/perf_event.c +0 -3
@@ -485,9 +485,6 @@ static int __x86_pmu_event_init(struct perf_event *event)/* mark unused */ event->hw.extra_reg.idx =EXTRA_REG_NONE ; - -/* mark not used */ - event->hw.extra_reg.idx =EXTRA_REG_NONE ; event->hw.branch_reg.idx =EXTRA_REG_NONE ;return x86_pmu.hw_config (event);
Signature · 1 line
1.7.8.4
PATCH 4/4 perf: Remove PERF_COUNTERS config option
In reply to Robert RichterRenaming remaining PERF_COUNTERS options into PERF_EVENTS.
Think we can get rid of PERF_COUNTERS now.
--- arch/arm/configs/bcmring_defconfig | 2 +- arch/powerpc/configs/chroma_defconfig | 2 +- arch/powerpc/configs/gamecube_defconfig | 2 +- arch/powerpc/configs/wii_defconfig | 2 +- arch/sh/configs/sh7785lcr_32bit_defconfig | 2 +- arch/sparc/configs/sparc64_defconfig | 2 +- init/Kconfig | 14 +------------- 7 files changed, 7 insertions(+), 19 deletions(-)
arch/arm/configs/bcmring_defconfig +1 -1
@@ -11,7 +11,7 @@ CONFIG_KALLSYMS_EXTRA_PASS=y # CONFIG_TIMERFD is not set # CONFIG_EVENTFD is not set # CONFIG_AIO is not set -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set
arch/powerpc/configs/chroma_defconfig +1 -1
@@ -32,7 +32,7 @@ CONFIG_RD_LZMA=y CONFIG_INITRAMFS_COMPRESSION_GZIP=y CONFIG_KALLSYMS_ALL=y CONFIG_EMBEDDED=y -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y CONFIG_PROFILING=y CONFIG_OPROFILE=y CONFIG_KPROBES=y
arch/powerpc/configs/gamecube_defconfig +1 -1
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_EXPERT=y # CONFIG_ELF_CORE is not set -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set CONFIG_SLAB=y CONFIG_MODULES=y
arch/powerpc/configs/wii_defconfig +1 -1
@@ -9,7 +9,7 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_EXPERT=y # CONFIG_ELF_CORE is not set -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set CONFIG_SLAB=y CONFIG_MODULES=y
arch/sh/configs/sh7785lcr_32bit_defconfig +1 -1
@@ -5,7 +5,7 @@ CONFIG_BSD_PROCESS_ACCT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=16 -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y CONFIG_PROFILING=y
arch/sparc/configs/sparc64_defconfig +1 -1
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_BLK_DEV_INITRD=y -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y CONFIG_PROFILING=y
init/Kconfig +1 -13
@@ -1165,7 +1165,7 @@ menu "Kernel Performance Events And Counters" config PERF_EVENTS bool "Kernel performance events and counters" - default y if (PROFILING || PERF_COUNTERS) + default y if PROFILING depends on HAVE_PERF_EVENTS select ANON_INODES select IRQ_WORK
@@ -1192,18 +1192,6 @@ config PERF_EVENTS Say Y if unsure. -config PERF_COUNTERS - bool "Kernel performance counters (old config option)" - depends on HAVE_PERF_EVENTS - help - This config has been obsoleted by the PERF_EVENTS - config option - please see that one for details. - - It has no effect on the kernel whether you enable - it or not, it is a compatibility placeholder. - - Say N if unsure. - config DEBUG_PERF_USE_VMALLOC default n bool "Debug: use vmalloc to back perf mmap() buffers"
Signature · 1 line
1.7.8.4
Quoted 11 lines · Robert Richter
Enclosed some changes made while working with the code. Mostly trivial but worth to add.
-Robert
Robert Richter (4):
perf: Trivial cleanup of duplicate code
perf, x86: Fixcmpxchg()usage inamd_put_event_constraints()
perf: use static variant ofperf_event_overflowincore.c
perf: RemovePERF_COUNTERSconfig option
Peter,
what's the status of this?
Thanks,
-Robert
Quoted 16 lines
arch/arm/configs/bcmring_defconfig | 2 +- arch/powerpc/configs/chroma_defconfig | 2 +- arch/powerpc/configs/gamecube_defconfig | 2 +- arch/powerpc/configs/wii_defconfig | 2 +- arch/sh/configs/sh7785lcr_32bit_defconfig | 2 +- arch/sparc/configs/sparc64_defconfig | 2 +- arch/x86/kernel/cpu/perf_event.c | 3 --- arch/x86/kernel/cpu/perf_event_amd.c | 4 +--- init/Kconfig | 14 +------------- kernel/events/core.c | 2 +- 10 files changed, 9 insertions(+), 26 deletions(-)Signature · 1 line
1.7.8.4
Signature · 2 lines
Advanced Micro Devices, Inc. Operating System Research Center
Peter Zijlstra
maintainerQuoted 5 lines · Robert Richter
Peter,
what's the status of this?
I've got them queued, I'll try and shove them Ingo-wards soon.
Thanks!
[tip:perf/core] perf: Trivial cleanup of duplicate code
In reply to Robert RichterCommit-ID: 10c250234c98928d1e15c4cea1c44b9a25354ccf Gitweb: http://git.kernel.org/tip/10c250234c98928d1e15c4cea1c44b9a25354ccf Author: Robert Richter <[email protected]> AuthorDate: Thu, 5 Apr 2012 18:24:41 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 26 Apr 2012 13:52:50 +0200
perf: Trivial cleanup of duplicate code
Removing duplicate code.
--- arch/x86/kernel/cpu/perf_event.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/perf_event.c +0 -3
@@ -484,9 +484,6 @@ static int __x86_pmu_event_init(struct perf_event *event)/* mark unused */ event->hw.extra_reg.idx =EXTRA_REG_NONE ; - -/* mark not used */ - event->hw.extra_reg.idx =EXTRA_REG_NONE ; event->hw.branch_reg.idx =EXTRA_REG_NONE ;return x86_pmu.hw_config (event);
[tip:perf/core] perf/x86: Fix cmpxchg() usage in amd_put_event_constraints()
In reply to Robert RichterCommit-ID: 5f09fc688936705b2020ca247df39ee27283668a Gitweb: http://git.kernel.org/tip/5f09fc688936705b2020ca247df39ee27283668a Author: Robert Richter <[email protected]> AuthorDate: Thu, 5 Apr 2012 18:24:42 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 26 Apr 2012 13:52:51 +0200
perf/x86: Fix cmpxchg() usage in amd_put_event_constraints()
Now the return value of cmpxchg() is used to match an event. The change removes the duplicate event comparison and traverses the list until an event was removed. This also fixes the following warning:
arch/x86/kernel/cpu/perf_event_amd.c:170: warning: value computed is not used
--- arch/x86/kernel/cpu/perf_event_amd.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/perf_event_amd.c +1 -3
@@ -205,10 +205,8 @@ static void amd_put_event_constraints(struct cpu_hw_events *cpuc,* when we come here */ for (i =0 ; i < x86_pmu.num_counters; i++) { -if (nb->owners[i] == event) { -cmpxchg (nb->owners+i, event,NULL ); +if (cmpxchg (nb->owners + i, event,NULL ) == event)break ; - } } }
[tip:perf/core] perf: Use static variant of perf_event_overflow in core.c
In reply to Robert RichterCommit-ID: 33b07b8be7f0e1e8e4184e3473d71f174e4b0641 Gitweb: http://git.kernel.org/tip/33b07b8be7f0e1e8e4184e3473d71f174e4b0641 Author: Robert Richter <[email protected]> AuthorDate: Thu, 5 Apr 2012 18:24:43 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 26 Apr 2012 13:52:52 +0200
perf: Use static variant of perf_event_overflow in core.c
No need to have an additional function layer.
--- kernel/events/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/events/core.c +1 -1
@@ -5350,7 +5350,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)if (regs && !perf_exclude_event (event, regs)) {if (!(event->attr.exclude_idle &&is_idle_task (current))) -if (perf_event_overflow (event, &data, regs)) +if (__perf_event_overflow (event,1 , &data, regs)) ret =HRTIMER_NORESTART ; }
[tip:perf/core] perf: Remove PERF_COUNTERS config option
In reply to Robert RichterCommit-ID: 392d65a9adbe2f09707d2de27110dafb9c8dc08b Gitweb: http://git.kernel.org/tip/392d65a9adbe2f09707d2de27110dafb9c8dc08b Author: Robert Richter <[email protected]> AuthorDate: Thu, 5 Apr 2012 18:24:44 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 26 Apr 2012 13:52:52 +0200
perf: Remove PERF_COUNTERS config option
Renaming remaining PERF_COUNTERS options into PERF_EVENTS.
Think we can get rid of PERF_COUNTERS now.
--- arch/arm/configs/bcmring_defconfig | 2 +- arch/powerpc/configs/chroma_defconfig | 2 +- arch/powerpc/configs/gamecube_defconfig | 2 +- arch/powerpc/configs/wii_defconfig | 2 +- arch/sh/configs/sh7785lcr_32bit_defconfig | 2 +- arch/sparc/configs/sparc64_defconfig | 2 +- init/Kconfig | 14 +------------- 7 files changed, 7 insertions(+), 19 deletions(-)
arch/arm/configs/bcmring_defconfig +1 -1
@@ -11,7 +11,7 @@ CONFIG_KALLSYMS_EXTRA_PASS=y # CONFIG_TIMERFD is not set # CONFIG_EVENTFD is not set # CONFIG_AIO is not set -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set
arch/powerpc/configs/chroma_defconfig +1 -1
@@ -32,7 +32,7 @@ CONFIG_RD_LZMA=y CONFIG_INITRAMFS_COMPRESSION_GZIP=y CONFIG_KALLSYMS_ALL=y CONFIG_EMBEDDED=y -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y CONFIG_PROFILING=y CONFIG_OPROFILE=y CONFIG_KPROBES=y
arch/powerpc/configs/gamecube_defconfig +1 -1
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_EXPERT=y # CONFIG_ELF_CORE is not set -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set CONFIG_SLAB=y CONFIG_MODULES=y
arch/powerpc/configs/wii_defconfig +1 -1
@@ -9,7 +9,7 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_EXPERT=y # CONFIG_ELF_CORE is not set -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set CONFIG_SLAB=y CONFIG_MODULES=y
arch/sh/configs/sh7785lcr_32bit_defconfig +1 -1
@@ -5,7 +5,7 @@ CONFIG_BSD_PROCESS_ACCT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=16 -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y CONFIG_PROFILING=y
arch/sparc/configs/sparc64_defconfig +1 -1
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_BLK_DEV_INITRD=y -CONFIG_PERF_COUNTERS=y +CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y CONFIG_PROFILING=y
init/Kconfig +1 -13
@@ -1156,7 +1156,7 @@ menu "Kernel Performance Events And Counters" config PERF_EVENTS bool "Kernel performance events and counters" - default y if (PROFILING || PERF_COUNTERS) + default y if PROFILING depends on HAVE_PERF_EVENTS select ANON_INODES select IRQ_WORK
@@ -1183,18 +1183,6 @@ config PERF_EVENTS Say Y if unsure. -config PERF_COUNTERS - bool "Kernel performance counters (old config option)" - depends on HAVE_PERF_EVENTS - help - This config has been obsoleted by the PERF_EVENTS - config option - please see that one for details. - - It has no effect on the kernel whether you enable - it or not, it is a compatibility placeholder. - - Say N if unsure. - config DEBUG_PERF_USE_VMALLOC default n bool "Debug: use vmalloc to back perf mmap() buffers"