Skip to contentSkip to conversation

drivers: Remove oprofile and dcookies

PATCH In review Viresh Kumar 11 participants 34 messages Jan 14, 2021 – Jan 18, 2021 1 message not in the archive

Subsystems (33)
Documentation Arm (32-bit) x86 VFS +29 more subsystems
lore
Share & tools
lore
#1 lore raw

PATCH 1/18 arch: alpha: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/alpha/Kconfig                  |   1 -
 arch/alpha/Makefile                 |   1 -
 arch/alpha/oprofile/Makefile        |  20 ---
 arch/alpha/oprofile/common.c        | 189 --------------------
 arch/alpha/oprofile/op_impl.h       |  55 ------
 arch/alpha/oprofile/op_model_ev4.c  | 114 ------------
 arch/alpha/oprofile/op_model_ev5.c  | 209 ----------------------
 arch/alpha/oprofile/op_model_ev6.c  | 101 -----------
 arch/alpha/oprofile/op_model_ev67.c | 261 ----------------------------
 9 files changed, 951 deletions(-)
 delete mode 100644 arch/alpha/oprofile/Makefile
 delete mode 100644 arch/alpha/oprofile/common.c
 delete mode 100644 arch/alpha/oprofile/op_impl.h
 delete mode 100644 arch/alpha/oprofile/op_model_ev4.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev5.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev6.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev67.c
arch/alpha/Kconfig +0 -1
index 1f51437d5765..a401c1481a11 100644
@@ -14,7 +14,6 @@ config ALPHA
 	select HAVE_AOUT
 	select HAVE_ASM_MODVERSIONS
 	select HAVE_IDE
-	select HAVE_OPROFILE
 	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select NEED_DMA_MAP_STATE
arch/alpha/Makefile +0 -1
index 12dee59b011c..c2946431d88d 100644
@@ -40,7 +40,6 @@ head-y := arch/alpha/kernel/head.o
 
 core-y				+= arch/alpha/kernel/ arch/alpha/mm/
 core-$(CONFIG_MATHEMU)		+= arch/alpha/math-emu/
-drivers-$(CONFIG_OPROFILE)	+= arch/alpha/oprofile/
 libs-y				+= arch/alpha/lib/
 
 # export what is needed by arch/alpha/boot/Makefile
arch/alpha/oprofile/Makefile deleted +0 -20
deleted file mode 100644
index 79f32820a42f..000000000000
@@ -1,20 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-ccflags-y := -Werror -Wno-sign-compare
-
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y				:= $(DRIVER_OBJS) common.o
-oprofile-$(CONFIG_ALPHA_GENERIC)	+= op_model_ev4.o \
-					   op_model_ev5.o \
-					   op_model_ev6.o \
-					   op_model_ev67.o
-oprofile-$(CONFIG_ALPHA_EV4)		+= op_model_ev4.o
-oprofile-$(CONFIG_ALPHA_EV5)		+= op_model_ev5.o
-oprofile-$(CONFIG_ALPHA_EV6)		+= op_model_ev6.o \
-					   op_model_ev67.o
arch/alpha/oprofile/common.c deleted +0 -189

189 lines not on this page · raw message

arch/alpha/oprofile/op_impl.h deleted +0 -55

55 lines not on this page · raw message

arch/alpha/oprofile/op_model_ev4.c deleted +0 -114

114 lines not on this page · raw message

arch/alpha/oprofile/op_model_ev5.c deleted +0 -209

209 lines not on this page · raw message

arch/alpha/oprofile/op_model_ev6.c deleted +0 -101

101 lines not on this page · raw message

arch/alpha/oprofile/op_model_ev67.c deleted +0 -261

261 lines not on this page · raw message

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#6 lore raw

PATCH 4/18 arch: hexagon: Don't select HAVE_OPROFILE

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Don't select HAVE_OPROFILE for hexagon anymore.

---
 arch/hexagon/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/hexagon/Kconfig +0 -1
index 6e00c16a36b5..44a409967af1 100644
@@ -7,7 +7,6 @@ config HEXAGON
 	select ARCH_32BIT_OFF_T
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
 	select ARCH_NO_PREEMPT
-	select HAVE_OPROFILE
 	# Other pending projects/to-do items.
 	# select HAVE_REGS_AND_STACK_ACCESS_API
 	# select HAVE_HW_BREAKPOINT if PERF_EVENTS
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#19 lore raw

PATCH 12/18 arch: s390: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/s390/Kconfig                 |  1 -
 arch/s390/Makefile                |  3 ---
 arch/s390/configs/debug_defconfig |  1 -
 arch/s390/configs/defconfig       |  1 -
 arch/s390/oprofile/Makefile       | 10 ---------
 arch/s390/oprofile/init.c         | 37 -------------------------------
 6 files changed, 53 deletions(-)
 delete mode 100644 arch/s390/oprofile/Makefile
 delete mode 100644 arch/s390/oprofile/init.c
arch/s390/Kconfig +0 -1
index c72874f09741..f84444ef3860 100644
@@ -174,7 +174,6 @@ config S390
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI
 	select HAVE_NOP_MCOUNT
-	select HAVE_OPROFILE
 	select HAVE_PCI
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_REGS
arch/s390/Makefile +0 -3
index 8db267d2a543..e443ed9947bd 100644
@@ -134,9 +134,6 @@ core-y		+= arch/s390/
 libs-y		+= arch/s390/lib/
 drivers-y	+= drivers/s390/
 
-# must be linked after kernel
-drivers-$(CONFIG_OPROFILE)	+= arch/s390/oprofile/
-
 boot		:= arch/s390/boot
 syscalls	:= arch/s390/kernel/syscalls
 tools		:= arch/s390/tools
arch/s390/configs/debug_defconfig +0 -1
index c4f6ff98a612..8b94347705e5 100644
@@ -57,7 +57,6 @@ CONFIG_CMM=m
 CONFIG_APPLDATA_BASE=y
 CONFIG_KVM=m
 CONFIG_S390_UNWIND_SELFTEST=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 CONFIG_STATIC_KEYS_SELFTEST=y
arch/s390/configs/defconfig +0 -1
index 51135893cffe..9db1232e09f4 100644
@@ -55,7 +55,6 @@ CONFIG_CMM=m
 CONFIG_APPLDATA_BASE=y
 CONFIG_KVM=m
 CONFIG_S390_UNWIND_SELFTEST=m
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 # CONFIG_GCC_PLUGINS is not set
arch/s390/oprofile/Makefile deleted +0 -10
deleted file mode 100644
index 36261f9d360b..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o  \
-		timer_int.o )
-
-oprofile-y :=	$(DRIVER_OBJS) init.o
arch/s390/oprofile/init.c deleted +0 -37
deleted file mode 100644
index 7441857df51b..000000000000
@@ -1,37 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * S390 Version
- *   Copyright IBM Corp. 2002, 2011
- *   Author(s): Thomas Spatzier ([email protected])
- *   Author(s): Mahesh Salgaonkar ([email protected])
- *   Author(s): Heinz Graalfs ([email protected])
- *   Author(s): Andreas Krebbel ([email protected])
- *
- * @remark Copyright 2002-2011 OProfile authors
- */
-
-#include <linux/oprofile.h>
-#include <linux/init.h>
-#include <asm/processor.h>
-#include <asm/unwind.h>
-
-static void s390_backtrace(struct pt_regs *regs, unsigned int depth)
-{
-	struct unwind_state state;
-
-	unwind_for_each_frame(&state, current, regs, 0) {
-		if (depth-- == 0)
-			break;
-		oprofile_add_trace(state.ip);
-	}
-}
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	ops->backtrace = s390_backtrace;
-	return 0;
-}
-
-void oprofile_arch_exit(void)
-{
-}
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#3 lore raw

PATCH 3/18 arch: arc: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/arc/Kconfig           |  1 -
 arch/arc/Makefile          |  2 --
 arch/arc/oprofile/Makefile | 10 ----------
 arch/arc/oprofile/common.c | 23 -----------------------
 4 files changed, 36 deletions(-)
 delete mode 100644 arch/arc/oprofile/Makefile
 delete mode 100644 arch/arc/oprofile/common.c
arch/arc/Kconfig +0 -1
index b55ca77f619b..bc8d6aecfbbd 100644
@@ -37,7 +37,6 @@ config ARC
 	select HAVE_KPROBES
 	select HAVE_KRETPROBES
 	select HAVE_MOD_ARCH_SPECIFIC
-	select HAVE_OPROFILE
 	select HAVE_PERF_EVENTS
 	select HANDLE_DOMAIN_IRQ
 	select IRQ_DOMAIN
arch/arc/Makefile +0 -2
index 578bdbbb0fa7..4392c9c189c4 100644
@@ -96,8 +96,6 @@ core-$(CONFIG_ARC_PLAT_TB10X)	+= arch/arc/plat-tb10x/
 core-$(CONFIG_ARC_PLAT_AXS10X)	+= arch/arc/plat-axs10x/
 core-$(CONFIG_ARC_SOC_HSDK)	+= arch/arc/plat-hsdk/
 
-drivers-$(CONFIG_OPROFILE)	+= arch/arc/oprofile/
-
 libs-y		+= arch/arc/lib/ $(LIBGCC)
 
 boot		:= arch/arc/boot
arch/arc/oprofile/Makefile deleted +0 -10
deleted file mode 100644
index 698367bb41d0..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y	:= $(DRIVER_OBJS) common.o
arch/arc/oprofile/common.c deleted +0 -23
deleted file mode 100644
index 86bf5899533b..000000000000
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
- *
- * Based on orig code from @author John Levon <[email protected]>
- */
-
-#include <linux/oprofile.h>
-#include <linux/perf_event.h>
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	/*
-	 * A failure here, forces oprofile core to switch to Timer based PC
-	 * sampling, which will happen if say perf is not enabled/available
-	 */
-	return oprofile_perf_init(ops);
-}
-
-void oprofile_arch_exit(void)
-{
-	oprofile_perf_exit();
-}
Signature · 7 lines
2.25.0.rc1.19.g042ed3e048af


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#2 lore raw

PATCH 2/18 arch: arm: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/arm/Kconfig                     |   1 -
 arch/arm/Makefile                    |   2 -
 arch/arm/configs/bcm2835_defconfig   |   1 -
 arch/arm/configs/cns3420vb_defconfig |   1 -
 arch/arm/configs/corgi_defconfig     |   1 -
 arch/arm/configs/imx_v4_v5_defconfig |   1 -
 arch/arm/configs/keystone_defconfig  |   1 -
 arch/arm/configs/multi_v5_defconfig  |   1 -
 arch/arm/configs/mv78xx0_defconfig   |   1 -
 arch/arm/configs/mvebu_v5_defconfig  |   1 -
 arch/arm/configs/omap1_defconfig     |   1 -
 arch/arm/configs/omap2plus_defconfig |   1 -
 arch/arm/configs/orion5x_defconfig   |   1 -
 arch/arm/configs/pxa_defconfig       |   1 -
 arch/arm/configs/qcom_defconfig      |   1 -
 arch/arm/configs/socfpga_defconfig   |   1 -
 arch/arm/configs/spitz_defconfig     |   1 -
 arch/arm/configs/vexpress_defconfig  |   1 -
 arch/arm/oprofile/Makefile           |  14 ---
 arch/arm/oprofile/common.c           | 132 ---------------------------
 20 files changed, 165 deletions(-)
 delete mode 100644 arch/arm/oprofile/Makefile
 delete mode 100644 arch/arm/oprofile/common.c
arch/arm/Kconfig +0 -1
index 138248999df7..c9d43d415d54 100644
@@ -102,7 +102,6 @@ config ARM
 	select HAVE_KRETPROBES if HAVE_KPROBES
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI
-	select HAVE_OPROFILE if HAVE_PERF_EVENTS
 	select HAVE_OPTPROBES if !THUMB2_KERNEL
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_REGS
arch/arm/Makefile +0 -2
index 4aaec9599e8a..e06fee171ab1 100644
@@ -266,8 +266,6 @@ core-y				+= $(machdirs) $(platdirs)
 core-				+= $(patsubst %,arch/arm/mach-%/, $(machine-))
 core-				+= $(patsubst %,arch/arm/plat-%/, $(plat-))
 
-drivers-$(CONFIG_OPROFILE)      += arch/arm/oprofile/
-
 libs-y				:= arch/arm/lib/ $(libs-y)
 
 # Default target when executing plain make
arch/arm/configs/bcm2835_defconfig +0 -1
index 44ff9cd88d81..1ef2bc4c7f69 100644
@@ -21,7 +21,6 @@ CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_JUMP_LABEL=y
 CONFIG_CC_STACKPROTECTOR_REGULAR=y
 CONFIG_MODULES=y
arch/arm/configs/cns3420vb_defconfig +0 -1
index 66a80b46038d..63fa2eb21b75 100644
@@ -11,7 +11,6 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_PERF_EVENTS is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
arch/arm/configs/corgi_defconfig +0 -1
index 911e880f06ed..15b749f6996d 100644
@@ -5,7 +5,6 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
arch/arm/configs/imx_v4_v5_defconfig +0 -1
index bb70acc6b526..1d9fa77bbafc 100644
@@ -27,7 +27,6 @@ CONFIG_AEABI=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_PM_DEBUG=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/arm/configs/keystone_defconfig +0 -1
index 84a3b055f253..33c917df7b32 100644
@@ -16,7 +16,6 @@ CONFIG_KALLSYMS_ALL=y
 # CONFIG_BASE_FULL is not set
 CONFIG_EMBEDDED=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
arch/arm/configs/multi_v5_defconfig +0 -1
index e00be9faa23b..5170a1059a11 100644
@@ -67,7 +67,6 @@ CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_KIRKWOOD_CPUIDLE=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/arm/configs/mv78xx0_defconfig +0 -1
index b39b1300a459..cd703c15798f 100644
@@ -5,7 +5,6 @@ CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_SLUB_DEBUG is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/arm/configs/mvebu_v5_defconfig +0 -1
index 226f2e97c6e2..4f16716bfc32 100644
@@ -4,7 +4,6 @@ CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=19
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/arm/configs/omap1_defconfig +0 -1
index 3b6e7452609b..3148567b66b6 100644
@@ -13,7 +13,6 @@ CONFIG_EXPERT=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_SLOB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
arch/arm/configs/omap2plus_defconfig +0 -1
index b515c31f0ab7..eb353ece7bac 100644
@@ -68,7 +68,6 @@ CONFIG_CRYPTO_AES_ARM=m
 CONFIG_CRYPTO_AES_ARM_BS=m
 CONFIG_CRYPTO_GHASH_ARM_CE=m
 CONFIG_CRYPTO_CHACHA20_NEON=m
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
arch/arm/configs/orion5x_defconfig +0 -1
index 4bdbb036ac26..b9e3b647e732 100644
@@ -5,7 +5,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
 # CONFIG_SLUB_DEBUG is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/arm/configs/pxa_defconfig +0 -1
index 8654ece13004..bd7dd81c9c54 100644
@@ -13,7 +13,6 @@ CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 CONFIG_SLOB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
arch/arm/configs/qcom_defconfig +0 -1
index d6733e745b80..43e3668f4bf0 100644
@@ -10,7 +10,6 @@ CONFIG_EMBEDDED=y
 # CONFIG_SLUB_DEBUG is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/arm/configs/socfpga_defconfig +0 -1
index e73c97b0f5b0..0c60eb382c80 100644
@@ -18,7 +18,6 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_VFP=y
 CONFIG_NEON=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/arm/configs/spitz_defconfig +0 -1
index 8b2c14424927..f42c7a502b6e 100644
@@ -5,7 +5,6 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
arch/arm/configs/vexpress_defconfig +0 -1
index c01baf7d6e37..4479369540f2 100644
@@ -11,7 +11,6 @@ CONFIG_CPUSETS=y
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/arm/oprofile/Makefile deleted +0 -14
deleted file mode 100644
index 39688dc9f181..000000000000
@@ -1,14 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-ifeq ($(CONFIG_HW_PERF_EVENTS),y)
-DRIVER_OBJS += $(addprefix ../../../drivers/oprofile/, oprofile_perf.o)
-endif
-
-oprofile-y				:= $(DRIVER_OBJS) common.o
arch/arm/oprofile/common.c deleted +0 -132

132 lines not on this page · raw message

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#8 lore raw

PATCH 5/18 arch: ia64: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Also note that ia64 supports oprofile but not perf and profiling shouldn't be working anyway currently.

Remove the old oprofile's architecture specific support.

---
 arch/ia64/Kconfig                  |   1 -
 arch/ia64/Makefile                 |   1 -
 arch/ia64/configs/bigsur_defconfig |   1 -
 arch/ia64/oprofile/Makefile        |  10 ---
 arch/ia64/oprofile/backtrace.c     | 131 -----------------------------
 arch/ia64/oprofile/init.c          |  28 ------
 6 files changed, 172 deletions(-)
 delete mode 100644 arch/ia64/oprofile/Makefile
 delete mode 100644 arch/ia64/oprofile/backtrace.c
 delete mode 100644 arch/ia64/oprofile/init.c
arch/ia64/Kconfig +0 -1
index eed59ec32657..2ad7a8d29fcc 100644
@@ -24,7 +24,6 @@ config IA64
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_EXIT_THREAD
 	select HAVE_IDE
-	select HAVE_OPROFILE
 	select HAVE_KPROBES
 	select HAVE_KRETPROBES
 	select HAVE_FTRACE_MCOUNT_RECORD
arch/ia64/Makefile +0 -1
index 703b1c4f6d12..33c11fa31192 100644
@@ -52,7 +52,6 @@ core-y				+= arch/ia64/kernel/ arch/ia64/mm/
 core-$(CONFIG_IA64_SGI_UV)	+= arch/ia64/uv/
 
 drivers-y			+= arch/ia64/pci/ arch/ia64/hp/common/
-drivers-$(CONFIG_OPROFILE)	+= arch/ia64/oprofile/
 
 PHONY += compressed check
 
arch/ia64/configs/bigsur_defconfig +0 -1
index cfed5ed89301..c409756b5396 100644
@@ -2,7 +2,6 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_PARTITION_ADVANCED=y
arch/ia64/oprofile/Makefile deleted +0 -10
deleted file mode 100644
index fc7944d462f4..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
arch/ia64/oprofile/backtrace.c deleted +0 -131

131 lines not on this page · raw message

arch/ia64/oprofile/init.c deleted +0 -28
deleted file mode 100644
index a692ba16a07b..000000000000
@@ -1,28 +0,0 @@
-/**
- * @file init.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#include <linux/kernel.h>
-#include <linux/oprofile.h>
-#include <linux/init.h>
-#include <linux/errno.h>
- 
-extern int perfmon_init(struct oprofile_operations *ops);
-extern void perfmon_exit(void);
-extern void ia64_backtrace(struct pt_regs * const regs, unsigned int depth);
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	ops->backtrace = ia64_backtrace;
-	return -ENODEV;
-}
-
-
-void oprofile_arch_exit(void)
-{
-}
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#10 lore raw

PATCH 7/18 arch: microblaze: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/microblaze/Kconfig                       |  1 -
 arch/microblaze/Makefile                      |  2 --
 arch/microblaze/oprofile/Makefile             | 14 ------------
 .../microblaze/oprofile/microblaze_oprofile.c | 22 -------------------
 4 files changed, 39 deletions(-)
 delete mode 100644 arch/microblaze/oprofile/Makefile
 delete mode 100644 arch/microblaze/oprofile/microblaze_oprofile.c
arch/microblaze/Kconfig +0 -1
index f82795592ce5..25a5a3fb14aa 100644
@@ -30,7 +30,6 @@ config MICROBLAZE
 	select HAVE_FTRACE_MCOUNT_RECORD
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_TRACER
-	select HAVE_OPROFILE
 	select HAVE_PCI
 	select IRQ_DOMAIN
 	select XILINX_INTC
arch/microblaze/Makefile +0 -2
index bb980891816d..b41f323e1fde 100644
@@ -54,8 +54,6 @@ core-y += arch/microblaze/kernel/
 core-y += arch/microblaze/mm/
 core-$(CONFIG_PCI) += arch/microblaze/pci/
 
-drivers-$(CONFIG_OPROFILE) += arch/microblaze/oprofile/
-
 boot := arch/microblaze/boot
 
 # Are we making a simpleImage.<boardname> target? If so, crack out the boardname
arch/microblaze/oprofile/Makefile deleted +0 -14
deleted file mode 100644
index 107f2f55d995..000000000000
@@ -1,14 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# arch/microblaze/oprofile/Makefile
-#
-
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y := $(DRIVER_OBJS) microblaze_oprofile.o
arch/microblaze/oprofile/microblaze_oprofile.c deleted +0 -22
deleted file mode 100644
index def17e59888e..000000000000
@@ -1,22 +0,0 @@
-/*
- * Microblaze oprofile code
- *
- * Copyright (C) 2009 Michal Simek <[email protected]>
- * Copyright (C) 2009 PetaLogix
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/oprofile.h>
-#include <linux/init.h>
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	return -1;
-}
-
-void oprofile_arch_exit(void)
-{
-}
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#12 lore raw

PATCH 8/18 arch: mips: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/mips/Kconfig                             |   3 +-
 arch/mips/Makefile                            |   1 -
 arch/mips/configs/fuloong2e_defconfig         |   1 -
 arch/mips/configs/ip32_defconfig              |   1 -
 arch/mips/configs/lemote2f_defconfig          |   1 -
 arch/mips/configs/mtx1_defconfig              |   1 -
 arch/mips/configs/rs90_defconfig              |   1 -
 .../include/asm/mach-loongson2ef/loongson.h   |   9 -
 arch/mips/loongson2ef/fuloong-2e/irq.c        |   2 +-
 arch/mips/loongson2ef/lemote-2f/irq.c         |   1 -
 arch/mips/oprofile/Makefile                   |  18 -
 arch/mips/oprofile/backtrace.c                | 177 -------
 arch/mips/oprofile/common.c                   | 147 ------
 arch/mips/oprofile/op_impl.h                  |  41 --
 arch/mips/oprofile/op_model_loongson2.c       | 161 ------
 arch/mips/oprofile/op_model_loongson3.c       | 213 --------
 arch/mips/oprofile/op_model_mipsxx.c          | 479 ------------------
 17 files changed, 2 insertions(+), 1255 deletions(-)
 delete mode 100644 arch/mips/oprofile/Makefile
 delete mode 100644 arch/mips/oprofile/backtrace.c
 delete mode 100644 arch/mips/oprofile/common.c
 delete mode 100644 arch/mips/oprofile/op_impl.h
 delete mode 100644 arch/mips/oprofile/op_model_loongson2.c
 delete mode 100644 arch/mips/oprofile/op_model_loongson3.c
 delete mode 100644 arch/mips/oprofile/op_model_mipsxx.c
arch/mips/Kconfig +1 -2
index 0a17bedf4f0d..54df2fd9988a 100644
@@ -74,7 +74,6 @@ config MIPS
 	select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI
-	select HAVE_OPROFILE
 	select HAVE_PERF_EVENTS
 	select HAVE_REGS_AND_STACK_ACCESS_API
 	select HAVE_RSEQ
@@ -2844,7 +2843,7 @@ config NODES_SHIFT
 
 config HW_PERF_EVENTS
 	bool "Enable hardware performance counter support for perf events"
-	depends on PERF_EVENTS && !OPROFILE && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP || CPU_LOONGSON64)
+	depends on PERF_EVENTS && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP || CPU_LOONGSON64)
 	default y
 	help
 	  Enable hardware performance counter support for perf events. If
arch/mips/Makefile +0 -1
index cd4343edeb11..f62a6d951d3c 100644
@@ -316,7 +316,6 @@ libs-$(CONFIG_MIPS_FP_SUPPORT) += arch/mips/math-emu/
 core-y += arch/mips/
 
 drivers-y			+= arch/mips/crypto/
-drivers-$(CONFIG_OPROFILE)	+= arch/mips/oprofile/
 
 # suspend and hibernation support
 drivers-$(CONFIG_PM)	+= arch/mips/power/
arch/mips/configs/fuloong2e_defconfig +0 -1
index 023b4e644b1c..5c24ac7fdf56 100644
@@ -22,7 +22,6 @@ CONFIG_MIPS32_N32=y
 # CONFIG_SUSPEND is not set
 CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION="/dev/sda3"
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
arch/mips/configs/ip32_defconfig +0 -1
index 7b1fab518317..1ae48f7d9ddd 100644
@@ -14,7 +14,6 @@ CONFIG_SGI_IP32=y
 CONFIG_PCI=y
 CONFIG_MIPS32_O32=y
 CONFIG_MIPS32_N32=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_PARTITION_ADVANCED=y
arch/mips/configs/lemote2f_defconfig +0 -1
index 688c91918db2..aaf9d5e0aa2c 100644
@@ -21,7 +21,6 @@ CONFIG_MIPS32_O32=y
 CONFIG_MIPS32_N32=y
 CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION="/dev/hda3"
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
arch/mips/configs/mtx1_defconfig +0 -1
index bbe0f39f8088..205d3b34528c 100644
@@ -17,7 +17,6 @@ CONFIG_PCCARD=m
 CONFIG_YENTA=m
 CONFIG_PD6729=m
 CONFIG_I82092=m
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
arch/mips/configs/rs90_defconfig +0 -1
index 4f540bb94628..7ce3b814fdc8 100644
@@ -30,7 +30,6 @@ CONFIG_PM=y
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
 CONFIG_CPUFREQ_DT=y
-CONFIG_OPROFILE=y
 CONFIG_JUMP_LABEL=y
 # CONFIG_STACKPROTECTOR is not set
 # CONFIG_BLK_DEV_BSG is not set
arch/mips/include/asm/mach-loongson2ef/loongson.h +0 -9
index 57e571128489..ca039b8dcde3 100644
@@ -56,15 +56,6 @@ extern int mach_i8259_irq(void);
 	(*(volatile u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
 
 #define LOONGSON_IRQ_BASE	32
-#define LOONGSON2_PERFCNT_IRQ	(MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
-
-#include <linux/interrupt.h>
-static inline void do_perfcnt_IRQ(void)
-{
-#if IS_ENABLED(CONFIG_OPROFILE)
-	do_IRQ(LOONGSON2_PERFCNT_IRQ);
-#endif
-}
 
 #define LOONGSON_FLASH_BASE	0x1c000000
 #define LOONGSON_FLASH_SIZE	0x02000000	/* 32M */
arch/mips/loongson2ef/fuloong-2e/irq.c +1 -1
index 305aa2eb74ad..b1c9d4ee0335 100644
@@ -26,7 +26,7 @@ asmlinkage void mach_irq_dispatch(unsigned int pending)
 	if (pending & CAUSEF_IP7)
 		do_IRQ(MIPS_CPU_IRQ_BASE + 7);
 	else if (pending & CAUSEF_IP6) /* perf counter loverflow */
-		do_perfcnt_IRQ();
+		return;
 	else if (pending & CAUSEF_IP5)
 		i8259_irqdispatch();
 	else if (pending & CAUSEF_IP2)
arch/mips/loongson2ef/lemote-2f/irq.c +0 -1
index 6f00579971a3..f5a731a2a35f 100644
@@ -75,7 +75,6 @@ void mach_irq_dispatch(unsigned int pending)
 	if (pending & CAUSEF_IP7)
 		do_IRQ(LOONGSON_TIMER_IRQ);
 	else if (pending & CAUSEF_IP6) {	/* North Bridge, Perf counter */
-		do_perfcnt_IRQ();
 		bonito_irqdispatch();
 	} else if (pending & CAUSEF_IP3)	/* CPU UART */
 		do_IRQ(LOONGSON_UART_IRQ);
arch/mips/oprofile/Makefile deleted +0 -18
deleted file mode 100644
index e10f216d0422..000000000000
@@ -1,18 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y				:= $(DRIVER_OBJS) common.o backtrace.o
-
-oprofile-$(CONFIG_CPU_MIPS32)		+= op_model_mipsxx.o
-oprofile-$(CONFIG_CPU_MIPS64)		+= op_model_mipsxx.o
-oprofile-$(CONFIG_CPU_R10000)		+= op_model_mipsxx.o
-oprofile-$(CONFIG_CPU_SB1)		+= op_model_mipsxx.o
-oprofile-$(CONFIG_CPU_XLR)		+= op_model_mipsxx.o
-oprofile-$(CONFIG_CPU_LOONGSON2EF)	+= op_model_loongson2.o
-oprofile-$(CONFIG_CPU_LOONGSON64)	+= op_model_loongson3.o
arch/mips/oprofile/backtrace.c deleted +0 -177

177 lines not on this page · raw message

arch/mips/oprofile/common.c deleted +0 -147

147 lines not on this page · raw message

arch/mips/oprofile/op_impl.h deleted +0 -41

41 lines not on this page · raw message

arch/mips/oprofile/op_model_loongson2.c deleted +0 -161

161 lines not on this page · raw message

arch/mips/oprofile/op_model_loongson3.c deleted +0 -213

213 lines not on this page · raw message

arch/mips/oprofile/op_model_mipsxx.c deleted +0 -479

479 lines not on this page · raw message

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#9 lore raw

PATCH 6/18 arch: ia64: Remove rest of perfmon support

In reply to Viresh Kumar

Perfmon support (used by oprofile earlier) was removed by commit ecf5b72d5f66 ("ia64: Remove perfmon") earlier, but it missed few files to remove/update.

Clean it up.

---
 arch/ia64/include/asm/hw_irq.h                |   1 -
 arch/ia64/include/asm/perfmon.h               | 111 -------
 arch/ia64/include/uapi/asm/perfmon.h          | 178 -----------
 .../include/uapi/asm/perfmon_default_smpl.h   |  84 -----
 arch/ia64/kernel/palinfo.c                    |  41 ---
 arch/ia64/kernel/perfmon_default_smpl.c       | 297 ------------------
 arch/ia64/kernel/perfmon_generic.h            |  46 ---
 arch/ia64/kernel/perfmon_itanium.h            |   2 +-
 arch/ia64/kernel/perfmon_mckinley.h           | 188 -----------
 arch/ia64/kernel/perfmon_montecito.h          | 270 ----------------
 usr/include/Makefile                          |   2 -
 11 files changed, 1 insertion(+), 1219 deletions(-)
 delete mode 100644 arch/ia64/include/asm/perfmon.h
 delete mode 100644 arch/ia64/include/uapi/asm/perfmon.h
 delete mode 100644 arch/ia64/include/uapi/asm/perfmon_default_smpl.h
 delete mode 100644 arch/ia64/kernel/perfmon_default_smpl.c
 delete mode 100644 arch/ia64/kernel/perfmon_generic.h
 delete mode 100644 arch/ia64/kernel/perfmon_mckinley.h
 delete mode 100644 arch/ia64/kernel/perfmon_montecito.h
arch/ia64/include/asm/hw_irq.h +0 -1
index f6ff95b4ecb1..5d267132f8cb 100644
@@ -69,7 +69,6 @@ extern int ia64_last_device_vector;
 #define IA64_NUM_DEVICE_VECTORS		(IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1)
 
 #define IA64_MCA_RENDEZ_VECTOR		0xe8	/* MCA rendez interrupt */
-#define IA64_PERFMON_VECTOR		0xee	/* performance monitor interrupt vector */
 #define IA64_TIMER_VECTOR		0xef	/* use highest-prio group 15 interrupt for timer */
 #define	IA64_MCA_WAKEUP_VECTOR		0xf0	/* MCA wakeup (must be >MCA_RENDEZ_VECTOR) */
 #define IA64_IPI_LOCAL_TLB_FLUSH	0xfc	/* SMP flush local TLB */
arch/ia64/include/asm/perfmon.h deleted +0 -111

111 lines not on this page · raw message

arch/ia64/include/uapi/asm/perfmon.h deleted +0 -178

178 lines not on this page · raw message

arch/ia64/include/uapi/asm/perfmon_default_smpl.h deleted +0 -84

84 lines not on this page · raw message

arch/ia64/kernel/palinfo.c +0 -41

53 lines not on this page · raw message

arch/ia64/kernel/perfmon_default_smpl.c deleted +0 -297

297 lines not on this page · raw message

arch/ia64/kernel/perfmon_generic.h deleted +0 -46

46 lines not on this page · raw message

arch/ia64/kernel/perfmon_itanium.h +1 -1
index f2d348648a03..dbd04028aafa 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
  * This file contains the Itanium PMU register description tables
- * and pmc checker used by perfmon.c.
+ * and pmc checker.
  *
  * Copyright (C) 2002-2003  Hewlett Packard Co
  *               Stephane Eranian <[email protected]>
arch/ia64/kernel/perfmon_mckinley.h deleted +0 -188

188 lines not on this page · raw message

arch/ia64/kernel/perfmon_montecito.h deleted +0 -270

270 lines not on this page · raw message

usr/include/Makefile +0 -2
index f6b3c85d900e..1c2ae1368079 100644
@@ -67,8 +67,6 @@ endif
 ifeq ($(SRCARCH),ia64)
 no-header-test += asm/setup.h
 no-header-test += asm/sigcontext.h
-no-header-test += asm/perfmon.h
-no-header-test += asm/perfmon_default_smpl.h
 no-header-test += linux/if_bonding.h
 endif
 
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#13 lore raw

PATCH 9/18 arch: parisc: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/parisc/Kconfig           |  1 -
 arch/parisc/Makefile          |  2 --
 arch/parisc/oprofile/Makefile | 10 ----------
 arch/parisc/oprofile/init.c   | 23 -----------------------
 4 files changed, 36 deletions(-)
 delete mode 100644 arch/parisc/oprofile/Makefile
 delete mode 100644 arch/parisc/oprofile/init.c
arch/parisc/Kconfig +0 -1
index 78b17621ee4a..c2216e53fa81 100644
@@ -4,7 +4,6 @@ config PARISC
 	select ARCH_32BIT_OFF_T if !64BIT
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select HAVE_IDE
-	select HAVE_OPROFILE
 	select HAVE_FUNCTION_TRACER
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_SYSCALL_TRACEPOINTS
arch/parisc/Makefile +0 -2
index 5140c602207f..7d9f71aa829a 100644
@@ -116,8 +116,6 @@ kernel-y			:= mm/ kernel/ math-emu/
 core-y	+= $(addprefix arch/parisc/, $(kernel-y))
 libs-y	+= arch/parisc/lib/ $(LIBGCC)
 
-drivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
-
 boot	:= arch/parisc/boot
 
 PALO := $(shell if (which palo 2>&1); then : ; \
arch/parisc/oprofile/Makefile deleted +0 -10
deleted file mode 100644
index 86a1ccc328eb..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y				:= $(DRIVER_OBJS) init.o
arch/parisc/oprofile/init.c deleted +0 -23
deleted file mode 100644
index 026cba2af07a..000000000000
@@ -1,23 +0,0 @@
-/**
- * @file init.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/oprofile.h>
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	return -ENODEV;
-}
-
-
-void oprofile_arch_exit(void)
-{
-}
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#14 lore raw

PATCH 10/18 arch: powerpc: Stop building and using oprofile

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

This commits stops building oprofile for powerpc and removes any reference to it from directories in arch/powerpc/ apart from arch/powerpc/oprofile, which will be removed in the next commit (this is broken into two commits as the size of the commit became very big, ~5k lines).

Note that the member "oprofile_cpu_type" in "struct cpu_spec" isn't removed as it was also used by other parts of the code.

---
 arch/powerpc/Kconfig                          |   1 -
 arch/powerpc/Makefile                         |   2 -
 arch/powerpc/configs/44x/akebono_defconfig    |   1 -
 arch/powerpc/configs/44x/currituck_defconfig  |   1 -
 arch/powerpc/configs/44x/fsp2_defconfig       |   1 -
 arch/powerpc/configs/44x/iss476-smp_defconfig |   1 -
 arch/powerpc/configs/cell_defconfig           |   1 -
 arch/powerpc/configs/g5_defconfig             |   1 -
 arch/powerpc/configs/maple_defconfig          |   1 -
 arch/powerpc/configs/pasemi_defconfig         |   1 -
 arch/powerpc/configs/pmac32_defconfig         |   1 -
 arch/powerpc/configs/powernv_defconfig        |   1 -
 arch/powerpc/configs/ppc64_defconfig          |   1 -
 arch/powerpc/configs/ppc64e_defconfig         |   1 -
 arch/powerpc/configs/ppc6xx_defconfig         |   1 -
 arch/powerpc/configs/ps3_defconfig            |   1 -
 arch/powerpc/configs/pseries_defconfig        |   1 -
 arch/powerpc/include/asm/cputable.h           |  20 ---
 arch/powerpc/include/asm/oprofile_impl.h      | 135 ------------------
 arch/powerpc/include/asm/spu.h                |  33 -----
 arch/powerpc/kernel/cputable.c                |  67 ---------
 arch/powerpc/kernel/dt_cpu_ftrs.c             |   2 -
 arch/powerpc/platforms/cell/Kconfig           |   5 -
 arch/powerpc/platforms/cell/spu_notify.c      |  55 -------
 arch/powerpc/platforms/cell/spufs/run.c       |   4 +-
 arch/powerpc/platforms/cell/spufs/sched.c     |   5 -
 arch/powerpc/platforms/cell/spufs/spufs.h     |   1 -
 27 files changed, 1 insertion(+), 344 deletions(-)
 delete mode 100644 arch/powerpc/include/asm/oprofile_impl.h
 delete mode 100644 arch/powerpc/platforms/cell/spu_notify.c
arch/powerpc/Kconfig +0 -1
index 107bb4319e0e..1897c0ff2f2b 100644
@@ -226,7 +226,6 @@ config PPC
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI				if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
 	select HAVE_HARDLOCKUP_DETECTOR_ARCH	if (PPC64 && PPC_BOOK3S)
-	select HAVE_OPROFILE
 	select HAVE_OPTPROBES			if PPC64
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_EVENTS_NMI		if PPC64
arch/powerpc/Makefile +0 -2
index 08cf0eade56a..b959fdaec713 100644
@@ -276,8 +276,6 @@ head-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE)  += arch/powerpc/kernel/prom_init.o
 # See arch/powerpc/Kbuild for content of core part of the kernel
 core-y += arch/powerpc/
 
-drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
-
 # Default to zImage, override when needed
 all: zImage
 
arch/powerpc/configs/44x/akebono_defconfig +0 -1
index 3894ba8f8ffc..72b8f93a9bdd 100644
@@ -8,7 +8,6 @@ CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_SLUB_CPU_PARTIAL is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/powerpc/configs/44x/currituck_defconfig +0 -1
index 34c86b3abecb..717827219921 100644
@@ -6,7 +6,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/powerpc/configs/44x/fsp2_defconfig +0 -1
index 30845ce0885a..8da316e61a08 100644
@@ -17,7 +17,6 @@ CONFIG_KALLSYMS_ALL=y
 CONFIG_BPF_SYSCALL=y
 CONFIG_EMBEDDED=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/powerpc/configs/44x/iss476-smp_defconfig +0 -1
index 2c3834eebca3..c11e777b2f3d 100644
@@ -7,7 +7,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/powerpc/configs/cell_defconfig +0 -1
index 42fbc70cec33..cc2c0d51f493 100644
@@ -14,7 +14,6 @@ CONFIG_CPUSETS=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_PARTITION_ADVANCED=y
arch/powerpc/configs/g5_defconfig +0 -1
index 1de0dbf6cbba..63d611cc160f 100644
@@ -12,7 +12,6 @@ CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
arch/powerpc/configs/maple_defconfig +0 -1
index 161351a18517..9424c1e67e1c 100644
@@ -9,7 +9,6 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/powerpc/configs/pasemi_defconfig +0 -1
index 15ed8d0aa014..78606b7e42df 100644
@@ -7,7 +7,6 @@ CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/powerpc/configs/pmac32_defconfig +0 -1
index 665a8d7cded0..7aefac5afab0 100644
@@ -10,7 +10,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
arch/powerpc/configs/powernv_defconfig +0 -1
index 60a30fffeda0..2c87e856d839 100644
@@ -30,7 +30,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_BPF_SYSCALL=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
arch/powerpc/configs/ppc64_defconfig +0 -1
index 48759656a067..4f05a6652478 100644
@@ -62,7 +62,6 @@ CONFIG_VIRTUALIZATION=y
 CONFIG_KVM_BOOK3S_64=m
 CONFIG_KVM_BOOK3S_64_HV=m
 CONFIG_VHOST_NET=m
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
arch/powerpc/configs/ppc64e_defconfig +0 -1
index 33a01a9e86be..5cf49a515f8e 100644
@@ -14,7 +14,6 @@ CONFIG_CPUSETS=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
arch/powerpc/configs/ppc6xx_defconfig +0 -1
index ef09f3cce1fa..10c055eaebf0 100644
@@ -19,7 +19,6 @@ CONFIG_USER_NS=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/powerpc/configs/ps3_defconfig +0 -1
index 142f1321fa58..f300dcb937cc 100644
@@ -13,7 +13,6 @@ CONFIG_EMBEDDED=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_PPC_POWERNV is not set
arch/powerpc/configs/pseries_defconfig +0 -1
index d5dece981c02..777221775c83 100644
@@ -29,7 +29,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_BPF_SYSCALL=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
arch/powerpc/include/asm/cputable.h +0 -20
index 5f21a5bab467..e85c849214a2 100644
@@ -17,16 +17,6 @@ struct cpu_spec;
 typedef	void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
 typedef	void (*cpu_restore_t)(void);
 
-enum powerpc_oprofile_type {
-	PPC_OPROFILE_INVALID = 0,
-	PPC_OPROFILE_RS64 = 1,
-	PPC_OPROFILE_POWER4 = 2,
-	PPC_OPROFILE_G4 = 3,
-	PPC_OPROFILE_FSL_EMB = 4,
-	PPC_OPROFILE_CELL = 5,
-	PPC_OPROFILE_PA6T = 6,
-};
-
 enum powerpc_pmc_type {
 	PPC_PMC_DEFAULT = 0,
 	PPC_PMC_IBM = 1,
@@ -83,16 +73,6 @@ struct cpu_spec {
 	/* Used by oprofile userspace to select the right counters */
 	char		*oprofile_cpu_type;
 
-	/* Processor specific oprofile operations */
-	enum powerpc_oprofile_type oprofile_type;
-
-	/* Bit locations inside the mmcra change */
-	unsigned long	oprofile_mmcra_sihv;
-	unsigned long	oprofile_mmcra_sipr;
-
-	/* Bits to clear during an oprofile exception */
-	unsigned long	oprofile_mmcra_clear;
-
 	/* Name of processor class, for the ELF AT_PLATFORM entry */
 	char		*platform;
 
arch/powerpc/include/asm/oprofile_impl.h deleted +0 -135

135 lines not on this page · raw message

arch/powerpc/include/asm/spu.h +0 -33
index 9666491bcb8a..8a2d11ba0dae 100644
@@ -201,20 +201,6 @@ int spu_64k_pages_available(void);
 struct mm_struct;
 extern void spu_flush_all_slbs(struct mm_struct *mm);
 
-/* This interface allows a profiler (e.g., OProfile) to store a ref
- * to spu context information that it creates.	This caching technique
- * avoids the need to recreate this information after a save/restore operation.
- *
- * Assumes the caller has already incremented the ref count to
- * profile_info; then spu_context_destroy must call kref_put
- * on prof_info_kref.
- */
-void spu_set_profile_private_kref(struct spu_context *ctx,
-				  struct kref *prof_info_kref,
-				  void ( * prof_info_release) (struct kref *kref));
-
-void *spu_get_profile_private_kref(struct spu_context *ctx);
-
 /* system callbacks from the SPU */
 struct spu_syscall_block {
 	u64 nr_ret;
@@ -266,25 +252,6 @@ void spu_remove_dev_attr(struct device_attribute *attr);
 int spu_add_dev_attr_group(struct attribute_group *attrs);
 void spu_remove_dev_attr_group(struct attribute_group *attrs);
 
-/*
- * Notifier blocks:
- *
- * oprofile can get notified when a context switch is performed
- * on an spe. The notifer function that gets called is passed
- * a pointer to the SPU structure as well as the object-id that
- * identifies the binary running on that SPU now.
- *
- * For a context save, the object-id that is passed is zero,
- * identifying that the kernel will run from that moment on.
- *
- * For a context restore, the object-id is the value written
- * to object-id spufs file from user space and the notifer
- * function can assume that spu->ctx is valid.
- */
-struct notifier_block;
-int spu_switch_event_register(struct notifier_block * n);
-int spu_switch_event_unregister(struct notifier_block * n);
-
 extern void notify_spus_active(void);
 extern void do_notify_spus_active(void);
 
arch/powerpc/kernel/cputable.c +0 -67

373 lines not on this page · raw message

arch/powerpc/kernel/dt_cpu_ftrs.c +0 -2
index b5478b72c08c..358aee7c2d79 100644
@@ -19,7 +19,6 @@
 #include <asm/dt_cpu_ftrs.h>
 #include <asm/mce.h>
 #include <asm/mmu.h>
-#include <asm/oprofile_impl.h>
 #include <asm/prom.h>
 #include <asm/setup.h>
 
@@ -103,7 +102,6 @@ static struct cpu_spec __initdata base_cpu_spec = {
 	.num_pmcs		= 0,
 	.pmc_type		= PPC_PMC_DEFAULT,
 	.oprofile_cpu_type	= NULL,
-	.oprofile_type		= PPC_OPROFILE_INVALID,
 	.cpu_setup		= NULL,
 	.cpu_restore		= __restore_cpu_cpufeatures,
 	.machine_check_early	= NULL,
arch/powerpc/platforms/cell/Kconfig +0 -5
index f2ff359041ee..e7c976bcadff 100644
@@ -100,8 +100,3 @@ config CBE_CPUFREQ_SPU_GOVERNOR
 	  the minimal possible frequency.
 
 endmenu
-
-config OPROFILE_CELL
-	def_bool y
-	depends on PPC_CELL_NATIVE && (OPROFILE = m || OPROFILE = y) && SPU_BASE
-
arch/powerpc/platforms/cell/spu_notify.c deleted +0 -55

55 lines not on this page · raw message

arch/powerpc/platforms/cell/spufs/run.c +1 -3
index 3f2380f40f99..466006918003 100644
@@ -389,10 +389,8 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
 		spu = ctx->spu;
 		if (unlikely(test_and_clear_bit(SPU_SCHED_NOTIFY_ACTIVE,
 						&ctx->sched_flags))) {
-			if (!(status & SPU_STATUS_STOPPED_BY_STOP)) {
-				spu_switch_notify(spu, ctx);
+			if (!(status & SPU_STATUS_STOPPED_BY_STOP))
 				continue;
-			}
 		}
 
 		spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
arch/powerpc/platforms/cell/spufs/sched.c +0 -5
index f18d5067cd0f..9d06fffb1526 100644
@@ -181,9 +181,6 @@ void do_notify_spus_active(void)
 
 	/*
 	 * Wake up the active spu_contexts.
-	 *
-	 * When the awakened processes see their "notify_active" flag is set,
-	 * they will call spu_switch_notify().
 	 */
 	for_each_online_node(node) {
 		struct spu *spu;
@@ -239,7 +236,6 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
 	spu_switch_log_notify(spu, ctx, SWITCH_LOG_START, 0);
 	spu_restore(&ctx->csa, spu);
 	spu->timestamp = jiffies;
-	spu_switch_notify(spu, ctx);
 	ctx->state = SPU_STATE_RUNNABLE;
 
 	spuctx_switch_state(ctx, SPU_UTIL_USER);
@@ -440,7 +436,6 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx)
 		 */
 		atomic_dec_if_positive(&ctx->gang->aff_sched_count);
 
-	spu_switch_notify(spu, NULL);
 	spu_unmap_mappings(ctx);
 	spu_save(&ctx->csa, spu);
 	spu_switch_log_notify(spu, ctx, SWITCH_LOG_STOP, 0);
arch/powerpc/platforms/cell/spufs/spufs.h +0 -1
index 1ba4d884febf..afc1d6604d12 100644
@@ -281,7 +281,6 @@ void spu_del_from_rq(struct spu_context *ctx);
 int spu_activate(struct spu_context *ctx, unsigned long flags);
 void spu_deactivate(struct spu_context *ctx);
 void spu_yield(struct spu_context *ctx);
-void spu_switch_notify(struct spu *spu, struct spu_context *ctx);
 void spu_switch_log_notify(struct spu *spu, struct spu_context *ctx,
 		u32 type, u32 val);
 void spu_set_timeslice(struct spu_context *ctx);
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#18 lore raw

PATCH 11/18 arch: powerpc: Remove oprofile

In reply to Viresh Kumar

The previous commit already disabled building oprofile, lets remove the oprofile directory now.

---
 arch/powerpc/oprofile/Makefile             |   19 -
 arch/powerpc/oprofile/backtrace.c          |  120 --
 arch/powerpc/oprofile/cell/pr_util.h       |  110 --
 arch/powerpc/oprofile/cell/spu_profiler.c  |  248 ---
 arch/powerpc/oprofile/cell/spu_task_sync.c |  657 --------
 arch/powerpc/oprofile/cell/vma_map.c       |  279 ----
 arch/powerpc/oprofile/common.c             |  243 ---
 arch/powerpc/oprofile/op_model_7450.c      |  207 ---
 arch/powerpc/oprofile/op_model_cell.c      | 1709 --------------------
 arch/powerpc/oprofile/op_model_fsl_emb.c   |  380 -----
 arch/powerpc/oprofile/op_model_pa6t.c      |  227 ---
 arch/powerpc/oprofile/op_model_power4.c    |  438 -----
 12 files changed, 4637 deletions(-)
 delete mode 100644 arch/powerpc/oprofile/Makefile
 delete mode 100644 arch/powerpc/oprofile/backtrace.c
 delete mode 100644 arch/powerpc/oprofile/cell/pr_util.h
 delete mode 100644 arch/powerpc/oprofile/cell/spu_profiler.c
 delete mode 100644 arch/powerpc/oprofile/cell/spu_task_sync.c
 delete mode 100644 arch/powerpc/oprofile/cell/vma_map.c
 delete mode 100644 arch/powerpc/oprofile/common.c
 delete mode 100644 arch/powerpc/oprofile/op_model_7450.c
 delete mode 100644 arch/powerpc/oprofile/op_model_cell.c
 delete mode 100644 arch/powerpc/oprofile/op_model_fsl_emb.c
 delete mode 100644 arch/powerpc/oprofile/op_model_pa6t.c
 delete mode 100644 arch/powerpc/oprofile/op_model_power4.c
arch/powerpc/oprofile/Makefile deleted +0 -19
deleted file mode 100644
index bb2d94c8cbe6..000000000000
@@ -1,19 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-ccflags-$(CONFIG_PPC64)	:= $(NO_MINIMAL_TOC)
-
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
-oprofile-$(CONFIG_OPROFILE_CELL) += op_model_cell.o \
-		cell/spu_profiler.o cell/vma_map.o \
-		cell/spu_task_sync.o
-oprofile-$(CONFIG_PPC_BOOK3S_64) += op_model_power4.o op_model_pa6t.o
-oprofile-$(CONFIG_FSL_EMB_PERFMON) += op_model_fsl_emb.o
-oprofile-$(CONFIG_PPC_BOOK3S_32) += op_model_7450.o
arch/powerpc/oprofile/backtrace.c deleted +0 -120

120 lines not on this page · raw message

arch/powerpc/oprofile/cell/pr_util.h deleted +0 -110

110 lines not on this page · raw message

arch/powerpc/oprofile/cell/spu_profiler.c deleted +0 -248

248 lines not on this page · raw message

arch/powerpc/oprofile/cell/spu_task_sync.c deleted +0 -657

657 lines not on this page · raw message

arch/powerpc/oprofile/cell/vma_map.c deleted +0 -279

279 lines not on this page · raw message

arch/powerpc/oprofile/common.c deleted +0 -243

243 lines not on this page · raw message

arch/powerpc/oprofile/op_model_7450.c deleted +0 -207

207 lines not on this page · raw message

arch/powerpc/oprofile/op_model_cell.c deleted +0 -1709

1,117 lines not on this page · raw message

arch/powerpc/oprofile/op_model_fsl_emb.c deleted +0 -380

380 lines not on this page · raw message

arch/powerpc/oprofile/op_model_pa6t.c deleted +0 -227

227 lines not on this page · raw message

arch/powerpc/oprofile/op_model_power4.c deleted +0 -438

438 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af

Part of the diff is not shown here. View the raw message.

#26 lore raw

PATCH 17/18 drivers: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove kernel's old oprofile support.

---
 Documentation/RCU/NMI-RCU.rst                 |   3 +-
 .../admin-guide/kernel-parameters.txt         |  14 -
 Documentation/process/magic-number.rst        |   1 -
 .../it_IT/process/magic-number.rst            |   1 -
 .../zh_CN/process/magic-number.rst            |   1 -
 MAINTAINERS                                   |  11 -
 arch/Kconfig                                  |  32 -
 drivers/oprofile/buffer_sync.c                | 591 ------------------
 drivers/oprofile/buffer_sync.h                |  22 -
 drivers/oprofile/cpu_buffer.c                 | 465 --------------
 drivers/oprofile/cpu_buffer.h                 | 121 ----
 drivers/oprofile/event_buffer.c               | 209 -------
 drivers/oprofile/event_buffer.h               |  40 --
 drivers/oprofile/nmi_timer_int.c              | 157 -----
 drivers/oprofile/oprof.c                      | 286 ---------
 drivers/oprofile/oprof.h                      |  50 --
 drivers/oprofile/oprofile_files.c             | 201 ------
 drivers/oprofile/oprofile_perf.c              | 328 ----------
 drivers/oprofile/oprofile_stats.c             |  84 ---
 drivers/oprofile/oprofile_stats.h             |  33 -
 drivers/oprofile/oprofilefs.c                 | 300 ---------
 drivers/oprofile/timer_int.c                  | 122 ----
 include/linux/oprofile.h                      | 209 -------
 init/Kconfig                                  |   2 +-
 24 files changed, 2 insertions(+), 3281 deletions(-)
 delete mode 100644 drivers/oprofile/buffer_sync.c
 delete mode 100644 drivers/oprofile/buffer_sync.h
 delete mode 100644 drivers/oprofile/cpu_buffer.c
 delete mode 100644 drivers/oprofile/cpu_buffer.h
 delete mode 100644 drivers/oprofile/event_buffer.c
 delete mode 100644 drivers/oprofile/event_buffer.h
 delete mode 100644 drivers/oprofile/nmi_timer_int.c
 delete mode 100644 drivers/oprofile/oprof.c
 delete mode 100644 drivers/oprofile/oprof.h
 delete mode 100644 drivers/oprofile/oprofile_files.c
 delete mode 100644 drivers/oprofile/oprofile_perf.c
 delete mode 100644 drivers/oprofile/oprofile_stats.c
 delete mode 100644 drivers/oprofile/oprofile_stats.h
 delete mode 100644 drivers/oprofile/oprofilefs.c
 delete mode 100644 drivers/oprofile/timer_int.c
 delete mode 100644 include/linux/oprofile.h
Documentation/RCU/NMI-RCU.rst +1 -2
index 180958388ff9..2a92bc685ef1 100644
@@ -8,8 +8,7 @@ Although RCU is usually used to protect read-mostly data structures,
 it is possible to use RCU to provide dynamic non-maskable interrupt
 handlers, as well as dynamic irq handlers.  This document describes
 how to do this, drawing loosely from Zwane Mwaikambo's NMI-timer
-work in "arch/x86/oprofile/nmi_timer_int.c" and in
-"arch/x86/kernel/traps.c".
+work in "arch/x86/kernel/traps.c".
 
 The relevant pieces of code are listed below, each followed by a
 brief explanation::
Documentation/admin-guide/kernel-parameters.txt +0 -14
index 9e3cdb271d06..e860c681766b 100644
@@ -3458,20 +3458,6 @@
 			For example, to override I2C bus2:
 			omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100
 
-	oprofile.timer=	[HW]
-			Use timer interrupt instead of performance counters
-
-	oprofile.cpu_type=	Force an oprofile cpu type
-			This might be useful if you have an older oprofile
-			userland or if you want common events.
-			Format: { arch_perfmon }
-			arch_perfmon: [X86] Force use of architectural
-				perfmon on Intel CPUs instead of the
-				CPU specific event set.
-			timer: [X86] Force use of architectural NMI
-				timer mode (see also oprofile.timer
-				for generic hr timer mode)
-
 	oops=panic	Always panic on oopses. Default is to just kill the
 			process, but there is a small probability of
 			deadlocking the machine.
Documentation/process/magic-number.rst +0 -1
index e02ff5ffb653..c6dfe060ec2f 100644
@@ -135,7 +135,6 @@ FW_HEADER_MAGIC       0x65726F66       fw_header                ``drivers/atm/fo
 SLOT_MAGIC            0x67267321       slot                     ``drivers/hotplug/cpqphp.h``
 SLOT_MAGIC            0x67267322       slot                     ``drivers/hotplug/acpiphp.h``
 LO_MAGIC              0x68797548       nbd_device               ``include/linux/nbd.h``
-OPROFILE_MAGIC        0x6f70726f       super_block              ``drivers/oprofile/oprofilefs.h``
 M3_STATE_MAGIC        0x734d724d       m3_state                 ``sound/oss/maestro3.c``
 VMALLOC_MAGIC         0x87654320       snd_alloc_track          ``sound/core/memory.c``
 KMALLOC_MAGIC         0x87654321       snd_alloc_track          ``sound/core/memory.c``
Documentation/translations/it_IT/process/magic-number.rst +0 -1
index 0243d32a0b59..1af30f4228f2 100644
@@ -141,7 +141,6 @@ FW_HEADER_MAGIC       0x65726F66       fw_header                ``drivers/atm/fo
 SLOT_MAGIC            0x67267321       slot                     ``drivers/hotplug/cpqphp.h``
 SLOT_MAGIC            0x67267322       slot                     ``drivers/hotplug/acpiphp.h``
 LO_MAGIC              0x68797548       nbd_device               ``include/linux/nbd.h``
-OPROFILE_MAGIC        0x6f70726f       super_block              ``drivers/oprofile/oprofilefs.h``
 M3_STATE_MAGIC        0x734d724d       m3_state                 ``sound/oss/maestro3.c``
 VMALLOC_MAGIC         0x87654320       snd_alloc_track          ``sound/core/memory.c``
 KMALLOC_MAGIC         0x87654321       snd_alloc_track          ``sound/core/memory.c``
Documentation/translations/zh_CN/process/magic-number.rst +0 -1
index de182bf4191c..7bb9d4165ed3 100644
@@ -124,7 +124,6 @@ FW_HEADER_MAGIC       0x65726F66       fw_header                ``drivers/atm/fo
 SLOT_MAGIC            0x67267321       slot                     ``drivers/hotplug/cpqphp.h``
 SLOT_MAGIC            0x67267322       slot                     ``drivers/hotplug/acpiphp.h``
 LO_MAGIC              0x68797548       nbd_device               ``include/linux/nbd.h``
-OPROFILE_MAGIC        0x6f70726f       super_block              ``drivers/oprofile/oprofilefs.h``
 M3_STATE_MAGIC        0x734d724d       m3_state                 ``sound/oss/maestro3.c``
 VMALLOC_MAGIC         0x87654320       snd_alloc_track          ``sound/core/memory.c``
 KMALLOC_MAGIC         0x87654321       snd_alloc_track          ``sound/core/memory.c``
MAINTAINERS +0 -11
index cc1e6a5ee6e6..ae2c2cef9d96 100644
@@ -1414,7 +1414,6 @@ F:	arch/arm*/include/asm/hw_breakpoint.h
 F:	arch/arm*/include/asm/perf_event.h
 F:	arch/arm*/kernel/hw_breakpoint.c
 F:	arch/arm*/kernel/perf_*
-F:	arch/arm/oprofile/common.c
 F:	drivers/perf/
 F:	include/linux/perf/arm_pmu.h
 
@@ -4083,7 +4082,6 @@ W:	http://www.ibm.com/developerworks/power/cell/
 F:	arch/powerpc/include/asm/cell*.h
 F:	arch/powerpc/include/asm/spu*.h
 F:	arch/powerpc/include/uapi/asm/spu*.h
-F:	arch/powerpc/oprofile/*cell*
 F:	arch/powerpc/platforms/cell/
 
 CELLWISE CW2015 BATTERY DRIVER
@@ -13311,15 +13309,6 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
 F:	sound/drivers/opl4/
 
-OPROFILE
-M:	Robert Richter <[email protected]>
-L:	[email protected]
-S:	Maintained
-F:	arch/*/include/asm/oprofile*.h
-F:	arch/*/oprofile/
-F:	drivers/oprofile/
-F:	include/linux/oprofile.h
-
 ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
 M:	Mark Fasheh <[email protected]>
 M:	Joel Becker <[email protected]>
arch/Kconfig +0 -32
index 24862d15f3a3..40277027a255 100644
@@ -33,38 +33,6 @@ config HOTPLUG_SMT
 config GENERIC_ENTRY
        bool
 
-config OPROFILE
-	tristate "OProfile system profiling"
-	depends on PROFILING
-	depends on HAVE_OPROFILE
-	select RING_BUFFER
-	select RING_BUFFER_ALLOW_SWAP
-	help
-	  OProfile is a profiling system capable of profiling the
-	  whole system, include the kernel, kernel modules, libraries,
-	  and applications.
-
-	  If unsure, say N.
-
-config OPROFILE_EVENT_MULTIPLEX
-	bool "OProfile multiplexing support (EXPERIMENTAL)"
-	default n
-	depends on OPROFILE && X86
-	help
-	  The number of hardware counters is limited. The multiplexing
-	  feature enables OProfile to gather more events than counters
-	  are provided by the hardware. This is realized by switching
-	  between events at a user specified time interval.
-
-	  If unsure, say N.
-
-config HAVE_OPROFILE
-	bool
-
-config OPROFILE_NMI_TIMER
-	def_bool y
-	depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
-
 config KPROBES
 	bool "Kprobes"
 	depends on MODULES
drivers/oprofile/buffer_sync.c deleted +0 -591

591 lines not on this page · raw message

drivers/oprofile/buffer_sync.h deleted +0 -22
deleted file mode 100644
index 3110732c1835..000000000000
@@ -1,22 +0,0 @@
-/**
- * @file buffer_sync.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#ifndef OPROFILE_BUFFER_SYNC_H
-#define OPROFILE_BUFFER_SYNC_H
-
-/* add the necessary profiling hooks */
-int sync_start(void);
-
-/* remove the hooks */
-void sync_stop(void);
-
-/* sync the given CPU's buffer */
-void sync_buffer(int cpu);
-
-#endif /* OPROFILE_BUFFER_SYNC_H */
drivers/oprofile/cpu_buffer.c deleted +0 -465

465 lines not on this page · raw message

drivers/oprofile/cpu_buffer.h deleted +0 -121

121 lines not on this page · raw message

drivers/oprofile/event_buffer.c deleted +0 -209

209 lines not on this page · raw message

drivers/oprofile/event_buffer.h deleted +0 -40
deleted file mode 100644
index a8d5bb3cba89..000000000000
@@ -1,40 +0,0 @@
-/**
- * @file event_buffer.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#ifndef EVENT_BUFFER_H
-#define EVENT_BUFFER_H
-
-#include <linux/types.h>
-#include <linux/mutex.h>
-
-int alloc_event_buffer(void);
-
-void free_event_buffer(void);
-
-/**
- * Add data to the event buffer.
- * The data passed is free-form, but typically consists of
- * file offsets, dcookies, context information, and ESCAPE codes.
- */
-void add_event_entry(unsigned long data);
-
-/* wake up the process sleeping on the event file */
-void wake_up_buffer_waiter(void);
-
-#define INVALID_COOKIE ~0UL
-#define NO_COOKIE 0UL
-
-extern const struct file_operations event_buffer_fops;
-
-/* mutex between sync_cpu_buffers() and the
- * file reading code.
- */
-extern struct mutex buffer_mutex;
-
-#endif /* EVENT_BUFFER_H */
drivers/oprofile/nmi_timer_int.c deleted +0 -157

157 lines not on this page · raw message

drivers/oprofile/oprof.c deleted +0 -286

286 lines not on this page · raw message

drivers/oprofile/oprof.h deleted +0 -50

50 lines not on this page · raw message

drivers/oprofile/oprofile_files.c deleted +0 -201

201 lines not on this page · raw message

drivers/oprofile/oprofile_perf.c deleted +0 -328

328 lines not on this page · raw message

drivers/oprofile/oprofile_stats.c deleted +0 -84

84 lines not on this page · raw message

drivers/oprofile/oprofile_stats.h deleted +0 -33
deleted file mode 100644
index 1fc622bd1834..000000000000
@@ -1,33 +0,0 @@
-/**
- * @file oprofile_stats.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- */
-
-#ifndef OPROFILE_STATS_H
-#define OPROFILE_STATS_H
-
-#include <linux/atomic.h>
-
-struct oprofile_stat_struct {
-	atomic_t sample_lost_no_mm;
-	atomic_t sample_lost_no_mapping;
-	atomic_t bt_lost_no_mapping;
-	atomic_t event_lost_overflow;
-	atomic_t multiplex_counter;
-};
-
-extern struct oprofile_stat_struct oprofile_stats;
-
-/* reset all stats to zero */
-void oprofile_reset_stats(void);
-
-struct dentry;
-
-/* create the stats/ dir */
-void oprofile_create_stats_files(struct dentry *root);
-
-#endif /* OPROFILE_STATS_H */
drivers/oprofile/oprofilefs.c deleted +0 -300

296 lines not on this page · raw message

drivers/oprofile/timer_int.c deleted +0 -122

122 lines not on this page · raw message

include/linux/oprofile.h deleted +0 -209

209 lines not on this page · raw message

init/Kconfig +1 -1
index b77c60f8b963..03eb36256405 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af

Part of the diff is not shown here. View the raw message.

#21 lore raw

PATCH 13/18 arch: sh: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/sh/Kconfig                          |  1 -
 arch/sh/Makefile                         |  1 -
 arch/sh/configs/espt_defconfig           |  1 -
 arch/sh/configs/migor_defconfig          |  1 -
 arch/sh/configs/r7780mp_defconfig        |  1 -
 arch/sh/configs/r7785rp_defconfig        |  1 -
 arch/sh/configs/rsk7201_defconfig        |  1 -
 arch/sh/configs/rsk7203_defconfig        |  1 -
 arch/sh/configs/rts7751r2d1_defconfig    |  1 -
 arch/sh/configs/rts7751r2dplus_defconfig |  1 -
 arch/sh/configs/sdk7786_defconfig        |  1 -
 arch/sh/configs/se7206_defconfig         |  1 -
 arch/sh/configs/sh03_defconfig           |  1 -
 arch/sh/configs/sh7724_generic_defconfig |  1 -
 arch/sh/configs/sh7763rdp_defconfig      |  1 -
 arch/sh/configs/sh7770_generic_defconfig |  1 -
 arch/sh/configs/shx3_defconfig           |  1 -
 arch/sh/oprofile/Makefile                | 16 -----
 arch/sh/oprofile/backtrace.c             | 80 ------------------------
 arch/sh/oprofile/common.c                | 64 -------------------
 20 files changed, 177 deletions(-)
 delete mode 100644 arch/sh/oprofile/Makefile
 delete mode 100644 arch/sh/oprofile/backtrace.c
 delete mode 100644 arch/sh/oprofile/common.c
arch/sh/Kconfig +0 -1
index 5fa580219a86..1e64da1d1de6 100644
@@ -51,7 +51,6 @@ config SUPERH
 	select HAVE_MIXED_BREAKPOINTS_REGS
 	select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
 	select HAVE_NMI
-	select HAVE_OPROFILE
 	select HAVE_PATA_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_REGS_AND_STACK_ACCESS_API
arch/sh/Makefile +0 -1
index 2faebfd72eca..3bcbf52fb30e 100644
@@ -170,7 +170,6 @@ cpuincdir-$(CONFIG_CPU_SH4)	+= cpu-sh4
 cpuincdir-y			+= cpu-common	# Must be last
 
 drivers-y			+= arch/sh/drivers/
-drivers-$(CONFIG_OPROFILE)	+= arch/sh/oprofile/
 
 cflags-y	+= $(foreach d, $(cpuincdir-y), -I $(srctree)/arch/sh/include/$(d)) \
 		   $(foreach d, $(machdir-y), -I $(srctree)/arch/sh/include/$(d))
arch/sh/configs/espt_defconfig +0 -1
index 9a988c347e9d..2804cb760a76 100644
@@ -7,7 +7,6 @@ CONFIG_UTS_NS=y
 CONFIG_IPC_NS=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7763=y
arch/sh/configs/migor_defconfig +0 -1
index a24cf8cd2cea..4859cd30cfc4 100644
@@ -6,7 +6,6 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7722=y
arch/sh/configs/r7780mp_defconfig +0 -1
index e922659fdadb..f823cc6b18f9 100644
@@ -7,7 +7,6 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_EPOLL is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/sh/configs/r7785rp_defconfig +0 -1
index 5978866358ec..f96bc20d4b1a 100644
@@ -9,7 +9,6 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/sh/configs/rsk7201_defconfig +0 -1
index 841809b5c2dc..e41526120be1 100644
@@ -12,7 +12,6 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_AIO is not set
 CONFIG_SLOB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7201=y
arch/sh/configs/rsk7203_defconfig +0 -1
index 0055031664ad..6af08fa1ddf8 100644
@@ -13,7 +13,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLOB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7203=y
arch/sh/configs/rts7751r2d1_defconfig +0 -1
index fc9c22152b08..96263a4912b7 100644
@@ -3,7 +3,6 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7751R=y
arch/sh/configs/rts7751r2dplus_defconfig +0 -1
index ff3fd6787fd6..92e586e6c974 100644
@@ -3,7 +3,6 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7751R=y
arch/sh/configs/sdk7786_defconfig +0 -1
index 61bec46ebd66..e804347cf68c 100644
@@ -35,7 +35,6 @@ CONFIG_RD_LZO=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/sh/configs/se7206_defconfig +0 -1
index ff5bb4489922..315b04a8dd2f 100644
@@ -23,7 +23,6 @@ CONFIG_KALLSYMS_ALL=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLOB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
arch/sh/configs/sh03_defconfig +0 -1
index f0073ed39947..f0ce5b0057ed 100644
@@ -5,7 +5,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
arch/sh/configs/sh7724_generic_defconfig +0 -1
index 9adee9010319..2c46c0004780 100644
@@ -4,7 +4,6 @@ CONFIG_CGROUPS=y
 # CONFIG_UID16 is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7724=y
 CONFIG_NO_HZ=y
arch/sh/configs/sh7763rdp_defconfig +0 -1
index 26c5fd02c87a..8a6a446f9eb8 100644
@@ -7,7 +7,6 @@ CONFIG_UTS_NS=y
 CONFIG_IPC_NS=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7763=y
arch/sh/configs/sh7770_generic_defconfig +0 -1
index c17590f0df67..88193153e51b 100644
@@ -4,7 +4,6 @@ CONFIG_CGROUPS=y
 # CONFIG_UID16 is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_CPU_SUBTYPE_SH7770=y
 CONFIG_SH_PCLK_FREQ=41666666
arch/sh/configs/shx3_defconfig +0 -1
index dc2be2514b62..32ec6eb1eabc 100644
@@ -22,7 +22,6 @@ CONFIG_PID_NS=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLOB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/sh/oprofile/Makefile deleted +0 -16
deleted file mode 100644
index d478dd8dac0b..000000000000
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-CFLAGS_common.o	+= -DUTS_MACHINE='"$(UTS_MACHINE)"'
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-ifeq ($(CONFIG_HW_PERF_EVENTS),y)
-DRIVER_OBJS += $(addprefix ../../../drivers/oprofile/, oprofile_perf.o)
-endif
-
-oprofile-y	:= $(DRIVER_OBJS) common.o backtrace.o
arch/sh/oprofile/backtrace.c deleted +0 -80

80 lines not on this page · raw message

arch/sh/oprofile/common.c deleted +0 -64

64 lines not on this page · raw message

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#29 lore raw

PATCH 18/18 fs: Remove dcookies support

In reply to Viresh Kumar

The dcookies stuff was only used by the kernel's old oprofile code. Now that oprofile's support is removed from the kernel, there is no need for dcookies as well. Remove it.

---
 fs/Makefile              |   1 -
 fs/dcookies.c            | 356 ---------------------------------------
 include/linux/dcookies.h |  69 --------
 kernel/sys.c             |   1 -
 4 files changed, 427 deletions(-)
 delete mode 100644 fs/dcookies.c
 delete mode 100644 include/linux/dcookies.h
fs/Makefile +0 -1
index 999d1a23f036..3215fe205256 100644
@@ -64,7 +64,6 @@ obj-$(CONFIG_SYSFS)		+= sysfs/
 obj-$(CONFIG_CONFIGFS_FS)	+= configfs/
 obj-y				+= devpts/
 
-obj-$(CONFIG_PROFILING)		+= dcookies.o
 obj-$(CONFIG_DLM)		+= dlm/
  
 # Do not add any filesystems before this line
fs/dcookies.c deleted +0 -356

356 lines not on this page · raw message

include/linux/dcookies.h deleted +0 -69

69 lines not on this page · raw message

kernel/sys.c +0 -1
index 51f00fe20e4d..6928d23c46ea 100644
@@ -24,7 +24,6 @@
 #include <linux/times.h>
 #include <linux/posix-timers.h>
 #include <linux/security.h>
-#include <linux/dcookies.h>
 #include <linux/suspend.h>
 #include <linux/tty.h>
 #include <linux/signal.h>
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#22 lore raw

PATCH 14/18 arch: sparc: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 Documentation/kbuild/makefiles.rst   |  1 -
 arch/sparc/Kconfig                   |  1 -
 arch/sparc/Makefile                  |  1 -
 arch/sparc/configs/sparc64_defconfig |  1 -
 arch/sparc/oprofile/Makefile         | 10 ----
 arch/sparc/oprofile/init.c           | 87 ----------------------------
 6 files changed, 101 deletions(-)
 delete mode 100644 arch/sparc/oprofile/Makefile
 delete mode 100644 arch/sparc/oprofile/init.c
Documentation/kbuild/makefiles.rst +0 -1
index 9f6a11881951..d7b2e027c1f8 100644
@@ -1317,7 +1317,6 @@ a few targets.
 		libs-y                 += arch/sparc/lib/
 
 		drivers-$(CONFIG_PM) += arch/sparc/power/
-		drivers-$(CONFIG_OPROFILE)	+= arch/sparc/oprofile/
 
 7.5 Architecture-specific boot images
 -------------------------------------
arch/sparc/Kconfig +0 -1
index c9c34dc52b7d..caf95e61162b 100644
@@ -20,7 +20,6 @@ config SPARC
 	select OF_PROMTREE
 	select HAVE_ASM_MODVERSIONS
 	select HAVE_IDE
-	select HAVE_OPROFILE
 	select HAVE_ARCH_KGDB if !SMP || SPARC64
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_ARCH_SECCOMP if SPARC64
arch/sparc/Makefile +0 -1
index 4a0919581697..bee99e65fe23 100644
@@ -65,7 +65,6 @@ libs-y                 += arch/sparc/prom/
 libs-y                 += arch/sparc/lib/
 
 drivers-$(CONFIG_PM) += arch/sparc/power/
-drivers-$(CONFIG_OPROFILE)	+= arch/sparc/oprofile/
 
 boot := arch/sparc/boot
 
arch/sparc/configs/sparc64_defconfig +0 -1
index bde4d21a8ac8..d91eb6a76dd1 100644
@@ -8,7 +8,6 @@ CONFIG_PERF_EVENTS=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
arch/sparc/oprofile/Makefile deleted +0 -10
deleted file mode 100644
index fe906e403d3a..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y				:= $(DRIVER_OBJS) init.o
arch/sparc/oprofile/init.c deleted +0 -87

87 lines not on this page · raw message

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#24 lore raw

PATCH 16/18 arch: xtensa: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/xtensa/Kconfig                         |  1 -
 arch/xtensa/Makefile                        |  1 -
 arch/xtensa/configs/audio_kc705_defconfig   |  1 -
 arch/xtensa/configs/generic_kc705_defconfig |  1 -
 arch/xtensa/configs/smp_lx200_defconfig     |  1 -
 arch/xtensa/configs/xip_kc705_defconfig     |  1 -
 arch/xtensa/kernel/stacktrace.c             |  2 +-
 arch/xtensa/oprofile/Makefile               | 10 --------
 arch/xtensa/oprofile/backtrace.c            | 27 ---------------------
 arch/xtensa/oprofile/init.c                 | 26 --------------------
 10 files changed, 1 insertion(+), 70 deletions(-)
 delete mode 100644 arch/xtensa/oprofile/Makefile
 delete mode 100644 arch/xtensa/oprofile/backtrace.c
 delete mode 100644 arch/xtensa/oprofile/init.c
arch/xtensa/Kconfig +0 -1
index 37ce1489364e..9ad6b7b82707 100644
@@ -32,7 +32,6 @@ config XTENSA
 	select HAVE_FUTEX_CMPXCHG if !MMU
 	select HAVE_HW_BREAKPOINT if PERF_EVENTS
 	select HAVE_IRQ_TIME_ACCOUNTING
-	select HAVE_OPROFILE
 	select HAVE_PCI
 	select HAVE_PERF_EVENTS
 	select HAVE_STACKPROTECTOR
arch/xtensa/Makefile +0 -1
index 67a7d151d1e7..cf0940708702 100644
@@ -83,7 +83,6 @@ core-y		+= $(buildvar) $(buildplf)
 core-y 		+= arch/xtensa/boot/dts/
 
 libs-y		+= arch/xtensa/lib/ $(LIBGCC)
-drivers-$(CONFIG_OPROFILE)	+= arch/xtensa/oprofile/
 
 boot		:= arch/xtensa/boot
 
arch/xtensa/configs/audio_kc705_defconfig +0 -1
index eeb4c5383c83..3be62da8089b 100644
@@ -18,7 +18,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_XTENSA_VARIANT_CUSTOM=y
arch/xtensa/configs/generic_kc705_defconfig +0 -1
index 412f611033cc..e9d6b6f6eca1 100644
@@ -18,7 +18,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_XTENSA_VARIANT_DC233C=y
arch/xtensa/configs/smp_lx200_defconfig +0 -1
index 4f1c7998b030..a47c85638ec1 100644
@@ -18,7 +18,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_XTENSA_VARIANT_CUSTOM=y
arch/xtensa/configs/xip_kc705_defconfig +0 -1
index f9e85c082afc..4f1ff9531f6a 100644
@@ -31,7 +31,6 @@ CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0
 CONFIG_USE_OF=y
 CONFIG_BUILTIN_DTB_SOURCE="kc705"
 # CONFIG_PARSE_BOOTPARAM is not set
-CONFIG_OPROFILE=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 # CONFIG_COMPACTION is not set
 CONFIG_NET=y
arch/xtensa/kernel/stacktrace.c +1 -1
index c822abb93d20..7f7755cd28f0 100644
@@ -16,7 +16,7 @@
 #include <asm/traps.h>
 #include <linux/uaccess.h>
 
-#if IS_ENABLED(CONFIG_OPROFILE) || IS_ENABLED(CONFIG_PERF_EVENTS)
+#if IS_ENABLED(CONFIG_PERF_EVENTS)
 
 /* Address of common_exception_return, used to check the
  * transition from kernel to user space.
arch/xtensa/oprofile/Makefile deleted +0 -10
deleted file mode 100644
index f559b9ffbb3f..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
arch/xtensa/oprofile/backtrace.c deleted +0 -27
deleted file mode 100644
index 8f952034e161..000000000000
@@ -1,27 +0,0 @@
-/**
- * @file backtrace.c
- *
- * @remark Copyright 2008 Tensilica Inc.
- * Copyright (C) 2015 Cadence Design Systems Inc.
- * @remark Read the file COPYING
- *
- */
-
-#include <linux/oprofile.h>
-#include <asm/ptrace.h>
-#include <asm/stacktrace.h>
-
-static int xtensa_backtrace_cb(struct stackframe *frame, void *data)
-{
-	oprofile_add_trace(frame->pc);
-	return 0;
-}
-
-void xtensa_backtrace(struct pt_regs * const regs, unsigned int depth)
-{
-	if (user_mode(regs))
-		xtensa_backtrace_user(regs, depth, xtensa_backtrace_cb, NULL);
-	else
-		xtensa_backtrace_kernel(regs, depth, xtensa_backtrace_cb,
-					xtensa_backtrace_cb, NULL);
-}
arch/xtensa/oprofile/init.c deleted +0 -26
deleted file mode 100644
index a67eea379766..000000000000
@@ -1,26 +0,0 @@
-/**
- * @file init.c
- *
- * @remark Copyright 2008 Tensilica Inc.
- * @remark Read the file COPYING
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/oprofile.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-
-
-extern void xtensa_backtrace(struct pt_regs *const regs, unsigned int depth);
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	ops->backtrace = xtensa_backtrace;
-	return -ENODEV;
-}
-
-
-void oprofile_arch_exit(void)
-{
-}
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#23 lore raw

PATCH 15/18 arch: x86: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/x86/Kconfig                       |   1 -
 arch/x86/Makefile                      |   3 -
 arch/x86/include/asm/nmi.h             |   1 -
 arch/x86/kernel/cpu/perfctr-watchdog.c |  11 +-
 arch/x86/oprofile/Makefile             |  12 -
 arch/x86/oprofile/backtrace.c          | 127 ----
 arch/x86/oprofile/init.c               |  38 --
 arch/x86/oprofile/nmi_int.c            | 780 -------------------------
 arch/x86/oprofile/op_counter.h         |  30 -
 arch/x86/oprofile/op_model_amd.c       | 542 -----------------
 arch/x86/oprofile/op_model_p4.c        | 723 -----------------------
 arch/x86/oprofile/op_model_ppro.c      | 245 --------
 arch/x86/oprofile/op_x86_model.h       |  90 ---
 13 files changed, 1 insertion(+), 2602 deletions(-)
 delete mode 100644 arch/x86/oprofile/Makefile
 delete mode 100644 arch/x86/oprofile/backtrace.c
 delete mode 100644 arch/x86/oprofile/init.c
 delete mode 100644 arch/x86/oprofile/nmi_int.c
 delete mode 100644 arch/x86/oprofile/op_counter.h
 delete mode 100644 arch/x86/oprofile/op_model_amd.c
 delete mode 100644 arch/x86/oprofile/op_model_p4.c
 delete mode 100644 arch/x86/oprofile/op_model_ppro.c
 delete mode 100644 arch/x86/oprofile/op_x86_model.h
arch/x86/Kconfig +0 -1
index 21f851179ff0..67ba48082932 100644
@@ -206,7 +206,6 @@ config X86
 	select HAVE_MOVE_PMD
 	select HAVE_MOVE_PUD
 	select HAVE_NMI
-	select HAVE_OPROFILE
 	select HAVE_OPTPROBES
 	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
arch/x86/Makefile +0 -3
index 7116da3980be..47e61e623e60 100644
@@ -229,9 +229,6 @@ core-y += arch/x86/
 drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
 drivers-$(CONFIG_PCI)            += arch/x86/pci/
 
-# must be linked after kernel/
-drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
-
 # suspend and hibernation support
 drivers-$(CONFIG_PM) += arch/x86/power/
 
arch/x86/include/asm/nmi.h +0 -1
index 9d5d949e662e..1cb9c17a4cb4 100644
@@ -9,7 +9,6 @@
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
-extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
 extern int reserve_perfctr_nmi(unsigned int);
 extern void release_perfctr_nmi(unsigned int);
 extern int reserve_evntsel_nmi(unsigned int);
arch/x86/kernel/cpu/perfctr-watchdog.c +1 -10
index a5ee607a3b89..3ef5868ac588 100644
@@ -3,7 +3,7 @@
  * local apic based NMI watchdog for various CPUs.
  *
  * This file also handles reservation of performance counters for coordination
- * with other users (like oprofile).
+ * with other users.
  *
  * Note that these events normally don't tick when the CPU idles. This means
  * the frequency varies with CPU load.
@@ -105,15 +105,6 @@ static inline unsigned int nmi_evntsel_msr_to_bit(unsigned int msr)
 
 }
 
-/* checks for a bit availability (hack for oprofile) */
-int avail_to_resrv_perfctr_nmi_bit(unsigned int counter)
-{
-	BUG_ON(counter > NMI_MAX_COUNTER_BITS);
-
-	return !test_bit(counter, perfctr_nmi_owner);
-}
-EXPORT_SYMBOL(avail_to_resrv_perfctr_nmi_bit);
-
 int reserve_perfctr_nmi(unsigned int msr)
 {
 	unsigned int counter;
arch/x86/oprofile/Makefile deleted +0 -12
deleted file mode 100644
index 4d49b5a27025..000000000000
@@ -1,12 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o  \
-		timer_int.o nmi_timer_int.o )
-
-oprofile-y				:= $(DRIVER_OBJS) init.o backtrace.o
-oprofile-$(CONFIG_X86_LOCAL_APIC) 	+= nmi_int.o op_model_amd.o \
-					   op_model_ppro.o op_model_p4.o
arch/x86/oprofile/backtrace.c deleted +0 -127

127 lines not on this page · raw message

arch/x86/oprofile/init.c deleted +0 -38
deleted file mode 100644
index 9e138d00ad36..000000000000
@@ -1,38 +0,0 @@
-/**
- * @file init.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#include <linux/oprofile.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-
-/*
- * We support CPUs that have performance counters like the Pentium Pro
- * with the NMI mode driver.
- */
-
-#ifdef CONFIG_X86_LOCAL_APIC
-extern int op_nmi_init(struct oprofile_operations *ops);
-extern void op_nmi_exit(void);
-#else
-static int op_nmi_init(struct oprofile_operations *ops) { return -ENODEV; }
-static void op_nmi_exit(void) { }
-#endif
-
-extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth);
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	ops->backtrace = x86_backtrace;
-	return op_nmi_init(ops);
-}
-
-void oprofile_arch_exit(void)
-{
-	op_nmi_exit();
-}
arch/x86/oprofile/nmi_int.c deleted +0 -780

780 lines not on this page · raw message

arch/x86/oprofile/op_counter.h deleted +0 -30
deleted file mode 100644
index 0b7b7b179cbe..000000000000
@@ -1,30 +0,0 @@
-/**
- * @file op_counter.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- */
-
-#ifndef OP_COUNTER_H
-#define OP_COUNTER_H
-
-#define OP_MAX_COUNTER 32
-
-/* Per-perfctr configuration as set via
- * oprofilefs.
- */
-struct op_counter_config {
-	unsigned long count;
-	unsigned long enabled;
-	unsigned long event;
-	unsigned long kernel;
-	unsigned long user;
-	unsigned long unit_mask;
-	unsigned long extra;
-};
-
-extern struct op_counter_config counter_config[];
-
-#endif /* OP_COUNTER_H */
arch/x86/oprofile/op_model_amd.c deleted +0 -542

542 lines not on this page · raw message

arch/x86/oprofile/op_model_p4.c deleted +0 -723

723 lines not on this page · raw message

arch/x86/oprofile/op_model_ppro.c deleted +0 -245

245 lines not on this page · raw message

arch/x86/oprofile/op_x86_model.h deleted +0 -90

90 lines not on this page · raw message

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
maintainer Acked-by on v1 7/18
#11 lore raw

Re: [PATCH 07/18] arch: microblaze: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar
Quoted 82 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

---
 arch/microblaze/Kconfig                       |  1 -
 arch/microblaze/Makefile                      |  2 --
 arch/microblaze/oprofile/Makefile             | 14 ------------
 .../microblaze/oprofile/microblaze_oprofile.c | 22 -------------------
 4 files changed, 39 deletions(-)
 delete mode 100644 arch/microblaze/oprofile/Makefile
 delete mode 100644 arch/microblaze/oprofile/microblaze_oprofile.c
arch/microblaze/Kconfig +0 -1
index f82795592ce5..25a5a3fb14aa 100644
@@ -30,7 +30,6 @@ config MICROBLAZE
 	select HAVE_FTRACE_MCOUNT_RECORD
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_TRACER
-	select HAVE_OPROFILE
 	select HAVE_PCI
 	select IRQ_DOMAIN
 	select XILINX_INTC
arch/microblaze/Makefile +0 -2
index bb980891816d..b41f323e1fde 100644
@@ -54,8 +54,6 @@ core-y += arch/microblaze/kernel/
 core-y += arch/microblaze/mm/
 core-$(CONFIG_PCI) += arch/microblaze/pci/
 
-drivers-$(CONFIG_OPROFILE) += arch/microblaze/oprofile/
-
 boot := arch/microblaze/boot
 
 # Are we making a simpleImage.<boardname> target? If so, crack out the boardname
arch/microblaze/oprofile/Makefile deleted +0 -14
deleted file mode 100644
index 107f2f55d995..000000000000
@@ -1,14 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# arch/microblaze/oprofile/Makefile
-#
-
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y := $(DRIVER_OBJS) microblaze_oprofile.o
arch/microblaze/oprofile/microblaze_oprofile.c deleted +0 -12
deleted file mode 100644
index def17e59888e..000000000000
@@ -1,22 +0,0 @@
-/*
- * Microblaze oprofile code
- *
- * Copyright (C) 2009 Michal Simek <[email protected]>
- * Copyright (C) 2009 PetaLogix
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/oprofile.h>

arch/microblaze/oprofile/microblaze_oprofile.c line 22

Quoted 10 lines
arch/microblaze/oprofile/microblaze_oprofile.c deleted +0 -10
-#include <linux/init.h>
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	return -1;
-}
-
-void oprofile_arch_exit(void)
-{
-}

Thanks,
Michal

Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
maintainer Acked-by on v1 17/18
#27 lore raw

Re: [PATCH 17/18] drivers: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar
Quoted 9 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove kernel's old oprofile support.

For the RCU update:

Quoted 3,527 lines
---
 Documentation/RCU/NMI-RCU.rst                 |   3 +-
 .../admin-guide/kernel-parameters.txt         |  14 -
 Documentation/process/magic-number.rst        |   1 -
 .../it_IT/process/magic-number.rst            |   1 -
 .../zh_CN/process/magic-number.rst            |   1 -
 MAINTAINERS                                   |  11 -
 arch/Kconfig                                  |  32 -
 drivers/oprofile/buffer_sync.c                | 591 ------------------
 drivers/oprofile/buffer_sync.h                |  22 -
 drivers/oprofile/cpu_buffer.c                 | 465 --------------
 drivers/oprofile/cpu_buffer.h                 | 121 ----
 drivers/oprofile/event_buffer.c               | 209 -------
 drivers/oprofile/event_buffer.h               |  40 --
 drivers/oprofile/nmi_timer_int.c              | 157 -----
 drivers/oprofile/oprof.c                      | 286 ---------
 drivers/oprofile/oprof.h                      |  50 --
 drivers/oprofile/oprofile_files.c             | 201 ------
 drivers/oprofile/oprofile_perf.c              | 328 ----------
 drivers/oprofile/oprofile_stats.c             |  84 ---
 drivers/oprofile/oprofile_stats.h             |  33 -
 drivers/oprofile/oprofilefs.c                 | 300 ---------
 drivers/oprofile/timer_int.c                  | 122 ----
 include/linux/oprofile.h                      | 209 -------
 init/Kconfig                                  |   2 +-
 24 files changed, 2 insertions(+), 3281 deletions(-)
 delete mode 100644 drivers/oprofile/buffer_sync.c
 delete mode 100644 drivers/oprofile/buffer_sync.h
 delete mode 100644 drivers/oprofile/cpu_buffer.c
 delete mode 100644 drivers/oprofile/cpu_buffer.h
 delete mode 100644 drivers/oprofile/event_buffer.c
 delete mode 100644 drivers/oprofile/event_buffer.h
 delete mode 100644 drivers/oprofile/nmi_timer_int.c
 delete mode 100644 drivers/oprofile/oprof.c
 delete mode 100644 drivers/oprofile/oprof.h
 delete mode 100644 drivers/oprofile/oprofile_files.c
 delete mode 100644 drivers/oprofile/oprofile_perf.c
 delete mode 100644 drivers/oprofile/oprofile_stats.c
 delete mode 100644 drivers/oprofile/oprofile_stats.h
 delete mode 100644 drivers/oprofile/oprofilefs.c
 delete mode 100644 drivers/oprofile/timer_int.c
 delete mode 100644 include/linux/oprofile.h
Documentation/RCU/NMI-RCU.rst +1 -2
index 180958388ff9..2a92bc685ef1 100644
@@ -8,8 +8,7 @@ Although RCU is usually used to protect read-mostly data structures,
 it is possible to use RCU to provide dynamic non-maskable interrupt
 handlers, as well as dynamic irq handlers.  This document describes
 how to do this, drawing loosely from Zwane Mwaikambo's NMI-timer
-work in "arch/x86/oprofile/nmi_timer_int.c" and in
-"arch/x86/kernel/traps.c".
+work in "arch/x86/kernel/traps.c".
 
 The relevant pieces of code are listed below, each followed by a
 brief explanation::
Documentation/admin-guide/kernel-parameters.txt +0 -14
index 9e3cdb271d06..e860c681766b 100644
@@ -3458,20 +3458,6 @@
 			For example, to override I2C bus2:
 			omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100
 
-	oprofile.timer=	[HW]
-			Use timer interrupt instead of performance counters
-
-	oprofile.cpu_type=	Force an oprofile cpu type
-			This might be useful if you have an older oprofile
-			userland or if you want common events.
-			Format: { arch_perfmon }
-			arch_perfmon: [X86] Force use of architectural
-				perfmon on Intel CPUs instead of the
-				CPU specific event set.
-			timer: [X86] Force use of architectural NMI
-				timer mode (see also oprofile.timer
-				for generic hr timer mode)
-
 	oops=panic	Always panic on oopses. Default is to just kill the
 			process, but there is a small probability of
 			deadlocking the machine.
Documentation/process/magic-number.rst +0 -1
index e02ff5ffb653..c6dfe060ec2f 100644
@@ -135,7 +135,6 @@ FW_HEADER_MAGIC       0x65726F66       fw_header                ``drivers/atm/fo
 SLOT_MAGIC            0x67267321       slot                     ``drivers/hotplug/cpqphp.h``
 SLOT_MAGIC            0x67267322       slot                     ``drivers/hotplug/acpiphp.h``
 LO_MAGIC              0x68797548       nbd_device               ``include/linux/nbd.h``
-OPROFILE_MAGIC        0x6f70726f       super_block              ``drivers/oprofile/oprofilefs.h``
 M3_STATE_MAGIC        0x734d724d       m3_state                 ``sound/oss/maestro3.c``
 VMALLOC_MAGIC         0x87654320       snd_alloc_track          ``sound/core/memory.c``
 KMALLOC_MAGIC         0x87654321       snd_alloc_track          ``sound/core/memory.c``
Documentation/translations/it_IT/process/magic-number.rst +0 -1
index 0243d32a0b59..1af30f4228f2 100644
@@ -141,7 +141,6 @@ FW_HEADER_MAGIC       0x65726F66       fw_header                ``drivers/atm/fo
 SLOT_MAGIC            0x67267321       slot                     ``drivers/hotplug/cpqphp.h``
 SLOT_MAGIC            0x67267322       slot                     ``drivers/hotplug/acpiphp.h``
 LO_MAGIC              0x68797548       nbd_device               ``include/linux/nbd.h``
-OPROFILE_MAGIC        0x6f70726f       super_block              ``drivers/oprofile/oprofilefs.h``
 M3_STATE_MAGIC        0x734d724d       m3_state                 ``sound/oss/maestro3.c``
 VMALLOC_MAGIC         0x87654320       snd_alloc_track          ``sound/core/memory.c``
 KMALLOC_MAGIC         0x87654321       snd_alloc_track          ``sound/core/memory.c``
Documentation/translations/zh_CN/process/magic-number.rst +0 -1
index de182bf4191c..7bb9d4165ed3 100644
@@ -124,7 +124,6 @@ FW_HEADER_MAGIC       0x65726F66       fw_header                ``drivers/atm/fo
 SLOT_MAGIC            0x67267321       slot                     ``drivers/hotplug/cpqphp.h``
 SLOT_MAGIC            0x67267322       slot                     ``drivers/hotplug/acpiphp.h``
 LO_MAGIC              0x68797548       nbd_device               ``include/linux/nbd.h``
-OPROFILE_MAGIC        0x6f70726f       super_block              ``drivers/oprofile/oprofilefs.h``
 M3_STATE_MAGIC        0x734d724d       m3_state                 ``sound/oss/maestro3.c``
 VMALLOC_MAGIC         0x87654320       snd_alloc_track          ``sound/core/memory.c``
 KMALLOC_MAGIC         0x87654321       snd_alloc_track          ``sound/core/memory.c``
MAINTAINERS +0 -11
index cc1e6a5ee6e6..ae2c2cef9d96 100644
@@ -1414,7 +1414,6 @@ F:	arch/arm*/include/asm/hw_breakpoint.h
 F:	arch/arm*/include/asm/perf_event.h
 F:	arch/arm*/kernel/hw_breakpoint.c
 F:	arch/arm*/kernel/perf_*
-F:	arch/arm/oprofile/common.c
 F:	drivers/perf/
 F:	include/linux/perf/arm_pmu.h
 
@@ -4083,7 +4082,6 @@ W:	http://www.ibm.com/developerworks/power/cell/
 F:	arch/powerpc/include/asm/cell*.h
 F:	arch/powerpc/include/asm/spu*.h
 F:	arch/powerpc/include/uapi/asm/spu*.h
-F:	arch/powerpc/oprofile/*cell*
 F:	arch/powerpc/platforms/cell/
 
 CELLWISE CW2015 BATTERY DRIVER
@@ -13311,15 +13309,6 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
 F:	sound/drivers/opl4/
 
-OPROFILE
-M:	Robert Richter <[email protected]>
-L:	[email protected]
-S:	Maintained
-F:	arch/*/include/asm/oprofile*.h
-F:	arch/*/oprofile/
-F:	drivers/oprofile/
-F:	include/linux/oprofile.h
-
 ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
 M:	Mark Fasheh <[email protected]>
 M:	Joel Becker <[email protected]>
arch/Kconfig +0 -32
index 24862d15f3a3..40277027a255 100644
@@ -33,38 +33,6 @@ config HOTPLUG_SMT
 config GENERIC_ENTRY
        bool
 
-config OPROFILE
-	tristate "OProfile system profiling"
-	depends on PROFILING
-	depends on HAVE_OPROFILE
-	select RING_BUFFER
-	select RING_BUFFER_ALLOW_SWAP
-	help
-	  OProfile is a profiling system capable of profiling the
-	  whole system, include the kernel, kernel modules, libraries,
-	  and applications.
-
-	  If unsure, say N.
-
-config OPROFILE_EVENT_MULTIPLEX
-	bool "OProfile multiplexing support (EXPERIMENTAL)"
-	default n
-	depends on OPROFILE && X86
-	help
-	  The number of hardware counters is limited. The multiplexing
-	  feature enables OProfile to gather more events than counters
-	  are provided by the hardware. This is realized by switching
-	  between events at a user specified time interval.
-
-	  If unsure, say N.
-
-config HAVE_OPROFILE
-	bool
-
-config OPROFILE_NMI_TIMER
-	def_bool y
-	depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
-
 config KPROBES
 	bool "Kprobes"
 	depends on MODULES
drivers/oprofile/buffer_sync.c deleted +0 -591
deleted file mode 100644
index cc917865f13a..000000000000
@@ -1,591 +0,0 @@
-/**
- * @file buffer_sync.c
- *
- * @remark Copyright 2002-2009 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- * @author Barry Kasindorf
- * @author Robert Richter <[email protected]>
- *
- * This is the core of the buffer management. Each
- * CPU buffer is processed and entered into the
- * global event buffer. Such processing is necessary
- * in several circumstances, mentioned below.
- *
- * The processing does the job of converting the
- * transitory EIP value into a persistent dentry/offset
- * value that the profiler can record at its leisure.
- *
- * See fs/dcookies.c for a description of the dentry/offset
- * objects.
- */
-
-#include <linux/file.h>
-#include <linux/mm.h>
-#include <linux/workqueue.h>
-#include <linux/notifier.h>
-#include <linux/dcookies.h>
-#include <linux/profile.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/oprofile.h>
-#include <linux/sched.h>
-#include <linux/sched/mm.h>
-#include <linux/sched/task.h>
-#include <linux/gfp.h>
-
-#include "oprofile_stats.h"
-#include "event_buffer.h"
-#include "cpu_buffer.h"
-#include "buffer_sync.h"
-
-static LIST_HEAD(dying_tasks);
-static LIST_HEAD(dead_tasks);
-static cpumask_var_t marked_cpus;
-static DEFINE_SPINLOCK(task_mortuary);
-static void process_task_mortuary(void);
-
-/* Take ownership of the task struct and place it on the
- * list for processing. Only after two full buffer syncs
- * does the task eventually get freed, because by then
- * we are sure we will not reference it again.
- * Can be invoked from softirq via RCU callback due to
- * call_rcu() of the task struct, hence the _irqsave.
- */
-static int
-task_free_notify(struct notifier_block *self, unsigned long val, void *data)
-{
-	unsigned long flags;
-	struct task_struct *task = data;
-	spin_lock_irqsave(&task_mortuary, flags);
-	list_add(&task->tasks, &dying_tasks);
-	spin_unlock_irqrestore(&task_mortuary, flags);
-	return NOTIFY_OK;
-}
-
-
-/* The task is on its way out. A sync of the buffer means we can catch
- * any remaining samples for this task.
- */
-static int
-task_exit_notify(struct notifier_block *self, unsigned long val, void *data)
-{
-	/* To avoid latency problems, we only process the current CPU,
-	 * hoping that most samples for the task are on this CPU
-	 */
-	sync_buffer(raw_smp_processor_id());
-	return 0;
-}
-
-
-/* The task is about to try a do_munmap(). We peek at what it's going to
- * do, and if it's an executable region, process the samples first, so
- * we don't lose any. This does not have to be exact, it's a QoI issue
- * only.
- */
-static int
-munmap_notify(struct notifier_block *self, unsigned long val, void *data)
-{
-	unsigned long addr = (unsigned long)data;
-	struct mm_struct *mm = current->mm;
-	struct vm_area_struct *mpnt;
-
-	mmap_read_lock(mm);
-
-	mpnt = find_vma(mm, addr);
-	if (mpnt && mpnt->vm_file && (mpnt->vm_flags & VM_EXEC)) {
-		mmap_read_unlock(mm);
-		/* To avoid latency problems, we only process the current CPU,
-		 * hoping that most samples for the task are on this CPU
-		 */
-		sync_buffer(raw_smp_processor_id());
-		return 0;
-	}
-
-	mmap_read_unlock(mm);
-	return 0;
-}
-
-
-/* We need to be told about new modules so we don't attribute to a previously
- * loaded module, or drop the samples on the floor.
- */
-static int
-module_load_notify(struct notifier_block *self, unsigned long val, void *data)
-{
-#ifdef CONFIG_MODULES
-	if (val != MODULE_STATE_COMING)
-		return NOTIFY_DONE;
-
-	/* FIXME: should we process all CPU buffers ? */
-	mutex_lock(&buffer_mutex);
-	add_event_entry(ESCAPE_CODE);
-	add_event_entry(MODULE_LOADED_CODE);
-	mutex_unlock(&buffer_mutex);
-#endif
-	return NOTIFY_OK;
-}
-
-
-static struct notifier_block task_free_nb = {
-	.notifier_call	= task_free_notify,
-};
-
-static struct notifier_block task_exit_nb = {
-	.notifier_call	= task_exit_notify,
-};
-
-static struct notifier_block munmap_nb = {
-	.notifier_call	= munmap_notify,
-};
-
-static struct notifier_block module_load_nb = {
-	.notifier_call = module_load_notify,
-};
-
-static void free_all_tasks(void)
-{
-	/* make sure we don't leak task structs */
-	process_task_mortuary();
-	process_task_mortuary();
-}
-
-int sync_start(void)
-{
-	int err;
-
-	if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL))
-		return -ENOMEM;
-
-	err = task_handoff_register(&task_free_nb);
-	if (err)
-		goto out1;
-	err = profile_event_register(PROFILE_TASK_EXIT, &task_exit_nb);
-	if (err)
-		goto out2;
-	err = profile_event_register(PROFILE_MUNMAP, &munmap_nb);
-	if (err)
-		goto out3;
-	err = register_module_notifier(&module_load_nb);
-	if (err)
-		goto out4;
-
-	start_cpu_work();
-
-out:
-	return err;
-out4:
-	profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
-out3:
-	profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
-out2:
-	task_handoff_unregister(&task_free_nb);
-	free_all_tasks();
-out1:
-	free_cpumask_var(marked_cpus);
-	goto out;
-}
-
-
-void sync_stop(void)
-{
-	end_cpu_work();
-	unregister_module_notifier(&module_load_nb);
-	profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
-	profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
-	task_handoff_unregister(&task_free_nb);
-	barrier();			/* do all of the above first */
-
-	flush_cpu_work();
-
-	free_all_tasks();
-	free_cpumask_var(marked_cpus);
-}
-
-
-/* Optimisation. We can manage without taking the dcookie sem
- * because we cannot reach this code without at least one
- * dcookie user still being registered (namely, the reader
- * of the event buffer). */
-static inline unsigned long fast_get_dcookie(const struct path *path)
-{
-	unsigned long cookie;
-
-	if (path->dentry->d_flags & DCACHE_COOKIE)
-		return (unsigned long)path->dentry;
-	get_dcookie(path, &cookie);
-	return cookie;
-}
-
-
-/* Look up the dcookie for the task's mm->exe_file,
- * which corresponds loosely to "application name". This is
- * not strictly necessary but allows oprofile to associate
- * shared-library samples with particular applications
- */
-static unsigned long get_exec_dcookie(struct mm_struct *mm)
-{
-	unsigned long cookie = NO_COOKIE;
-	struct file *exe_file;
-
-	if (!mm)
-		goto done;
-
-	exe_file = get_mm_exe_file(mm);
-	if (!exe_file)
-		goto done;
-
-	cookie = fast_get_dcookie(&exe_file->f_path);
-	fput(exe_file);
-done:
-	return cookie;
-}
-
-
-/* Convert the EIP value of a sample into a persistent dentry/offset
- * pair that can then be added to the global event buffer. We make
- * sure to do this lookup before a mm->mmap modification happens so
- * we don't lose track.
- *
- * The caller must ensure the mm is not nil (ie: not a kernel thread).
- */
-static unsigned long
-lookup_dcookie(struct mm_struct *mm, unsigned long addr, off_t *offset)
-{
-	unsigned long cookie = NO_COOKIE;
-	struct vm_area_struct *vma;
-
-	mmap_read_lock(mm);
-	for (vma = find_vma(mm, addr); vma; vma = vma->vm_next) {
-
-		if (addr < vma->vm_start || addr >= vma->vm_end)
-			continue;
-
-		if (vma->vm_file) {
-			cookie = fast_get_dcookie(&vma->vm_file->f_path);
-			*offset = (vma->vm_pgoff << PAGE_SHIFT) + addr -
-				vma->vm_start;
-		} else {
-			/* must be an anonymous map */
-			*offset = addr;
-		}
-
-		break;
-	}
-
-	if (!vma)
-		cookie = INVALID_COOKIE;
-	mmap_read_unlock(mm);
-
-	return cookie;
-}
-
-static unsigned long last_cookie = INVALID_COOKIE;
-
-static void add_cpu_switch(int i)
-{
-	add_event_entry(ESCAPE_CODE);
-	add_event_entry(CPU_SWITCH_CODE);
-	add_event_entry(i);
-	last_cookie = INVALID_COOKIE;
-}
-
-static void add_kernel_ctx_switch(unsigned int in_kernel)
-{
-	add_event_entry(ESCAPE_CODE);
-	if (in_kernel)
-		add_event_entry(KERNEL_ENTER_SWITCH_CODE);
-	else
-		add_event_entry(KERNEL_EXIT_SWITCH_CODE);
-}
-
-static void
-add_user_ctx_switch(struct task_struct const *task, unsigned long cookie)
-{
-	add_event_entry(ESCAPE_CODE);
-	add_event_entry(CTX_SWITCH_CODE);
-	add_event_entry(task->pid);
-	add_event_entry(cookie);
-	/* Another code for daemon back-compat */
-	add_event_entry(ESCAPE_CODE);
-	add_event_entry(CTX_TGID_CODE);
-	add_event_entry(task->tgid);
-}
-
-
-static void add_cookie_switch(unsigned long cookie)
-{
-	add_event_entry(ESCAPE_CODE);
-	add_event_entry(COOKIE_SWITCH_CODE);
-	add_event_entry(cookie);
-}
-
-
-static void add_trace_begin(void)
-{
-	add_event_entry(ESCAPE_CODE);
-	add_event_entry(TRACE_BEGIN_CODE);
-}
-
-static void add_data(struct op_entry *entry, struct mm_struct *mm)
-{
-	unsigned long code, pc, val;
-	unsigned long cookie;
-	off_t offset;
-
-	if (!op_cpu_buffer_get_data(entry, &code))
-		return;
-	if (!op_cpu_buffer_get_data(entry, &pc))
-		return;
-	if (!op_cpu_buffer_get_size(entry))
-		return;
-
-	if (mm) {
-		cookie = lookup_dcookie(mm, pc, &offset);
-
-		if (cookie == NO_COOKIE)
-			offset = pc;
-		if (cookie == INVALID_COOKIE) {
-			atomic_inc(&oprofile_stats.sample_lost_no_mapping);
-			offset = pc;
-		}
-		if (cookie != last_cookie) {
-			add_cookie_switch(cookie);
-			last_cookie = cookie;
-		}
-	} else
-		offset = pc;
-
-	add_event_entry(ESCAPE_CODE);
-	add_event_entry(code);
-	add_event_entry(offset);	/* Offset from Dcookie */
-
-	while (op_cpu_buffer_get_data(entry, &val))
-		add_event_entry(val);
-}
-
-static inline void add_sample_entry(unsigned long offset, unsigned long event)
-{
-	add_event_entry(offset);
-	add_event_entry(event);
-}
-
-
-/*
- * Add a sample to the global event buffer. If possible the
- * sample is converted into a persistent dentry/offset pair
- * for later lookup from userspace. Return 0 on failure.
- */
-static int
-add_sample(struct mm_struct *mm, struct op_sample *s, int in_kernel)
-{
-	unsigned long cookie;
-	off_t offset;
-
-	if (in_kernel) {
-		add_sample_entry(s->eip, s->event);
-		return 1;
-	}
-
-	/* add userspace sample */
-
-	if (!mm) {
-		atomic_inc(&oprofile_stats.sample_lost_no_mm);
-		return 0;
-	}
-
-	cookie = lookup_dcookie(mm, s->eip, &offset);
-
-	if (cookie == INVALID_COOKIE) {
-		atomic_inc(&oprofile_stats.sample_lost_no_mapping);
-		return 0;
-	}
-
-	if (cookie != last_cookie) {
-		add_cookie_switch(cookie);
-		last_cookie = cookie;
-	}
-
-	add_sample_entry(offset, s->event);
-
-	return 1;
-}
-
-
-static void release_mm(struct mm_struct *mm)
-{
-	if (!mm)
-		return;
-	mmput(mm);
-}
-
-static inline int is_code(unsigned long val)
-{
-	return val == ESCAPE_CODE;
-}
-
-
-/* Move tasks along towards death. Any tasks on dead_tasks
- * will definitely have no remaining references in any
- * CPU buffers at this point, because we use two lists,
- * and to have reached the list, it must have gone through
- * one full sync already.
- */
-static void process_task_mortuary(void)
-{
-	unsigned long flags;
-	LIST_HEAD(local_dead_tasks);
-	struct task_struct *task;
-	struct task_struct *ttask;
-
-	spin_lock_irqsave(&task_mortuary, flags);
-
-	list_splice_init(&dead_tasks, &local_dead_tasks);
-	list_splice_init(&dying_tasks, &dead_tasks);
-
-	spin_unlock_irqrestore(&task_mortuary, flags);
-
-	list_for_each_entry_safe(task, ttask, &local_dead_tasks, tasks) {
-		list_del(&task->tasks);
-		free_task(task);
-	}
-}
-
-
-static void mark_done(int cpu)
-{
-	int i;
-
-	cpumask_set_cpu(cpu, marked_cpus);
-
-	for_each_online_cpu(i) {
-		if (!cpumask_test_cpu(i, marked_cpus))
-			return;
-	}
-
-	/* All CPUs have been processed at least once,
-	 * we can process the mortuary once
-	 */
-	process_task_mortuary();
-
-	cpumask_clear(marked_cpus);
-}
-
-
-/* FIXME: this is not sufficient if we implement syscall barrier backtrace
- * traversal, the code switch to sb_sample_start at first kernel enter/exit
- * switch so we need a fifth state and some special handling in sync_buffer()
- */
-typedef enum {
-	sb_bt_ignore = -2,
-	sb_buffer_start,
-	sb_bt_start,
-	sb_sample_start,
-} sync_buffer_state;
-
-/* Sync one of the CPU's buffers into the global event buffer.
- * Here we need to go through each batch of samples punctuated
- * by context switch notes, taking the task's mmap_lock and doing
- * lookup in task->mm->mmap to convert EIP into dcookie/offset
- * value.
- */
-void sync_buffer(int cpu)
-{
-	struct mm_struct *mm = NULL;
-	struct mm_struct *oldmm;
-	unsigned long val;
-	struct task_struct *new;
-	unsigned long cookie = 0;
-	int in_kernel = 1;
-	sync_buffer_state state = sb_buffer_start;
-	unsigned int i;
-	unsigned long available;
-	unsigned long flags;
-	struct op_entry entry;
-	struct op_sample *sample;
-
-	mutex_lock(&buffer_mutex);
-
-	add_cpu_switch(cpu);
-
-	op_cpu_buffer_reset(cpu);
-	available = op_cpu_buffer_entries(cpu);
-
-	for (i = 0; i < available; ++i) {
-		sample = op_cpu_buffer_read_entry(&entry, cpu);
-		if (!sample)
-			break;
-
-		if (is_code(sample->eip)) {
-			flags = sample->event;
-			if (flags & TRACE_BEGIN) {
-				state = sb_bt_start;
-				add_trace_begin();
-			}
-			if (flags & KERNEL_CTX_SWITCH) {
-				/* kernel/userspace switch */
-				in_kernel = flags & IS_KERNEL;
-				if (state == sb_buffer_start)
-					state = sb_sample_start;
-				add_kernel_ctx_switch(flags & IS_KERNEL);
-			}
-			if (flags & USER_CTX_SWITCH
-			    && op_cpu_buffer_get_data(&entry, &val)) {
-				/* userspace context switch */
-				new = (struct task_struct *)val;
-				oldmm = mm;
-				release_mm(oldmm);
-				mm = get_task_mm(new);
-				if (mm != oldmm)
-					cookie = get_exec_dcookie(mm);
-				add_user_ctx_switch(new, cookie);
-			}
-			if (op_cpu_buffer_get_size(&entry))
-				add_data(&entry, mm);
-			continue;
-		}
-
-		if (state < sb_bt_start)
-			/* ignore sample */
-			continue;
-
-		if (add_sample(mm, sample, in_kernel))
-			continue;
-
-		/* ignore backtraces if failed to add a sample */
-		if (state == sb_bt_start) {
-			state = sb_bt_ignore;
-			atomic_inc(&oprofile_stats.bt_lost_no_mapping);
-		}
-	}
-	release_mm(mm);
-
-	mark_done(cpu);
-
-	mutex_unlock(&buffer_mutex);
-}
-
-/* The function can be used to add a buffer worth of data directly to
- * the kernel buffer. The buffer is assumed to be a circular buffer.
- * Take the entries from index start and end at index end, wrapping
- * at max_entries.
- */
-void oprofile_put_buff(unsigned long *buf, unsigned int start,
-		       unsigned int stop, unsigned int max)
-{
-	int i;
-
-	i = start;
-
-	mutex_lock(&buffer_mutex);
-	while (i != stop) {
-		add_event_entry(buf[i++]);
-
-		if (i >= max)
-			i = 0;
-	}
-
-	mutex_unlock(&buffer_mutex);
-}
-
drivers/oprofile/buffer_sync.h deleted +0 -22
deleted file mode 100644
index 3110732c1835..000000000000
@@ -1,22 +0,0 @@
-/**
- * @file buffer_sync.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#ifndef OPROFILE_BUFFER_SYNC_H
-#define OPROFILE_BUFFER_SYNC_H
-
-/* add the necessary profiling hooks */
-int sync_start(void);
-
-/* remove the hooks */
-void sync_stop(void);
-
-/* sync the given CPU's buffer */
-void sync_buffer(int cpu);
-
-#endif /* OPROFILE_BUFFER_SYNC_H */
drivers/oprofile/cpu_buffer.c deleted +0 -465
deleted file mode 100644
index 9210a95cb4e6..000000000000
@@ -1,465 +0,0 @@
-/**
- * @file cpu_buffer.c
- *
- * @remark Copyright 2002-2009 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- * @author Barry Kasindorf <[email protected]>
- * @author Robert Richter <[email protected]>
- *
- * Each CPU has a local buffer that stores PC value/event
- * pairs. We also log context switches when we notice them.
- * Eventually each CPU's buffer is processed into the global
- * event buffer by sync_buffer().
- *
- * We use a local buffer for two reasons: an NMI or similar
- * interrupt cannot synchronise, and high sampling rates
- * would lead to catastrophic global synchronisation if
- * a global buffer was used.
- */
-
-#include <linux/sched.h>
-#include <linux/oprofile.h>
-#include <linux/errno.h>
-
-#include <asm/ptrace.h>
-
-#include "event_buffer.h"
-#include "cpu_buffer.h"
-#include "buffer_sync.h"
-#include "oprof.h"
-
-#define OP_BUFFER_FLAGS	0
-
-static struct trace_buffer *op_ring_buffer;
-DEFINE_PER_CPU(struct oprofile_cpu_buffer, op_cpu_buffer);
-
-static void wq_sync_buffer(struct work_struct *work);
-
-#define DEFAULT_TIMER_EXPIRE (HZ / 10)
-static int work_enabled;
-
-unsigned long oprofile_get_cpu_buffer_size(void)
-{
-	return oprofile_cpu_buffer_size;
-}
-
-void oprofile_cpu_buffer_inc_smpl_lost(void)
-{
-	struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
-
-	cpu_buf->sample_lost_overflow++;
-}
-
-void free_cpu_buffers(void)
-{
-	if (op_ring_buffer)
-		ring_buffer_free(op_ring_buffer);
-	op_ring_buffer = NULL;
-}
-
-#define RB_EVENT_HDR_SIZE 4
-
-int alloc_cpu_buffers(void)
-{
-	int i;
-
-	unsigned long buffer_size = oprofile_cpu_buffer_size;
-	unsigned long byte_size = buffer_size * (sizeof(struct op_sample) +
-						 RB_EVENT_HDR_SIZE);
-
-	op_ring_buffer = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
-	if (!op_ring_buffer)
-		goto fail;
-
-	for_each_possible_cpu(i) {
-		struct oprofile_cpu_buffer *b = &per_cpu(op_cpu_buffer, i);
-
-		b->last_task = NULL;
-		b->last_is_kernel = -1;
-		b->tracing = 0;
-		b->buffer_size = buffer_size;
-		b->sample_received = 0;
-		b->sample_lost_overflow = 0;
-		b->backtrace_aborted = 0;
-		b->sample_invalid_eip = 0;
-		b->cpu = i;
-		INIT_DELAYED_WORK(&b->work, wq_sync_buffer);
-	}
-	return 0;
-
-fail:
-	free_cpu_buffers();
-	return -ENOMEM;
-}
-
-void start_cpu_work(void)
-{
-	int i;
-
-	work_enabled = 1;
-
-	for_each_online_cpu(i) {
-		struct oprofile_cpu_buffer *b = &per_cpu(op_cpu_buffer, i);
-
-		/*
-		 * Spread the work by 1 jiffy per cpu so they dont all
-		 * fire at once.
-		 */
-		schedule_delayed_work_on(i, &b->work, DEFAULT_TIMER_EXPIRE + i);
-	}
-}
-
-void end_cpu_work(void)
-{
-	work_enabled = 0;
-}
-
-void flush_cpu_work(void)
-{
-	int i;
-
-	for_each_online_cpu(i) {
-		struct oprofile_cpu_buffer *b = &per_cpu(op_cpu_buffer, i);
-
-		/* these works are per-cpu, no need for flush_sync */
-		flush_delayed_work(&b->work);
-	}
-}
-
-/*
- * This function prepares the cpu buffer to write a sample.
- *
- * Struct op_entry is used during operations on the ring buffer while
- * struct op_sample contains the data that is stored in the ring
- * buffer. Struct entry can be uninitialized. The function reserves a
- * data array that is specified by size. Use
- * op_cpu_buffer_write_commit() after preparing the sample. In case of
- * errors a null pointer is returned, otherwise the pointer to the
- * sample.
- *
- */
-struct op_sample
-*op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size)
-{
-	entry->event = ring_buffer_lock_reserve
-		(op_ring_buffer, sizeof(struct op_sample) +
-		 size * sizeof(entry->sample->data[0]));
-	if (!entry->event)
-		return NULL;
-	entry->sample = ring_buffer_event_data(entry->event);
-	entry->size = size;
-	entry->data = entry->sample->data;
-
-	return entry->sample;
-}
-
-int op_cpu_buffer_write_commit(struct op_entry *entry)
-{
-	return ring_buffer_unlock_commit(op_ring_buffer, entry->event);
-}
-
-struct op_sample *op_cpu_buffer_read_entry(struct op_entry *entry, int cpu)
-{
-	struct ring_buffer_event *e;
-	e = ring_buffer_consume(op_ring_buffer, cpu, NULL, NULL);
-	if (!e)
-		return NULL;
-
-	entry->event = e;
-	entry->sample = ring_buffer_event_data(e);
-	entry->size = (ring_buffer_event_length(e) - sizeof(struct op_sample))
-		/ sizeof(entry->sample->data[0]);
-	entry->data = entry->sample->data;
-	return entry->sample;
-}
-
-unsigned long op_cpu_buffer_entries(int cpu)
-{
-	return ring_buffer_entries_cpu(op_ring_buffer, cpu);
-}
-
-static int
-op_add_code(struct oprofile_cpu_buffer *cpu_buf, unsigned long backtrace,
-	    int is_kernel, struct task_struct *task)
-{
-	struct op_entry entry;
-	struct op_sample *sample;
-	unsigned long flags;
-	int size;
-
-	flags = 0;
-
-	if (backtrace)
-		flags |= TRACE_BEGIN;
-
-	/* notice a switch from user->kernel or vice versa */
-	is_kernel = !!is_kernel;
-	if (cpu_buf->last_is_kernel != is_kernel) {
-		cpu_buf->last_is_kernel = is_kernel;
-		flags |= KERNEL_CTX_SWITCH;
-		if (is_kernel)
-			flags |= IS_KERNEL;
-	}
-
-	/* notice a task switch */
-	if (cpu_buf->last_task != task) {
-		cpu_buf->last_task = task;
-		flags |= USER_CTX_SWITCH;
-	}
-
-	if (!flags)
-		/* nothing to do */
-		return 0;
-
-	if (flags & USER_CTX_SWITCH)
-		size = 1;
-	else
-		size = 0;
-
-	sample = op_cpu_buffer_write_reserve(&entry, size);
-	if (!sample)
-		return -ENOMEM;
-
-	sample->eip = ESCAPE_CODE;
-	sample->event = flags;
-
-	if (size)
-		op_cpu_buffer_add_data(&entry, (unsigned long)task);
-
-	op_cpu_buffer_write_commit(&entry);
-
-	return 0;
-}
-
-static inline int
-op_add_sample(struct oprofile_cpu_buffer *cpu_buf,
-	      unsigned long pc, unsigned long event)
-{
-	struct op_entry entry;
-	struct op_sample *sample;
-
-	sample = op_cpu_buffer_write_reserve(&entry, 0);
-	if (!sample)
-		return -ENOMEM;
-
-	sample->eip = pc;
-	sample->event = event;
-
-	return op_cpu_buffer_write_commit(&entry);
-}
-
-/*
- * This must be safe from any context.
- *
- * is_kernel is needed because on some architectures you cannot
- * tell if you are in kernel or user space simply by looking at
- * pc. We tag this in the buffer by generating kernel enter/exit
- * events whenever is_kernel changes
- */
-static int
-log_sample(struct oprofile_cpu_buffer *cpu_buf, unsigned long pc,
-	   unsigned long backtrace, int is_kernel, unsigned long event,
-	   struct task_struct *task)
-{
-	struct task_struct *tsk = task ? task : current;
-	cpu_buf->sample_received++;
-
-	if (pc == ESCAPE_CODE) {
-		cpu_buf->sample_invalid_eip++;
-		return 0;
-	}
-
-	if (op_add_code(cpu_buf, backtrace, is_kernel, tsk))
-		goto fail;
-
-	if (op_add_sample(cpu_buf, pc, event))
-		goto fail;
-
-	return 1;
-
-fail:
-	cpu_buf->sample_lost_overflow++;
-	return 0;
-}
-
-static inline void oprofile_begin_trace(struct oprofile_cpu_buffer *cpu_buf)
-{
-	cpu_buf->tracing = 1;
-}
-
-static inline void oprofile_end_trace(struct oprofile_cpu_buffer *cpu_buf)
-{
-	cpu_buf->tracing = 0;
-}
-
-static inline void
-__oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
-			  unsigned long event, int is_kernel,
-			  struct task_struct *task)
-{
-	struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
-	unsigned long backtrace = oprofile_backtrace_depth;
-
-	/*
-	 * if log_sample() fail we can't backtrace since we lost the
-	 * source of this event
-	 */
-	if (!log_sample(cpu_buf, pc, backtrace, is_kernel, event, task))
-		/* failed */
-		return;
-
-	if (!backtrace)
-		return;
-
-	oprofile_begin_trace(cpu_buf);
-	oprofile_ops.backtrace(regs, backtrace);
-	oprofile_end_trace(cpu_buf);
-}
-
-void oprofile_add_ext_hw_sample(unsigned long pc, struct pt_regs * const regs,
-				unsigned long event, int is_kernel,
-				struct task_struct *task)
-{
-	__oprofile_add_ext_sample(pc, regs, event, is_kernel, task);
-}
-
-void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
-			     unsigned long event, int is_kernel)
-{
-	__oprofile_add_ext_sample(pc, regs, event, is_kernel, NULL);
-}
-
-void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
-{
-	int is_kernel;
-	unsigned long pc;
-
-	if (likely(regs)) {
-		is_kernel = !user_mode(regs);
-		pc = profile_pc(regs);
-	} else {
-		is_kernel = 0;    /* This value will not be used */
-		pc = ESCAPE_CODE; /* as this causes an early return. */
-	}
-
-	__oprofile_add_ext_sample(pc, regs, event, is_kernel, NULL);
-}
-
-/*
- * Add samples with data to the ring buffer.
- *
- * Use oprofile_add_data(&entry, val) to add data and
- * oprofile_write_commit(&entry) to commit the sample.
- */
-void
-oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs,
-		       unsigned long pc, int code, int size)
-{
-	struct op_sample *sample;
-	int is_kernel = !user_mode(regs);
-	struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
-
-	cpu_buf->sample_received++;
-
-	/* no backtraces for samples with data */
-	if (op_add_code(cpu_buf, 0, is_kernel, current))
-		goto fail;
-
-	sample = op_cpu_buffer_write_reserve(entry, size + 2);
-	if (!sample)
-		goto fail;
-	sample->eip = ESCAPE_CODE;
-	sample->event = 0;		/* no flags */
-
-	op_cpu_buffer_add_data(entry, code);
-	op_cpu_buffer_add_data(entry, pc);
-
-	return;
-
-fail:
-	entry->event = NULL;
-	cpu_buf->sample_lost_overflow++;
-}
-
-int oprofile_add_data(struct op_entry *entry, unsigned long val)
-{
-	if (!entry->event)
-		return 0;
-	return op_cpu_buffer_add_data(entry, val);
-}
-
-int oprofile_add_data64(struct op_entry *entry, u64 val)
-{
-	if (!entry->event)
-		return 0;
-	if (op_cpu_buffer_get_size(entry) < 2)
-		/*
-		 * the function returns 0 to indicate a too small
-		 * buffer, even if there is some space left
-		 */
-		return 0;
-	if (!op_cpu_buffer_add_data(entry, (u32)val))
-		return 0;
-	return op_cpu_buffer_add_data(entry, (u32)(val >> 32));
-}
-
-int oprofile_write_commit(struct op_entry *entry)
-{
-	if (!entry->event)
-		return -EINVAL;
-	return op_cpu_buffer_write_commit(entry);
-}
-
-void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event)
-{
-	struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
-	log_sample(cpu_buf, pc, 0, is_kernel, event, NULL);
-}
-
-void oprofile_add_trace(unsigned long pc)
-{
-	struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
-
-	if (!cpu_buf->tracing)
-		return;
-
-	/*
-	 * broken frame can give an eip with the same value as an
-	 * escape code, abort the trace if we get it
-	 */
-	if (pc == ESCAPE_CODE)
-		goto fail;
-
-	if (op_add_sample(cpu_buf, pc, 0))
-		goto fail;
-
-	return;
-fail:
-	cpu_buf->tracing = 0;
-	cpu_buf->backtrace_aborted++;
-	return;
-}
-
-/*
- * This serves to avoid cpu buffer overflow, and makes sure
- * the task mortuary progresses
- *
- * By using schedule_delayed_work_on and then schedule_delayed_work
- * we guarantee this will stay on the correct cpu
- */
-static void wq_sync_buffer(struct work_struct *work)
-{
-	struct oprofile_cpu_buffer *b =
-		container_of(work, struct oprofile_cpu_buffer, work.work);
-	if (b->cpu != smp_processor_id() && !cpu_online(b->cpu)) {
-		cancel_delayed_work(&b->work);
-		return;
-	}
-	sync_buffer(b->cpu);
-
-	/* don't re-add the work if we're shutting down */
-	if (work_enabled)
-		schedule_delayed_work(&b->work, DEFAULT_TIMER_EXPIRE);
-}
drivers/oprofile/cpu_buffer.h deleted +0 -121
deleted file mode 100644
index 31478c0cff87..000000000000
@@ -1,121 +0,0 @@
-/**
- * @file cpu_buffer.h
- *
- * @remark Copyright 2002-2009 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- * @author Robert Richter <[email protected]>
- */
-
-#ifndef OPROFILE_CPU_BUFFER_H
-#define OPROFILE_CPU_BUFFER_H
-
-#include <linux/types.h>
-#include <linux/spinlock.h>
-#include <linux/workqueue.h>
-#include <linux/cache.h>
-#include <linux/sched.h>
-#include <linux/ring_buffer.h>
-
-struct task_struct;
-
-int alloc_cpu_buffers(void);
-void free_cpu_buffers(void);
-
-void start_cpu_work(void);
-void end_cpu_work(void);
-void flush_cpu_work(void);
-
-/* CPU buffer is composed of such entries (which are
- * also used for context switch notes)
- */
-struct op_sample {
-	unsigned long eip;
-	unsigned long event;
-	unsigned long data[];
-};
-
-struct op_entry;
-
-struct oprofile_cpu_buffer {
-	unsigned long buffer_size;
-	struct task_struct *last_task;
-	int last_is_kernel;
-	int tracing;
-	unsigned long sample_received;
-	unsigned long sample_lost_overflow;
-	unsigned long backtrace_aborted;
-	unsigned long sample_invalid_eip;
-	int cpu;
-	struct delayed_work work;
-};
-
-DECLARE_PER_CPU(struct oprofile_cpu_buffer, op_cpu_buffer);
-
-/*
- * Resets the cpu buffer to a sane state.
- *
- * reset these to invalid values; the next sample collected will
- * populate the buffer with proper values to initialize the buffer
- */
-static inline void op_cpu_buffer_reset(int cpu)
-{
-	struct oprofile_cpu_buffer *cpu_buf = &per_cpu(op_cpu_buffer, cpu);
-
-	cpu_buf->last_is_kernel = -1;
-	cpu_buf->last_task = NULL;
-}
-
-/*
- * op_cpu_buffer_add_data() and op_cpu_buffer_write_commit() may be
- * called only if op_cpu_buffer_write_reserve() did not return NULL or
- * entry->event != NULL, otherwise entry->size or entry->event will be
- * used uninitialized.
- */
-
-struct op_sample
-*op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size);
-int op_cpu_buffer_write_commit(struct op_entry *entry);
-struct op_sample *op_cpu_buffer_read_entry(struct op_entry *entry, int cpu);
-unsigned long op_cpu_buffer_entries(int cpu);
-
-/* returns the remaining free size of data in the entry */
-static inline
-int op_cpu_buffer_add_data(struct op_entry *entry, unsigned long val)
-{
-	if (!entry->size)
-		return 0;
-	*entry->data = val;
-	entry->size--;
-	entry->data++;
-	return entry->size;
-}
-
-/* returns the size of data in the entry */
-static inline
-int op_cpu_buffer_get_size(struct op_entry *entry)
-{
-	return entry->size;
-}
-
-/* returns 0 if empty or the size of data including the current value */
-static inline
-int op_cpu_buffer_get_data(struct op_entry *entry, unsigned long *val)
-{
-	int size = entry->size;
-	if (!size)
-		return 0;
-	*val = *entry->data;
-	entry->size--;
-	entry->data++;
-	return size;
-}
-
-/* extra data flags */
-#define KERNEL_CTX_SWITCH	(1UL << 0)
-#define IS_KERNEL		(1UL << 1)
-#define TRACE_BEGIN		(1UL << 2)
-#define USER_CTX_SWITCH		(1UL << 3)
-
-#endif /* OPROFILE_CPU_BUFFER_H */
drivers/oprofile/event_buffer.c deleted +0 -209
deleted file mode 100644
index 6c9edc8bbc95..000000000000
@@ -1,209 +0,0 @@
-/**
- * @file event_buffer.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- *
- * This is the global event buffer that the user-space
- * daemon reads from. The event buffer is an untyped array
- * of unsigned longs. Entries are prefixed by the
- * escape value ESCAPE_CODE followed by an identifying code.
- */
-
-#include <linux/vmalloc.h>
-#include <linux/oprofile.h>
-#include <linux/sched/signal.h>
-#include <linux/capability.h>
-#include <linux/dcookies.h>
-#include <linux/fs.h>
-#include <linux/uaccess.h>
-
-#include "oprof.h"
-#include "event_buffer.h"
-#include "oprofile_stats.h"
-
-DEFINE_MUTEX(buffer_mutex);
-
-static unsigned long buffer_opened;
-static DECLARE_WAIT_QUEUE_HEAD(buffer_wait);
-static unsigned long *event_buffer;
-static unsigned long buffer_size;
-static unsigned long buffer_watershed;
-static size_t buffer_pos;
-/* atomic_t because wait_event checks it outside of buffer_mutex */
-static atomic_t buffer_ready = ATOMIC_INIT(0);
-
-/*
- * Add an entry to the event buffer. When we get near to the end we
- * wake up the process sleeping on the read() of the file. To protect
- * the event_buffer this function may only be called when buffer_mutex
- * is set.
- */
-void add_event_entry(unsigned long value)
-{
-	/*
-	 * This shouldn't happen since all workqueues or handlers are
-	 * canceled or flushed before the event buffer is freed.
-	 */
-	if (!event_buffer) {
-		WARN_ON_ONCE(1);
-		return;
-	}
-
-	if (buffer_pos == buffer_size) {
-		atomic_inc(&oprofile_stats.event_lost_overflow);
-		return;
-	}
-
-	event_buffer[buffer_pos] = value;
-	if (++buffer_pos == buffer_size - buffer_watershed) {
-		atomic_set(&buffer_ready, 1);
-		wake_up(&buffer_wait);
-	}
-}
-
-
-/* Wake up the waiting process if any. This happens
- * on "echo 0 >/dev/oprofile/enable" so the daemon
- * processes the data remaining in the event buffer.
- */
-void wake_up_buffer_waiter(void)
-{
-	mutex_lock(&buffer_mutex);
-	atomic_set(&buffer_ready, 1);
-	wake_up(&buffer_wait);
-	mutex_unlock(&buffer_mutex);
-}
-
-
-int alloc_event_buffer(void)
-{
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&oprofilefs_lock, flags);
-	buffer_size = oprofile_buffer_size;
-	buffer_watershed = oprofile_buffer_watershed;
-	raw_spin_unlock_irqrestore(&oprofilefs_lock, flags);
-
-	if (buffer_watershed >= buffer_size)
-		return -EINVAL;
-
-	buffer_pos = 0;
-	event_buffer = vmalloc(array_size(buffer_size, sizeof(unsigned long)));
-	if (!event_buffer)
-		return -ENOMEM;
-
-	return 0;
-}
-
-
-void free_event_buffer(void)
-{
-	mutex_lock(&buffer_mutex);
-	vfree(event_buffer);
-	buffer_pos = 0;
-	event_buffer = NULL;
-	mutex_unlock(&buffer_mutex);
-}
-
-
-static int event_buffer_open(struct inode *inode, struct file *file)
-{
-	int err = -EPERM;
-
-	if (!perfmon_capable())
-		return -EPERM;
-
-	if (test_and_set_bit_lock(0, &buffer_opened))
-		return -EBUSY;
-
-	/* Register as a user of dcookies
-	 * to ensure they persist for the lifetime of
-	 * the open event file
-	 */
-	err = -EINVAL;
-	file->private_data = dcookie_register();
-	if (!file->private_data)
-		goto out;
-
-	if ((err = oprofile_setup()))
-		goto fail;
-
-	/* NB: the actual start happens from userspace
-	 * echo 1 >/dev/oprofile/enable
-	 */
-
-	return nonseekable_open(inode, file);
-
-fail:
-	dcookie_unregister(file->private_data);
-out:
-	__clear_bit_unlock(0, &buffer_opened);
-	return err;
-}
-
-
-static int event_buffer_release(struct inode *inode, struct file *file)
-{
-	oprofile_stop();
-	oprofile_shutdown();
-	dcookie_unregister(file->private_data);
-	buffer_pos = 0;
-	atomic_set(&buffer_ready, 0);
-	__clear_bit_unlock(0, &buffer_opened);
-	return 0;
-}
-
-
-static ssize_t event_buffer_read(struct file *file, char __user *buf,
-				 size_t count, loff_t *offset)
-{
-	int retval = -EINVAL;
-	size_t const max = buffer_size * sizeof(unsigned long);
-
-	/* handling partial reads is more trouble than it's worth */
-	if (count != max || *offset)
-		return -EINVAL;
-
-	wait_event_interruptible(buffer_wait, atomic_read(&buffer_ready));
-
-	if (signal_pending(current))
-		return -EINTR;
-
-	/* can't currently happen */
-	if (!atomic_read(&buffer_ready))
-		return -EAGAIN;
-
-	mutex_lock(&buffer_mutex);
-
-	/* May happen if the buffer is freed during pending reads. */
-	if (!event_buffer) {
-		retval = -EINTR;
-		goto out;
-	}
-
-	atomic_set(&buffer_ready, 0);
-
-	retval = -EFAULT;
-
-	count = buffer_pos * sizeof(unsigned long);
-
-	if (copy_to_user(buf, event_buffer, count))
-		goto out;
-
-	retval = count;
-	buffer_pos = 0;
-
-out:
-	mutex_unlock(&buffer_mutex);
-	return retval;
-}
-
-const struct file_operations event_buffer_fops = {
-	.open		= event_buffer_open,
-	.release	= event_buffer_release,
-	.read		= event_buffer_read,
-	.llseek		= no_llseek,
-};
drivers/oprofile/event_buffer.h deleted +0 -40
deleted file mode 100644
index a8d5bb3cba89..000000000000
@@ -1,40 +0,0 @@
-/**
- * @file event_buffer.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#ifndef EVENT_BUFFER_H
-#define EVENT_BUFFER_H
-
-#include <linux/types.h>
-#include <linux/mutex.h>
-
-int alloc_event_buffer(void);
-
-void free_event_buffer(void);
-
-/**
- * Add data to the event buffer.
- * The data passed is free-form, but typically consists of
- * file offsets, dcookies, context information, and ESCAPE codes.
- */
-void add_event_entry(unsigned long data);
-
-/* wake up the process sleeping on the event file */
-void wake_up_buffer_waiter(void);
-
-#define INVALID_COOKIE ~0UL
-#define NO_COOKIE 0UL
-
-extern const struct file_operations event_buffer_fops;
-
-/* mutex between sync_cpu_buffers() and the
- * file reading code.
- */
-extern struct mutex buffer_mutex;
-
-#endif /* EVENT_BUFFER_H */
drivers/oprofile/nmi_timer_int.c deleted +0 -157
deleted file mode 100644
index f343bd96609a..000000000000
@@ -1,157 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/**
- * @file nmi_timer_int.c
- *
- * @remark Copyright 2011 Advanced Micro Devices, Inc.
- *
- * @author Robert Richter <[email protected]>
- */
-
-#include <linux/init.h>
-#include <linux/smp.h>
-#include <linux/errno.h>
-#include <linux/oprofile.h>
-#include <linux/perf_event.h>
-
-#ifdef CONFIG_OPROFILE_NMI_TIMER
-
-static DEFINE_PER_CPU(struct perf_event *, nmi_timer_events);
-static int ctr_running;
-
-static struct perf_event_attr nmi_timer_attr = {
-	.type           = PERF_TYPE_HARDWARE,
-	.config         = PERF_COUNT_HW_CPU_CYCLES,
-	.size           = sizeof(struct perf_event_attr),
-	.pinned         = 1,
-	.disabled       = 1,
-};
-
-static void nmi_timer_callback(struct perf_event *event,
-			       struct perf_sample_data *data,
-			       struct pt_regs *regs)
-{
-	event->hw.interrupts = 0;       /* don't throttle interrupts */
-	oprofile_add_sample(regs, 0);
-}
-
-static int nmi_timer_start_cpu(int cpu)
-{
-	struct perf_event *event = per_cpu(nmi_timer_events, cpu);
-
-	if (!event) {
-		event = perf_event_create_kernel_counter(&nmi_timer_attr, cpu, NULL,
-							 nmi_timer_callback, NULL);
-		if (IS_ERR(event))
-			return PTR_ERR(event);
-		per_cpu(nmi_timer_events, cpu) = event;
-	}
-
-	if (event && ctr_running)
-		perf_event_enable(event);
-
-	return 0;
-}
-
-static void nmi_timer_stop_cpu(int cpu)
-{
-	struct perf_event *event = per_cpu(nmi_timer_events, cpu);
-
-	if (event && ctr_running)
-		perf_event_disable(event);
-}
-
-static int nmi_timer_cpu_online(unsigned int cpu)
-{
-	nmi_timer_start_cpu(cpu);
-	return 0;
-}
-static int nmi_timer_cpu_predown(unsigned int cpu)
-{
-	nmi_timer_stop_cpu(cpu);
-	return 0;
-}
-
-static int nmi_timer_start(void)
-{
-	int cpu;
-
-	get_online_cpus();
-	ctr_running = 1;
-	for_each_online_cpu(cpu)
-		nmi_timer_start_cpu(cpu);
-	put_online_cpus();
-
-	return 0;
-}
-
-static void nmi_timer_stop(void)
-{
-	int cpu;
-
-	get_online_cpus();
-	for_each_online_cpu(cpu)
-		nmi_timer_stop_cpu(cpu);
-	ctr_running = 0;
-	put_online_cpus();
-}
-
-static enum cpuhp_state hp_online;
-
-static void nmi_timer_shutdown(void)
-{
-	struct perf_event *event;
-	int cpu;
-
-	cpuhp_remove_state(hp_online);
-	for_each_possible_cpu(cpu) {
-		event = per_cpu(nmi_timer_events, cpu);
-		if (!event)
-			continue;
-		perf_event_disable(event);
-		per_cpu(nmi_timer_events, cpu) = NULL;
-		perf_event_release_kernel(event);
-	}
-}
-
-static int nmi_timer_setup(void)
-{
-	int err;
-	u64 period;
-
-	/* clock cycles per tick: */
-	period = (u64)cpu_khz * 1000;
-	do_div(period, HZ);
-	nmi_timer_attr.sample_period = period;
-
-	err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "oprofile/nmi:online",
-				nmi_timer_cpu_online, nmi_timer_cpu_predown);
-	if (err < 0) {
-		nmi_timer_shutdown();
-		return err;
-	}
-	hp_online = err;
-	return 0;
-}
-
-int __init op_nmi_timer_init(struct oprofile_operations *ops)
-{
-	int err = 0;
-
-	err = nmi_timer_setup();
-	if (err)
-		return err;
-	nmi_timer_shutdown();		/* only check, don't alloc */
-
-	ops->create_files	= NULL;
-	ops->setup		= nmi_timer_setup;
-	ops->shutdown		= nmi_timer_shutdown;
-	ops->start		= nmi_timer_start;
-	ops->stop		= nmi_timer_stop;
-	ops->cpu_type		= "timer";
-
-	printk(KERN_INFO "oprofile: using NMI timer interrupt.\n");
-
-	return 0;
-}
-
-#endif
drivers/oprofile/oprof.c deleted +0 -286
deleted file mode 100644
index ed2c3ec07024..000000000000
@@ -1,286 +0,0 @@
-/**
- * @file oprof.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/oprofile.h>
-#include <linux/moduleparam.h>
-#include <linux/workqueue.h>
-#include <linux/time.h>
-#include <linux/mutex.h>
-
-#include "oprof.h"
-#include "event_buffer.h"
-#include "cpu_buffer.h"
-#include "buffer_sync.h"
-#include "oprofile_stats.h"
-
-struct oprofile_operations oprofile_ops;
-
-unsigned long oprofile_started;
-unsigned long oprofile_backtrace_depth;
-static unsigned long is_setup;
-static DEFINE_MUTEX(start_mutex);
-
-/* timer
-   0 - use performance monitoring hardware if available
-   1 - use the timer int mechanism regardless
- */
-static int timer = 0;
-
-int oprofile_setup(void)
-{
-	int err;
-
-	mutex_lock(&start_mutex);
-
-	if ((err = alloc_cpu_buffers()))
-		goto out;
-
-	if ((err = alloc_event_buffer()))
-		goto out1;
-
-	if (oprofile_ops.setup && (err = oprofile_ops.setup()))
-		goto out2;
-
-	/* Note even though this starts part of the
-	 * profiling overhead, it's necessary to prevent
-	 * us missing task deaths and eventually oopsing
-	 * when trying to process the event buffer.
-	 */
-	if (oprofile_ops.sync_start) {
-		int sync_ret = oprofile_ops.sync_start();
-		switch (sync_ret) {
-		case 0:
-			goto post_sync;
-		case 1:
-			goto do_generic;
-		case -1:
-			goto out3;
-		default:
-			goto out3;
-		}
-	}
-do_generic:
-	if ((err = sync_start()))
-		goto out3;
-
-post_sync:
-	is_setup = 1;
-	mutex_unlock(&start_mutex);
-	return 0;
-
-out3:
-	if (oprofile_ops.shutdown)
-		oprofile_ops.shutdown();
-out2:
-	free_event_buffer();
-out1:
-	free_cpu_buffers();
-out:
-	mutex_unlock(&start_mutex);
-	return err;
-}
-
-#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
-
-static void switch_worker(struct work_struct *work);
-static DECLARE_DELAYED_WORK(switch_work, switch_worker);
-
-static void start_switch_worker(void)
-{
-	if (oprofile_ops.switch_events)
-		schedule_delayed_work(&switch_work, oprofile_time_slice);
-}
-
-static void stop_switch_worker(void)
-{
-	cancel_delayed_work_sync(&switch_work);
-}
-
-static void switch_worker(struct work_struct *work)
-{
-	if (oprofile_ops.switch_events())
-		return;
-
-	atomic_inc(&oprofile_stats.multiplex_counter);
-	start_switch_worker();
-}
-
-/* User inputs in ms, converts to jiffies */
-int oprofile_set_timeout(unsigned long val_msec)
-{
-	int err = 0;
-	unsigned long time_slice;
-
-	mutex_lock(&start_mutex);
-
-	if (oprofile_started) {
-		err = -EBUSY;
-		goto out;
-	}
-
-	if (!oprofile_ops.switch_events) {
-		err = -EINVAL;
-		goto out;
-	}
-
-	time_slice = msecs_to_jiffies(val_msec);
-	if (time_slice == MAX_JIFFY_OFFSET) {
-		err = -EINVAL;
-		goto out;
-	}
-
-	oprofile_time_slice = time_slice;
-
-out:
-	mutex_unlock(&start_mutex);
-	return err;
-
-}
-
-#else
-
-static inline void start_switch_worker(void) { }
-static inline void stop_switch_worker(void) { }
-
-#endif
-
-/* Actually start profiling (echo 1>/dev/oprofile/enable) */
-int oprofile_start(void)
-{
-	int err = -EINVAL;
-
-	mutex_lock(&start_mutex);
-
-	if (!is_setup)
-		goto out;
-
-	err = 0;
-
-	if (oprofile_started)
-		goto out;
-
-	oprofile_reset_stats();
-
-	if ((err = oprofile_ops.start()))
-		goto out;
-
-	start_switch_worker();
-
-	oprofile_started = 1;
-out:
-	mutex_unlock(&start_mutex);
-	return err;
-}
-
-
-/* echo 0>/dev/oprofile/enable */
-void oprofile_stop(void)
-{
-	mutex_lock(&start_mutex);
-	if (!oprofile_started)
-		goto out;
-	oprofile_ops.stop();
-	oprofile_started = 0;
-
-	stop_switch_worker();
-
-	/* wake up the daemon to read what remains */
-	wake_up_buffer_waiter();
-out:
-	mutex_unlock(&start_mutex);
-}
-
-
-void oprofile_shutdown(void)
-{
-	mutex_lock(&start_mutex);
-	if (oprofile_ops.sync_stop) {
-		int sync_ret = oprofile_ops.sync_stop();
-		switch (sync_ret) {
-		case 0:
-			goto post_sync;
-		case 1:
-			goto do_generic;
-		default:
-			goto post_sync;
-		}
-	}
-do_generic:
-	sync_stop();
-post_sync:
-	if (oprofile_ops.shutdown)
-		oprofile_ops.shutdown();
-	is_setup = 0;
-	free_event_buffer();
-	free_cpu_buffers();
-	mutex_unlock(&start_mutex);
-}
-
-int oprofile_set_ulong(unsigned long *addr, unsigned long val)
-{
-	int err = -EBUSY;
-
-	mutex_lock(&start_mutex);
-	if (!oprofile_started) {
-		*addr = val;
-		err = 0;
-	}
-	mutex_unlock(&start_mutex);
-
-	return err;
-}
-
-static int timer_mode;
-
-static int __init oprofile_init(void)
-{
-	int err;
-
-	/* always init architecture to setup backtrace support */
-	timer_mode = 0;
-	err = oprofile_arch_init(&oprofile_ops);
-	if (!err) {
-		if (!timer && !oprofilefs_register())
-			return 0;
-		oprofile_arch_exit();
-	}
-
-	/* setup timer mode: */
-	timer_mode = 1;
-	/* no nmi timer mode if oprofile.timer is set */
-	if (timer || op_nmi_timer_init(&oprofile_ops)) {
-		err = oprofile_timer_init(&oprofile_ops);
-		if (err)
-			return err;
-	}
-
-	return oprofilefs_register();
-}
-
-
-static void __exit oprofile_exit(void)
-{
-	oprofilefs_unregister();
-	if (!timer_mode)
-		oprofile_arch_exit();
-}
-
-
-module_init(oprofile_init);
-module_exit(oprofile_exit);
-
-module_param_named(timer, timer, int, 0644);
-MODULE_PARM_DESC(timer, "force use of timer interrupt");
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("John Levon <[email protected]>");
-MODULE_DESCRIPTION("OProfile system profiler");
drivers/oprofile/oprof.h deleted +0 -50
deleted file mode 100644
index d5412060ab0f..000000000000
@@ -1,50 +0,0 @@
-/**
- * @file oprof.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#ifndef OPROF_H
-#define OPROF_H
-
-int oprofile_setup(void);
-void oprofile_shutdown(void);
-
-int oprofilefs_register(void);
-void oprofilefs_unregister(void);
-
-int oprofile_start(void);
-void oprofile_stop(void);
-
-struct oprofile_operations;
-
-extern unsigned long oprofile_buffer_size;
-extern unsigned long oprofile_cpu_buffer_size;
-extern unsigned long oprofile_buffer_watershed;
-extern unsigned long oprofile_time_slice;
-
-extern struct oprofile_operations oprofile_ops;
-extern unsigned long oprofile_started;
-extern unsigned long oprofile_backtrace_depth;
-
-struct dentry;
-
-void oprofile_create_files(struct dentry *root);
-int oprofile_timer_init(struct oprofile_operations *ops);
-#ifdef CONFIG_OPROFILE_NMI_TIMER
-int op_nmi_timer_init(struct oprofile_operations *ops);
-#else
-static inline int op_nmi_timer_init(struct oprofile_operations *ops)
-{
-	return -ENODEV;
-}
-#endif
-
-
-int oprofile_set_ulong(unsigned long *addr, unsigned long val);
-int oprofile_set_timeout(unsigned long time);
-
-#endif /* OPROF_H */
drivers/oprofile/oprofile_files.c deleted +0 -201
deleted file mode 100644
index ee2cfce358b9..000000000000
@@ -1,201 +0,0 @@
-/**
- * @file oprofile_files.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <[email protected]>
- */
-
-#include <linux/fs.h>
-#include <linux/oprofile.h>
-#include <linux/jiffies.h>
-
-#include "event_buffer.h"
-#include "oprofile_stats.h"
-#include "oprof.h"
-
-#define BUFFER_SIZE_DEFAULT		131072
-#define CPU_BUFFER_SIZE_DEFAULT		8192
-#define BUFFER_WATERSHED_DEFAULT	32768	/* FIXME: tune */
-#define TIME_SLICE_DEFAULT		1
-
-unsigned long oprofile_buffer_size;
-unsigned long oprofile_cpu_buffer_size;
-unsigned long oprofile_buffer_watershed;
-unsigned long oprofile_time_slice;
-
-#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
-
-static ssize_t timeout_read(struct file *file, char __user *buf,
-		size_t count, loff_t *offset)
-{
-	return oprofilefs_ulong_to_user(jiffies_to_msecs(oprofile_time_slice),
-					buf, count, offset);
-}
-
-
-static ssize_t timeout_write(struct file *file, char const __user *buf,
-		size_t count, loff_t *offset)
-{
-	unsigned long val;
-	int retval;
-
-	if (*offset)
-		return -EINVAL;
-
-	retval = oprofilefs_ulong_from_user(&val, buf, count);
-	if (retval <= 0)
-		return retval;
-
-	retval = oprofile_set_timeout(val);
-
-	if (retval)
-		return retval;
-	return count;
-}
-
-
-static const struct file_operations timeout_fops = {
-	.read		= timeout_read,
-	.write		= timeout_write,
-	.llseek		= default_llseek,
-};
-
-#endif
-
-
-static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
-{
-	return oprofilefs_ulong_to_user(oprofile_backtrace_depth, buf, count,
-					offset);
-}
-
-
-static ssize_t depth_write(struct file *file, char const __user *buf, size_t count, loff_t *offset)
-{
-	unsigned long val;
-	int retval;
-
-	if (*offset)
-		return -EINVAL;
-
-	if (!oprofile_ops.backtrace)
-		return -EINVAL;
-
-	retval = oprofilefs_ulong_from_user(&val, buf, count);
-	if (retval <= 0)
-		return retval;
-
-	retval = oprofile_set_ulong(&oprofile_backtrace_depth, val);
-	if (retval)
-		return retval;
-
-	return count;
-}
-
-
-static const struct file_operations depth_fops = {
-	.read		= depth_read,
-	.write		= depth_write,
-	.llseek		= default_llseek,
-};
-
-
-static ssize_t pointer_size_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
-{
-	return oprofilefs_ulong_to_user(sizeof(void *), buf, count, offset);
-}
-
-
-static const struct file_operations pointer_size_fops = {
-	.read		= pointer_size_read,
-	.llseek		= default_llseek,
-};
-
-
-static ssize_t cpu_type_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
-{
-	return oprofilefs_str_to_user(oprofile_ops.cpu_type, buf, count, offset);
-}
-
-
-static const struct file_operations cpu_type_fops = {
-	.read		= cpu_type_read,
-	.llseek		= default_llseek,
-};
-
-
-static ssize_t enable_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
-{
-	return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset);
-}
-
-
-static ssize_t enable_write(struct file *file, char const __user *buf, size_t count, loff_t *offset)
-{
-	unsigned long val;
-	int retval;
-
-	if (*offset)
-		return -EINVAL;
-
-	retval = oprofilefs_ulong_from_user(&val, buf, count);
-	if (retval <= 0)
-		return retval;
-
-	retval = 0;
-	if (val)
-		retval = oprofile_start();
-	else
-		oprofile_stop();
-
-	if (retval)
-		return retval;
-	return count;
-}
-
-
-static const struct file_operations enable_fops = {
-	.read		= enable_read,
-	.write		= enable_write,
-	.llseek		= default_llseek,
-};
-
-
-static ssize_t dump_write(struct file *file, char const __user *buf, size_t count, loff_t *offset)
-{
-	wake_up_buffer_waiter();
-	return count;
-}
-
-
-static const struct file_operations dump_fops = {
-	.write		= dump_write,
-	.llseek		= noop_llseek,
-};
-
-void oprofile_create_files(struct dentry *root)
-{
-	/* reinitialize default values */
-	oprofile_buffer_size =		BUFFER_SIZE_DEFAULT;
-	oprofile_cpu_buffer_size =	CPU_BUFFER_SIZE_DEFAULT;
-	oprofile_buffer_watershed =	BUFFER_WATERSHED_DEFAULT;
-	oprofile_time_slice =		msecs_to_jiffies(TIME_SLICE_DEFAULT);
-
-	oprofilefs_create_file(root, "enable", &enable_fops);
-	oprofilefs_create_file_perm(root, "dump", &dump_fops, 0666);
-	oprofilefs_create_file(root, "buffer", &event_buffer_fops);
-	oprofilefs_create_ulong(root, "buffer_size", &oprofile_buffer_size);
-	oprofilefs_create_ulong(root, "buffer_watershed", &oprofile_buffer_watershed);
-	oprofilefs_create_ulong(root, "cpu_buffer_size", &oprofile_cpu_buffer_size);
-	oprofilefs_create_file(root, "cpu_type", &cpu_type_fops);
-	oprofilefs_create_file(root, "backtrace_depth", &depth_fops);
-	oprofilefs_create_file(root, "pointer_size", &pointer_size_fops);
-#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
-	oprofilefs_create_file(root, "time_slice", &timeout_fops);
-#endif
-	oprofile_create_stats_files(root);
-	if (oprofile_ops.create_files)
-		oprofile_ops.create_files(root);
-}
drivers/oprofile/oprofile_perf.c deleted +0 -328
deleted file mode 100644
index 98a63a5f8763..000000000000
@@ -1,328 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright 2010 ARM Ltd.
- * Copyright 2012 Advanced Micro Devices, Inc., Robert Richter
- *
- * Perf-events backend for OProfile.
- */
-#include <linux/perf_event.h>
-#include <linux/platform_device.h>
-#include <linux/oprofile.h>
-#include <linux/slab.h>
-
-/*
- * Per performance monitor configuration as set via oprofilefs.
- */
-struct op_counter_config {
-	unsigned long count;
-	unsigned long enabled;
-	unsigned long event;
-	unsigned long unit_mask;
-	unsigned long kernel;
-	unsigned long user;
-	struct perf_event_attr attr;
-};
-
-static int oprofile_perf_enabled;
-static DEFINE_MUTEX(oprofile_perf_mutex);
-
-static struct op_counter_config *counter_config;
-static DEFINE_PER_CPU(struct perf_event **, perf_events);
-static int num_counters;
-
-/*
- * Overflow callback for oprofile.
- */
-static void op_overflow_handler(struct perf_event *event,
-			struct perf_sample_data *data, struct pt_regs *regs)
-{
-	int id;
-	u32 cpu = smp_processor_id();
-
-	for (id = 0; id < num_counters; ++id)
-		if (per_cpu(perf_events, cpu)[id] == event)
-			break;
-
-	if (id != num_counters)
-		oprofile_add_sample(regs, id);
-	else
-		pr_warn("oprofile: ignoring spurious overflow on cpu %u\n",
-			cpu);
-}
-
-/*
- * Called by oprofile_perf_setup to create perf attributes to mirror the oprofile
- * settings in counter_config. Attributes are created as `pinned' events and
- * so are permanently scheduled on the PMU.
- */
-static void op_perf_setup(void)
-{
-	int i;
-	u32 size = sizeof(struct perf_event_attr);
-	struct perf_event_attr *attr;
-
-	for (i = 0; i < num_counters; ++i) {
-		attr = &counter_config[i].attr;
-		memset(attr, 0, size);
-		attr->type		= PERF_TYPE_RAW;
-		attr->size		= size;
-		attr->config		= counter_config[i].event;
-		attr->sample_period	= counter_config[i].count;
-		attr->pinned		= 1;
-	}
-}
-
-static int op_create_counter(int cpu, int event)
-{
-	struct perf_event *pevent;
-
-	if (!counter_config[event].enabled || per_cpu(perf_events, cpu)[event])
-		return 0;
-
-	pevent = perf_event_create_kernel_counter(&counter_config[event].attr,
-						  cpu, NULL,
-						  op_overflow_handler, NULL);
-
-	if (IS_ERR(pevent))
-		return PTR_ERR(pevent);
-
-	if (pevent->state != PERF_EVENT_STATE_ACTIVE) {
-		perf_event_release_kernel(pevent);
-		pr_warn("oprofile: failed to enable event %d on CPU %d\n",
-			event, cpu);
-		return -EBUSY;
-	}
-
-	per_cpu(perf_events, cpu)[event] = pevent;
-
-	return 0;
-}
-
-static void op_destroy_counter(int cpu, int event)
-{
-	struct perf_event *pevent = per_cpu(perf_events, cpu)[event];
-
-	if (pevent) {
-		perf_event_release_kernel(pevent);
-		per_cpu(perf_events, cpu)[event] = NULL;
-	}
-}
-
-/*
- * Called by oprofile_perf_start to create active perf events based on the
- * perviously configured attributes.
- */
-static int op_perf_start(void)
-{
-	int cpu, event, ret = 0;
-
-	for_each_online_cpu(cpu) {
-		for (event = 0; event < num_counters; ++event) {
-			ret = op_create_counter(cpu, event);
-			if (ret)
-				return ret;
-		}
-	}
-
-	return ret;
-}
-
-/*
- * Called by oprofile_perf_stop at the end of a profiling run.
- */
-static void op_perf_stop(void)
-{
-	int cpu, event;
-
-	for_each_online_cpu(cpu)
-		for (event = 0; event < num_counters; ++event)
-			op_destroy_counter(cpu, event);
-}
-
-static int oprofile_perf_create_files(struct dentry *root)
-{
-	unsigned int i;
-
-	for (i = 0; i < num_counters; i++) {
-		struct dentry *dir;
-		char buf[4];
-
-		snprintf(buf, sizeof buf, "%d", i);
-		dir = oprofilefs_mkdir(root, buf);
-		oprofilefs_create_ulong(dir, "enabled", &counter_config[i].enabled);
-		oprofilefs_create_ulong(dir, "event", &counter_config[i].event);
-		oprofilefs_create_ulong(dir, "count", &counter_config[i].count);
-		oprofilefs_create_ulong(dir, "unit_mask", &counter_config[i].unit_mask);
-		oprofilefs_create_ulong(dir, "kernel", &counter_config[i].kernel);
-		oprofilefs_create_ulong(dir, "user", &counter_config[i].user);
-	}
-
-	return 0;
-}
-
-static int oprofile_perf_setup(void)
-{
-	raw_spin_lock(&oprofilefs_lock);
-	op_perf_setup();
-	raw_spin_unlock(&oprofilefs_lock);
-	return 0;
-}
-
-static int oprofile_perf_start(void)
-{
-	int ret = -EBUSY;
-
-	mutex_lock(&oprofile_perf_mutex);
-	if (!oprofile_perf_enabled) {
-		ret = 0;
-		op_perf_start();
-		oprofile_perf_enabled = 1;
-	}
-	mutex_unlock(&oprofile_perf_mutex);
-	return ret;
-}
-
-static void oprofile_perf_stop(void)
-{
-	mutex_lock(&oprofile_perf_mutex);
-	if (oprofile_perf_enabled)
-		op_perf_stop();
-	oprofile_perf_enabled = 0;
-	mutex_unlock(&oprofile_perf_mutex);
-}
-
-#ifdef CONFIG_PM
-
-static int oprofile_perf_suspend(struct platform_device *dev, pm_message_t state)
-{
-	mutex_lock(&oprofile_perf_mutex);
-	if (oprofile_perf_enabled)
-		op_perf_stop();
-	mutex_unlock(&oprofile_perf_mutex);
-	return 0;
-}
-
-static int oprofile_perf_resume(struct platform_device *dev)
-{
-	mutex_lock(&oprofile_perf_mutex);
-	if (oprofile_perf_enabled && op_perf_start())
-		oprofile_perf_enabled = 0;
-	mutex_unlock(&oprofile_perf_mutex);
-	return 0;
-}
-
-static struct platform_driver oprofile_driver = {
-	.driver		= {
-		.name		= "oprofile-perf",
-	},
-	.resume		= oprofile_perf_resume,
-	.suspend	= oprofile_perf_suspend,
-};
-
-static struct platform_device *oprofile_pdev;
-
-static int __init init_driverfs(void)
-{
-	int ret;
-
-	ret = platform_driver_register(&oprofile_driver);
-	if (ret)
-		return ret;
-
-	oprofile_pdev =	platform_device_register_simple(
-				oprofile_driver.driver.name, 0, NULL, 0);
-	if (IS_ERR(oprofile_pdev)) {
-		ret = PTR_ERR(oprofile_pdev);
-		platform_driver_unregister(&oprofile_driver);
-	}
-
-	return ret;
-}
-
-static void exit_driverfs(void)
-{
-	platform_device_unregister(oprofile_pdev);
-	platform_driver_unregister(&oprofile_driver);
-}
-
-#else
-
-static inline int  init_driverfs(void) { return 0; }
-static inline void exit_driverfs(void) { }
-
-#endif /* CONFIG_PM */
-
-void oprofile_perf_exit(void)
-{
-	int cpu, id;
-	struct perf_event *event;
-
-	for_each_possible_cpu(cpu) {
-		for (id = 0; id < num_counters; ++id) {
-			event = per_cpu(perf_events, cpu)[id];
-			if (event)
-				perf_event_release_kernel(event);
-		}
-
-		kfree(per_cpu(perf_events, cpu));
-	}
-
-	kfree(counter_config);
-	exit_driverfs();
-}
-
-int __init oprofile_perf_init(struct oprofile_operations *ops)
-{
-	int cpu, ret = 0;
-
-	ret = init_driverfs();
-	if (ret)
-		return ret;
-
-	num_counters = perf_num_counters();
-	if (num_counters <= 0) {
-		pr_info("oprofile: no performance counters\n");
-		ret = -ENODEV;
-		goto out;
-	}
-
-	counter_config = kcalloc(num_counters,
-			sizeof(struct op_counter_config), GFP_KERNEL);
-
-	if (!counter_config) {
-		pr_info("oprofile: failed to allocate %d "
-				"counters\n", num_counters);
-		ret = -ENOMEM;
-		num_counters = 0;
-		goto out;
-	}
-
-	for_each_possible_cpu(cpu) {
-		per_cpu(perf_events, cpu) = kcalloc(num_counters,
-				sizeof(struct perf_event *), GFP_KERNEL);
-		if (!per_cpu(perf_events, cpu)) {
-			pr_info("oprofile: failed to allocate %d perf events "
-					"for cpu %d\n", num_counters, cpu);
-			ret = -ENOMEM;
-			goto out;
-		}
-	}
-
-	ops->create_files	= oprofile_perf_create_files;
-	ops->setup		= oprofile_perf_setup;
-	ops->start		= oprofile_perf_start;
-	ops->stop		= oprofile_perf_stop;
-	ops->shutdown		= oprofile_perf_stop;
-	ops->cpu_type		= op_name_from_perf_id();
-
-	if (!ops->cpu_type)
-		ret = -ENODEV;
-	else
-		pr_info("oprofile: using %s\n", ops->cpu_type);
-
-out:
-	if (ret)
-		oprofile_perf_exit();
-
-	return ret;
-}
drivers/oprofile/oprofile_stats.c deleted +0 -84
deleted file mode 100644
index 59659cea4582..000000000000
@@ -1,84 +0,0 @@
-/**
- * @file oprofile_stats.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- */
-
-#include <linux/oprofile.h>
-#include <linux/smp.h>
-#include <linux/cpumask.h>
-#include <linux/threads.h>
-
-#include "oprofile_stats.h"
-#include "cpu_buffer.h"
-
-struct oprofile_stat_struct oprofile_stats;
-
-void oprofile_reset_stats(void)
-{
-	struct oprofile_cpu_buffer *cpu_buf;
-	int i;
-
-	for_each_possible_cpu(i) {
-		cpu_buf = &per_cpu(op_cpu_buffer, i);
-		cpu_buf->sample_received = 0;
-		cpu_buf->sample_lost_overflow = 0;
-		cpu_buf->backtrace_aborted = 0;
-		cpu_buf->sample_invalid_eip = 0;
-	}
-
-	atomic_set(&oprofile_stats.sample_lost_no_mm, 0);
-	atomic_set(&oprofile_stats.sample_lost_no_mapping, 0);
-	atomic_set(&oprofile_stats.event_lost_overflow, 0);
-	atomic_set(&oprofile_stats.bt_lost_no_mapping, 0);
-	atomic_set(&oprofile_stats.multiplex_counter, 0);
-}
-
-
-void oprofile_create_stats_files(struct dentry *root)
-{
-	struct oprofile_cpu_buffer *cpu_buf;
-	struct dentry *cpudir;
-	struct dentry *dir;
-	char buf[10];
-	int i;
-
-	dir = oprofilefs_mkdir(root, "stats");
-	if (!dir)
-		return;
-
-	for_each_possible_cpu(i) {
-		cpu_buf = &per_cpu(op_cpu_buffer, i);
-		snprintf(buf, 10, "cpu%d", i);
-		cpudir = oprofilefs_mkdir(dir, buf);
-
-		/* Strictly speaking access to these ulongs is racy,
-		 * but we can't simply lock them, and they are
-		 * informational only.
-		 */
-		oprofilefs_create_ro_ulong(cpudir, "sample_received",
-			&cpu_buf->sample_received);
-		oprofilefs_create_ro_ulong(cpudir, "sample_lost_overflow",
-			&cpu_buf->sample_lost_overflow);
-		oprofilefs_create_ro_ulong(cpudir, "backtrace_aborted",
-			&cpu_buf->backtrace_aborted);
-		oprofilefs_create_ro_ulong(cpudir, "sample_invalid_eip",
-			&cpu_buf->sample_invalid_eip);
-	}
-
-	oprofilefs_create_ro_atomic(dir, "sample_lost_no_mm",
-		&oprofile_stats.sample_lost_no_mm);
-	oprofilefs_create_ro_atomic(dir, "sample_lost_no_mapping",
-		&oprofile_stats.sample_lost_no_mapping);
-	oprofilefs_create_ro_atomic(dir, "event_lost_overflow",
-		&oprofile_stats.event_lost_overflow);
-	oprofilefs_create_ro_atomic(dir, "bt_lost_no_mapping",
-		&oprofile_stats.bt_lost_no_mapping);
-#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
-	oprofilefs_create_ro_atomic(dir, "multiplex_counter",
-		&oprofile_stats.multiplex_counter);
-#endif
-}
drivers/oprofile/oprofile_stats.h deleted +0 -33
deleted file mode 100644
index 1fc622bd1834..000000000000
@@ -1,33 +0,0 @@
-/**
- * @file oprofile_stats.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- */
-
-#ifndef OPROFILE_STATS_H
-#define OPROFILE_STATS_H
-
-#include <linux/atomic.h>
-
-struct oprofile_stat_struct {
-	atomic_t sample_lost_no_mm;
-	atomic_t sample_lost_no_mapping;
-	atomic_t bt_lost_no_mapping;
-	atomic_t event_lost_overflow;
-	atomic_t multiplex_counter;
-};
-
-extern struct oprofile_stat_struct oprofile_stats;
-
-/* reset all stats to zero */
-void oprofile_reset_stats(void);
-
-struct dentry;
-
-/* create the stats/ dir */
-void oprofile_create_stats_files(struct dentry *root);
-
-#endif /* OPROFILE_STATS_H */
drivers/oprofile/oprofilefs.c deleted +0 -300
deleted file mode 100644
index 0875f2f122b3..000000000000
@@ -1,300 +0,0 @@
-/**
- * @file oprofilefs.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- *
- * A simple filesystem for configuration and
- * access of oprofile.
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/oprofile.h>
-#include <linux/fs.h>
-#include <linux/fs_context.h>
-#include <linux/pagemap.h>
-#include <linux/uaccess.h>
-
-#include "oprof.h"
-
-#define OPROFILEFS_MAGIC 0x6f70726f
-
-DEFINE_RAW_SPINLOCK(oprofilefs_lock);
-
-static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode)
-{
-	struct inode *inode = new_inode(sb);
-
-	if (inode) {
-		inode->i_ino = get_next_ino();
-		inode->i_mode = mode;
-		inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
-	}
-	return inode;
-}
-
-
-static const struct super_operations s_ops = {
-	.statfs		= simple_statfs,
-	.drop_inode 	= generic_delete_inode,
-};
-
-
-ssize_t oprofilefs_str_to_user(char const *str, char __user *buf, size_t count, loff_t *offset)
-{
-	return simple_read_from_buffer(buf, count, offset, str, strlen(str));
-}
-
-
-#define TMPBUFSIZE 50
-
-ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user *buf, size_t count, loff_t *offset)
-{
-	char tmpbuf[TMPBUFSIZE];
-	size_t maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", val);
-	if (maxlen > TMPBUFSIZE)
-		maxlen = TMPBUFSIZE;
-	return simple_read_from_buffer(buf, count, offset, tmpbuf, maxlen);
-}
-
-
-/*
- * Note: If oprofilefs_ulong_from_user() returns 0, then *val remains
- * unchanged and might be uninitialized. This follows write syscall
- * implementation when count is zero: "If count is zero ... [and if]
- * no errors are detected, 0 will be returned without causing any
- * other effect." (man 2 write)
- */
-int oprofilefs_ulong_from_user(unsigned long *val, char const __user *buf, size_t count)
-{
-	char tmpbuf[TMPBUFSIZE];
-	unsigned long flags;
-
-	if (!count)
-		return 0;
-
-	if (count > TMPBUFSIZE - 1)
-		return -EINVAL;
-
-	memset(tmpbuf, 0x0, TMPBUFSIZE);
-
-	if (copy_from_user(tmpbuf, buf, count))
-		return -EFAULT;
-
-	raw_spin_lock_irqsave(&oprofilefs_lock, flags);
-	*val = simple_strtoul(tmpbuf, NULL, 0);
-	raw_spin_unlock_irqrestore(&oprofilefs_lock, flags);
-	return count;
-}
-
-
-static ssize_t ulong_read_file(struct file *file, char __user *buf, size_t count, loff_t *offset)
-{
-	unsigned long *val = file->private_data;
-	return oprofilefs_ulong_to_user(*val, buf, count, offset);
-}
-
-
-static ssize_t ulong_write_file(struct file *file, char const __user *buf, size_t count, loff_t *offset)
-{
-	unsigned long value;
-	int retval;
-
-	if (*offset)
-		return -EINVAL;
-
-	retval = oprofilefs_ulong_from_user(&value, buf, count);
-	if (retval <= 0)
-		return retval;
-
-	retval = oprofile_set_ulong(file->private_data, value);
-	if (retval)
-		return retval;
-
-	return count;
-}
-
-
-static const struct file_operations ulong_fops = {
-	.read		= ulong_read_file,
-	.write		= ulong_write_file,
-	.open		= simple_open,
-	.llseek		= default_llseek,
-};
-
-
-static const struct file_operations ulong_ro_fops = {
-	.read		= ulong_read_file,
-	.open		= simple_open,
-	.llseek		= default_llseek,
-};
-
-
-static int __oprofilefs_create_file(struct dentry *root, char const *name,
-	const struct file_operations *fops, int perm, void *priv)
-{
-	struct dentry *dentry;
-	struct inode *inode;
-
-	if (!root)
-		return -ENOMEM;
-
-	inode_lock(d_inode(root));
-	dentry = d_alloc_name(root, name);
-	if (!dentry) {
-		inode_unlock(d_inode(root));
-		return -ENOMEM;
-	}
-	inode = oprofilefs_get_inode(root->d_sb, S_IFREG | perm);
-	if (!inode) {
-		dput(dentry);
-		inode_unlock(d_inode(root));
-		return -ENOMEM;
-	}
-	inode->i_fop = fops;
-	inode->i_private = priv;
-	d_add(dentry, inode);
-	inode_unlock(d_inode(root));
-	return 0;
-}
-
-
-int oprofilefs_create_ulong(struct dentry *root,
-	char const *name, unsigned long *val)
-{
-	return __oprofilefs_create_file(root, name,
-					&ulong_fops, 0644, val);
-}
-
-
-int oprofilefs_create_ro_ulong(struct dentry *root,
-	char const *name, unsigned long *val)
-{
-	return __oprofilefs_create_file(root, name,
-					&ulong_ro_fops, 0444, val);
-}
-
-
-static ssize_t atomic_read_file(struct file *file, char __user *buf, size_t count, loff_t *offset)
-{
-	atomic_t *val = file->private_data;
-	return oprofilefs_ulong_to_user(atomic_read(val), buf, count, offset);
-}
-
-
-static const struct file_operations atomic_ro_fops = {
-	.read		= atomic_read_file,
-	.open		= simple_open,
-	.llseek		= default_llseek,
-};
-
-
-int oprofilefs_create_ro_atomic(struct dentry *root,
-	char const *name, atomic_t *val)
-{
-	return __oprofilefs_create_file(root, name,
-					&atomic_ro_fops, 0444, val);
-}
-
-
-int oprofilefs_create_file(struct dentry *root,
-	char const *name, const struct file_operations *fops)
-{
-	return __oprofilefs_create_file(root, name, fops, 0644, NULL);
-}
-
-
-int oprofilefs_create_file_perm(struct dentry *root,
-	char const *name, const struct file_operations *fops, int perm)
-{
-	return __oprofilefs_create_file(root, name, fops, perm, NULL);
-}
-
-
-struct dentry *oprofilefs_mkdir(struct dentry *parent, char const *name)
-{
-	struct dentry *dentry;
-	struct inode *inode;
-
-	inode_lock(d_inode(parent));
-	dentry = d_alloc_name(parent, name);
-	if (!dentry) {
-		inode_unlock(d_inode(parent));
-		return NULL;
-	}
-	inode = oprofilefs_get_inode(parent->d_sb, S_IFDIR | 0755);
-	if (!inode) {
-		dput(dentry);
-		inode_unlock(d_inode(parent));
-		return NULL;
-	}
-	inode->i_op = &simple_dir_inode_operations;
-	inode->i_fop = &simple_dir_operations;
-	d_add(dentry, inode);
-	inode_unlock(d_inode(parent));
-	return dentry;
-}
-
-
-static int oprofilefs_fill_super(struct super_block *sb, struct fs_context *fc)
-{
-	struct inode *root_inode;
-
-	sb->s_blocksize = PAGE_SIZE;
-	sb->s_blocksize_bits = PAGE_SHIFT;
-	sb->s_magic = OPROFILEFS_MAGIC;
-	sb->s_op = &s_ops;
-	sb->s_time_gran = 1;
-
-	root_inode = oprofilefs_get_inode(sb, S_IFDIR | 0755);
-	if (!root_inode)
-		return -ENOMEM;
-	root_inode->i_op = &simple_dir_inode_operations;
-	root_inode->i_fop = &simple_dir_operations;
-	sb->s_root = d_make_root(root_inode);
-	if (!sb->s_root)
-		return -ENOMEM;
-
-	oprofile_create_files(sb->s_root);
-
-	// FIXME: verify kill_litter_super removes our dentries
-	return 0;
-}
-
-static int oprofilefs_get_tree(struct fs_context *fc)
-{
-	return get_tree_single(fc, oprofilefs_fill_super);
-}
-
-static const struct fs_context_operations oprofilefs_context_ops = {
-	.get_tree	= oprofilefs_get_tree,
-};
-
-static int oprofilefs_init_fs_context(struct fs_context *fc)
-{
-	fc->ops = &oprofilefs_context_ops;
-	return 0;
-}
-
-static struct file_system_type oprofilefs_type = {
-	.owner		= THIS_MODULE,
-	.name		= "oprofilefs",
-	.init_fs_context = oprofilefs_init_fs_context,
-	.kill_sb	= kill_litter_super,
-};
-MODULE_ALIAS_FS("oprofilefs");
-
-
-int __init oprofilefs_register(void)
-{
-	return register_filesystem(&oprofilefs_type);
-}
-
-
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/oprofile/timer_int.c deleted +0 -122
deleted file mode 100644
index 2498a6cd7c24..000000000000

Lines of this file are not shown. View the raw message.

include/linux/oprofile.h deleted +0 -209
deleted file mode 100644
index b2a0f15f11fe..000000000000

Lines of this file are not shown. View the raw message.

init/Kconfig +1 -1
index b77c60f8b963..03eb36256405 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af

Part of the diff is not shown here. View the raw message.

Acked-by on v1 3/18
#4 lore raw

Re: [PATCH 03/18] arch: arc: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar
Quoted 9 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

I presume this doesn't need to go through ARC tree.

-Vineet

Quoted 69 lines
---
  arch/arc/Kconfig           |  1 -
  arch/arc/Makefile          |  2 --
  arch/arc/oprofile/Makefile | 10 ----------
  arch/arc/oprofile/common.c | 23 -----------------------
  4 files changed, 36 deletions(-)

delete mode 100644 arch/arc/oprofile/Makefile
delete mode 100644 arch/arc/oprofile/common.c

arch/arc/Kconfig +0 -1
index b55ca77f619b..bc8d6aecfbbd 100644
@@ -37,7 +37,6 @@ config ARC
  	select HAVE_KPROBES
  	select HAVE_KRETPROBES
  	select HAVE_MOD_ARCH_SPECIFIC
-	select HAVE_OPROFILE
  	select HAVE_PERF_EVENTS
  	select HANDLE_DOMAIN_IRQ
  	select IRQ_DOMAIN
arch/arc/Makefile +0 -2
index 578bdbbb0fa7..4392c9c189c4 100644
@@ -96,8 +96,6 @@ core-$(CONFIG_ARC_PLAT_TB10X)	+= arch/arc/plat-tb10x/
  core-$(CONFIG_ARC_PLAT_AXS10X)	+= arch/arc/plat-axs10x/
  core-$(CONFIG_ARC_SOC_HSDK)	+= arch/arc/plat-hsdk/
 
-drivers-$(CONFIG_OPROFILE)	+= arch/arc/oprofile/
-
  libs-y		+= arch/arc/lib/ $(LIBGCC)
 
  boot		:= arch/arc/boot
arch/arc/oprofile/Makefile deleted +0 -10
deleted file mode 100644
index 698367bb41d0..000000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_OPROFILE) += oprofile.o
-
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-		oprof.o cpu_buffer.o buffer_sync.o \
-		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o \
-		timer_int.o )
-
-oprofile-y	:= $(DRIVER_OBJS) common.o
arch/arc/oprofile/common.c deleted +0 -13
deleted file mode 100644
index 86bf5899533b..000000000000
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
- *
- * Based on orig code from @author John Levon <[email protected]>
- */
-
-#include <linux/oprofile.h>
-#include <linux/perf_event.h>
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-	/*

arch/arc/oprofile/common.c line 23

Quoted 10 lines
arch/arc/oprofile/common.c deleted +0 -10
-	 * A failure here, forces oprofile core to switch to Timer based PC
-	 * sampling, which will happen if say perf is not enabled/available
-	 */
-	return oprofile_perf_init(ops);
-}
-
-void oprofile_arch_exit(void)
-{
-	oprofile_perf_exit();
-}

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

maintainer Acked-by on v1 16/18
#25 lore raw

Re: [PATCH 16/18] arch: xtensa: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar
Quoted 10 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

Quoted 15 lines
---
 arch/xtensa/Kconfig                         |  1 -
 arch/xtensa/Makefile                        |  1 -
 arch/xtensa/configs/audio_kc705_defconfig   |  1 -
 arch/xtensa/configs/generic_kc705_defconfig |  1 -
 arch/xtensa/configs/smp_lx200_defconfig     |  1 -
 arch/xtensa/configs/xip_kc705_defconfig     |  1 -
 arch/xtensa/kernel/stacktrace.c             |  2 +-
 arch/xtensa/oprofile/Makefile               | 10 --------
 arch/xtensa/oprofile/backtrace.c            | 27 ---------------------
 arch/xtensa/oprofile/init.c                 | 26 --------------------
 10 files changed, 1 insertion(+), 70 deletions(-)
 delete mode 100644 arch/xtensa/oprofile/Makefile
 delete mode 100644 arch/xtensa/oprofile/backtrace.c
 delete mode 100644 arch/xtensa/oprofile/init.c

Although I still keep userspace oprofile tools that use this interface, I haven't run them for ages.

Signature · 2 lines
Thanks.
-- Max
Acked-by on the v1 series
#30 lore raw
In reply to Viresh Kumar
Quoted 31 lines · Viresh Kumar

Hello,

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove oprofile and dcookies (whose only user is oprofile) support from the kernel.

This was suggested here [1] earlier.

This is build/boot tested by kernel test robot (Intel) and Linaro's Tuxmake[2] for a lot of architectures and no failures were reported.

--
Viresh

[1] https://lore.kernel.org/lkml/CAHk-=whw9t3ZtV8iA2SJWYQS1VOJuS14P_qhj3v5-9PCBmGQww@mail.gmail.com/
[2] https://lwn.net/Articles/841624/

Viresh Kumar (18):
arch: alpha: Remove CONFIG_OPROFILE support
arch: arm: Remove CONFIG_OPROFILE support
arch: arc: Remove CONFIG_OPROFILE support
arch: hexagon: Don't select HAVE_OPROFILE
arch: ia64: Remove CONFIG_OPROFILE support
arch: ia64: Remove rest of perfmon support
arch: microblaze: Remove CONFIG_OPROFILE support
arch: mips: Remove CONFIG_OPROFILE support
arch: parisc: Remove CONFIG_OPROFILE support
arch: powerpc: Stop building and using oprofile

Quoted 8 lines

arch: powerpc: Remove oprofile
arch: s390: Remove CONFIG_OPROFILE support
arch: sh: Remove CONFIG_OPROFILE support
arch: sparc: Remove CONFIG_OPROFILE support
arch: x86: Remove CONFIG_OPROFILE support
arch: xtensa: Remove CONFIG_OPROFILE support
drivers: Remove CONFIG_OPROFILE support
fs: Remove dcookies support

After oprofile userland moved to version 1.x, the kernel support for it isn't needed anymore. The switch was back in 2014 when oprofile started using the perf syscall:

https://sourceforge.net/p/oprofile/oprofile/ci/ba9edea2bdfe2c9475749fc83105632bd916b96c

Since then I haven't received any significant patches to implement new features or add support for newer platforms in the kernel. There haven't been bug reports sent or questions asked on the mailing list for quite a while, which indicates there are no or less users. Users (if any) should switch to oprofile 1.x or the perf tool. No need to carry kernel support any longer with us.

So time to get rid of it. For the whole series:

#5 lore raw

Re: [PATCH 03/18] arch: arc: Remove CONFIG_OPROFILE support

In reply to Vineet Gupta
Quoted 7 lines · Vineet Gupta
Quoted 6 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

Quoted 7 lines
Quoted 3 lines

I presume this doesn't need to go through ARC tree.

Yes.

Signature · 6 lines
viresh

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#15 lore raw

Re: [PATCH 10/18] arch: powerpc: Stop building and using oprofile

In reply to Viresh Kumar
Quoted 10 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

This commits stops building oprofile for powerpc and removes any reference to it from directories in arch/powerpc/ apart from arch/powerpc/oprofile, which will be removed in the next commit (this is broken into two commits as the size of the commit became very big, ~5k lines).

Quoted 6 lines

Note that the member "oprofile_cpu_type" in "struct cpu_spec" isn't removed as it was also used by other parts of the code.

+ this to fix a warning:

arch/powerpc/platforms/cell/spufs/run.c +0 -2
index 466006918003..ce52b87496d2 100644
@@ -353,7 +353,6 @@ static int spu_process_callback(struct spu_context *ctx)
 long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
 {
        int ret;
-       struct spu *spu;
        u32 status;
 
        if (mutex_lock_interruptible(&ctx->run_mutex))
@@ -386,7 +385,6 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
                        mutex_lock(&ctx->state_mutex);
                        break;
                }
-               spu = ctx->spu;
                if (unlikely(test_and_clear_bit(SPU_SCHED_NOTIFY_ACTIVE,
                                                &ctx->sched_flags))) {
                        if (!(status & SPU_STATUS_STOPPED_BY_STOP))
Signature · 1 line
viresh
#0 lore raw

cover drivers: Remove oprofile and dcookies

Hello,

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove oprofile and dcookies (whose only user is oprofile) support from the kernel.

This was suggested here [1] earlier.

This is build/boot tested by kernel test robot (Intel) and Linaro's Tuxmake[2] for a lot of architectures and no failures were reported.

--
Viresh

[1] https://lore.kernel.org/lkml/CAHk-=whw9t3ZtV8iA2SJWYQS1VOJuS14P_qhj3v5-9PCBmGQww@mail.gmail.com/
[2] https://lwn.net/Articles/841624/

Viresh Kumar (18):
arch: alpha: Remove CONFIG_OPROFILE support
arch: arm: Remove CONFIG_OPROFILE support
arch: arc: Remove CONFIG_OPROFILE support
arch: hexagon: Don't select HAVE_OPROFILE
arch: ia64: Remove CONFIG_OPROFILE support
arch: ia64: Remove rest of perfmon support
arch: microblaze: Remove CONFIG_OPROFILE support
arch: mips: Remove CONFIG_OPROFILE support
arch: parisc: Remove CONFIG_OPROFILE support
arch: powerpc: Stop building and using oprofile
arch: powerpc: Remove oprofile
arch: s390: Remove CONFIG_OPROFILE support
arch: sh: Remove CONFIG_OPROFILE support
arch: sparc: Remove CONFIG_OPROFILE support
arch: x86: Remove CONFIG_OPROFILE support
arch: xtensa: Remove CONFIG_OPROFILE support
drivers: Remove CONFIG_OPROFILE support
fs: Remove dcookies support

 Documentation/RCU/NMI-RCU.rst                 |    3 +-
 .../admin-guide/kernel-parameters.txt         |   14 -
 Documentation/kbuild/makefiles.rst            |    1 -
 Documentation/process/magic-number.rst        |    1 -
 .../it_IT/process/magic-number.rst            |    1 -
 .../zh_CN/process/magic-number.rst            |    1 -
 MAINTAINERS                                   |   11 -
 arch/Kconfig                                  |   32 -
 arch/alpha/Kconfig                            |    1 -
 arch/alpha/Makefile                           |    1 -
 arch/alpha/oprofile/Makefile                  |   20 -
 arch/alpha/oprofile/common.c                  |  189 --
 arch/alpha/oprofile/op_impl.h                 |   55 -
 arch/alpha/oprofile/op_model_ev4.c            |  114 --
 arch/alpha/oprofile/op_model_ev5.c            |  209 --
 arch/alpha/oprofile/op_model_ev6.c            |  101 -
 arch/alpha/oprofile/op_model_ev67.c           |  261 ---
 arch/arc/Kconfig                              |    1 -
 arch/arc/Makefile                             |    2 -
 arch/arc/oprofile/Makefile                    |   10 -
 arch/arc/oprofile/common.c                    |   23 -
 arch/arm/Kconfig                              |    1 -
 arch/arm/Makefile                             |    2 -
 arch/arm/configs/bcm2835_defconfig            |    1 -
 arch/arm/configs/cns3420vb_defconfig          |    1 -
 arch/arm/configs/corgi_defconfig              |    1 -
 arch/arm/configs/imx_v4_v5_defconfig          |    1 -
 arch/arm/configs/keystone_defconfig           |    1 -
 arch/arm/configs/multi_v5_defconfig           |    1 -
 arch/arm/configs/mv78xx0_defconfig            |    1 -
 arch/arm/configs/mvebu_v5_defconfig           |    1 -
 arch/arm/configs/omap1_defconfig              |    1 -
 arch/arm/configs/omap2plus_defconfig          |    1 -
 arch/arm/configs/orion5x_defconfig            |    1 -
 arch/arm/configs/pxa_defconfig                |    1 -
 arch/arm/configs/qcom_defconfig               |    1 -
 arch/arm/configs/socfpga_defconfig            |    1 -
 arch/arm/configs/spitz_defconfig              |    1 -
 arch/arm/configs/vexpress_defconfig           |    1 -
 arch/arm/oprofile/Makefile                    |   14 -
 arch/arm/oprofile/common.c                    |  132 --
 arch/hexagon/Kconfig                          |    1 -
 arch/ia64/Kconfig                             |    1 -
 arch/ia64/Makefile                            |    1 -
 arch/ia64/configs/bigsur_defconfig            |    1 -
 arch/ia64/include/asm/hw_irq.h                |    1 -
 arch/ia64/include/asm/perfmon.h               |  111 --
 arch/ia64/include/uapi/asm/perfmon.h          |  178 --
 .../include/uapi/asm/perfmon_default_smpl.h   |   84 -
 arch/ia64/kernel/palinfo.c                    |   41 -
 arch/ia64/kernel/perfmon_default_smpl.c       |  297 ---
 arch/ia64/kernel/perfmon_generic.h            |   46 -
 arch/ia64/kernel/perfmon_itanium.h            |    2 +-
 arch/ia64/kernel/perfmon_mckinley.h           |  188 --
 arch/ia64/kernel/perfmon_montecito.h          |  270 ---
 arch/ia64/oprofile/Makefile                   |   10 -
 arch/ia64/oprofile/backtrace.c                |  131 --
 arch/ia64/oprofile/init.c                     |   28 -
 arch/microblaze/Kconfig                       |    1 -
 arch/microblaze/Makefile                      |    2 -
 arch/microblaze/oprofile/Makefile             |   14 -
 .../microblaze/oprofile/microblaze_oprofile.c |   22 -
 arch/mips/Kconfig                             |    3 +-
 arch/mips/Makefile                            |    1 -
 arch/mips/configs/fuloong2e_defconfig         |    1 -
 arch/mips/configs/ip32_defconfig              |    1 -
 arch/mips/configs/lemote2f_defconfig          |    1 -
 arch/mips/configs/mtx1_defconfig              |    1 -
 arch/mips/configs/rs90_defconfig              |    1 -
 .../include/asm/mach-loongson2ef/loongson.h   |    9 -
 arch/mips/loongson2ef/fuloong-2e/irq.c        |    2 +-
 arch/mips/loongson2ef/lemote-2f/irq.c         |    1 -
 arch/mips/oprofile/Makefile                   |   18 -
 arch/mips/oprofile/backtrace.c                |  177 --
 arch/mips/oprofile/common.c                   |  147 --
 arch/mips/oprofile/op_impl.h                  |   41 -
 arch/mips/oprofile/op_model_loongson2.c       |  161 --
 arch/mips/oprofile/op_model_loongson3.c       |  213 --
 arch/mips/oprofile/op_model_mipsxx.c          |  479 -----
 arch/parisc/Kconfig                           |    1 -
 arch/parisc/Makefile                          |    2 -
 arch/parisc/oprofile/Makefile                 |   10 -
 arch/parisc/oprofile/init.c                   |   23 -
 arch/powerpc/Kconfig                          |    1 -
 arch/powerpc/Makefile                         |    2 -
 arch/powerpc/configs/44x/akebono_defconfig    |    1 -
 arch/powerpc/configs/44x/currituck_defconfig  |    1 -
 arch/powerpc/configs/44x/fsp2_defconfig       |    1 -
 arch/powerpc/configs/44x/iss476-smp_defconfig |    1 -
 arch/powerpc/configs/cell_defconfig           |    1 -
 arch/powerpc/configs/g5_defconfig             |    1 -
 arch/powerpc/configs/maple_defconfig          |    1 -
 arch/powerpc/configs/pasemi_defconfig         |    1 -
 arch/powerpc/configs/pmac32_defconfig         |    1 -
 arch/powerpc/configs/powernv_defconfig        |    1 -
 arch/powerpc/configs/ppc64_defconfig          |    1 -
 arch/powerpc/configs/ppc64e_defconfig         |    1 -
 arch/powerpc/configs/ppc6xx_defconfig         |    1 -
 arch/powerpc/configs/ps3_defconfig            |    1 -
 arch/powerpc/configs/pseries_defconfig        |    1 -
 arch/powerpc/include/asm/cputable.h           |   20 -
 arch/powerpc/include/asm/oprofile_impl.h      |  135 --
 arch/powerpc/include/asm/spu.h                |   33 -
 arch/powerpc/kernel/cputable.c                |   67 -
 arch/powerpc/kernel/dt_cpu_ftrs.c             |    2 -
 arch/powerpc/oprofile/Makefile                |   19 -
 arch/powerpc/oprofile/backtrace.c             |  120 --
 arch/powerpc/oprofile/cell/pr_util.h          |  110 --
 arch/powerpc/oprofile/cell/spu_profiler.c     |  248 ---
 arch/powerpc/oprofile/cell/spu_task_sync.c    |  657 -------
 arch/powerpc/oprofile/cell/vma_map.c          |  279 ---
 arch/powerpc/oprofile/common.c                |  243 ---
 arch/powerpc/oprofile/op_model_7450.c         |  207 --
 arch/powerpc/oprofile/op_model_cell.c         | 1709 -----------------
 arch/powerpc/oprofile/op_model_fsl_emb.c      |  380 ----
 arch/powerpc/oprofile/op_model_pa6t.c         |  227 ---
 arch/powerpc/oprofile/op_model_power4.c       |  438 -----
 arch/powerpc/platforms/cell/Kconfig           |    5 -
 arch/powerpc/platforms/cell/spu_notify.c      |   55 -
 arch/powerpc/platforms/cell/spufs/run.c       |    4 +-
 arch/powerpc/platforms/cell/spufs/sched.c     |    5 -
 arch/powerpc/platforms/cell/spufs/spufs.h     |    1 -
 arch/s390/Kconfig                             |    1 -
 arch/s390/Makefile                            |    3 -
 arch/s390/configs/debug_defconfig             |    1 -
 arch/s390/configs/defconfig                   |    1 -
 arch/s390/oprofile/Makefile                   |   10 -
 arch/s390/oprofile/init.c                     |   37 -
 arch/sh/Kconfig                               |    1 -
 arch/sh/Makefile                              |    1 -
 arch/sh/configs/espt_defconfig                |    1 -
 arch/sh/configs/migor_defconfig               |    1 -
 arch/sh/configs/r7780mp_defconfig             |    1 -
 arch/sh/configs/r7785rp_defconfig             |    1 -
 arch/sh/configs/rsk7201_defconfig             |    1 -
 arch/sh/configs/rsk7203_defconfig             |    1 -
 arch/sh/configs/rts7751r2d1_defconfig         |    1 -
 arch/sh/configs/rts7751r2dplus_defconfig      |    1 -
 arch/sh/configs/sdk7786_defconfig             |    1 -
 arch/sh/configs/se7206_defconfig              |    1 -
 arch/sh/configs/sh03_defconfig                |    1 -
 arch/sh/configs/sh7724_generic_defconfig      |    1 -
 arch/sh/configs/sh7763rdp_defconfig           |    1 -
 arch/sh/configs/sh7770_generic_defconfig      |    1 -
 arch/sh/configs/shx3_defconfig                |    1 -
 arch/sh/oprofile/Makefile                     |   16 -
 arch/sh/oprofile/backtrace.c                  |   80 -
 arch/sh/oprofile/common.c                     |   64 -
 arch/sparc/Kconfig                            |    1 -
 arch/sparc/Makefile                           |    1 -
 arch/sparc/configs/sparc64_defconfig          |    1 -
 arch/sparc/oprofile/Makefile                  |   10 -
 arch/sparc/oprofile/init.c                    |   87 -
 arch/x86/Kconfig                              |    1 -
 arch/x86/Makefile                             |    3 -
 arch/x86/include/asm/nmi.h                    |    1 -
 arch/x86/kernel/cpu/perfctr-watchdog.c        |   11 +-
 arch/x86/oprofile/Makefile                    |   12 -
 arch/x86/oprofile/backtrace.c                 |  127 --
 arch/x86/oprofile/init.c                      |   38 -
 arch/x86/oprofile/nmi_int.c                   |  780 --------
 arch/x86/oprofile/op_counter.h                |   30 -
 arch/x86/oprofile/op_model_amd.c              |  542 ------
 arch/x86/oprofile/op_model_p4.c               |  723 -------
 arch/x86/oprofile/op_model_ppro.c             |  245 ---
 arch/x86/oprofile/op_x86_model.h              |   90 -
 arch/xtensa/Kconfig                           |    1 -
 arch/xtensa/Makefile                          |    1 -
 arch/xtensa/configs/audio_kc705_defconfig     |    1 -
 arch/xtensa/configs/generic_kc705_defconfig   |    1 -
 arch/xtensa/configs/smp_lx200_defconfig       |    1 -
 arch/xtensa/configs/xip_kc705_defconfig       |    1 -
 arch/xtensa/kernel/stacktrace.c               |    2 +-
 arch/xtensa/oprofile/Makefile                 |   10 -
 arch/xtensa/oprofile/backtrace.c              |   27 -
 arch/xtensa/oprofile/init.c                   |   26 -
 drivers/oprofile/buffer_sync.c                |  591 ------
 drivers/oprofile/buffer_sync.h                |   22 -
 drivers/oprofile/cpu_buffer.c                 |  465 -----
 drivers/oprofile/cpu_buffer.h                 |  121 --
 drivers/oprofile/event_buffer.c               |  209 --
 drivers/oprofile/event_buffer.h               |   40 -
 drivers/oprofile/nmi_timer_int.c              |  157 --
 drivers/oprofile/oprof.c                      |  286 ---
 drivers/oprofile/oprof.h                      |   50 -
 drivers/oprofile/oprofile_files.c             |  201 --
 drivers/oprofile/oprofile_perf.c              |  328 ----
 drivers/oprofile/oprofile_stats.c             |   84 -
 drivers/oprofile/oprofile_stats.h             |   33 -
 drivers/oprofile/oprofilefs.c                 |  300 ---
 drivers/oprofile/timer_int.c                  |  122 --
 fs/Makefile                                   |    1 -
 fs/dcookies.c                                 |  356 ----
 include/linux/dcookies.h                      |   69 -
 include/linux/oprofile.h                      |  209 --
 init/Kconfig                                  |    2 +-
 kernel/sys.c                                  |    1 -
 usr/include/Makefile                          |    2 -
 198 files changed, 8 insertions(+), 15566 deletions(-)
 delete mode 100644 arch/alpha/oprofile/Makefile
 delete mode 100644 arch/alpha/oprofile/common.c
 delete mode 100644 arch/alpha/oprofile/op_impl.h
 delete mode 100644 arch/alpha/oprofile/op_model_ev4.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev5.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev6.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev67.c
 delete mode 100644 arch/arc/oprofile/Makefile
 delete mode 100644 arch/arc/oprofile/common.c
 delete mode 100644 arch/arm/oprofile/Makefile
 delete mode 100644 arch/arm/oprofile/common.c
 delete mode 100644 arch/ia64/include/asm/perfmon.h
 delete mode 100644 arch/ia64/include/uapi/asm/perfmon.h
 delete mode 100644 arch/ia64/include/uapi/asm/perfmon_default_smpl.h
 delete mode 100644 arch/ia64/kernel/perfmon_default_smpl.c
 delete mode 100644 arch/ia64/kernel/perfmon_generic.h
 delete mode 100644 arch/ia64/kernel/perfmon_mckinley.h
 delete mode 100644 arch/ia64/kernel/perfmon_montecito.h
 delete mode 100644 arch/ia64/oprofile/Makefile
 delete mode 100644 arch/ia64/oprofile/backtrace.c
 delete mode 100644 arch/ia64/oprofile/init.c
 delete mode 100644 arch/microblaze/oprofile/Makefile
 delete mode 100644 arch/microblaze/oprofile/microblaze_oprofile.c
 delete mode 100644 arch/mips/oprofile/Makefile
 delete mode 100644 arch/mips/oprofile/backtrace.c
 delete mode 100644 arch/mips/oprofile/common.c
 delete mode 100644 arch/mips/oprofile/op_impl.h
 delete mode 100644 arch/mips/oprofile/op_model_loongson2.c
 delete mode 100644 arch/mips/oprofile/op_model_loongson3.c
 delete mode 100644 arch/mips/oprofile/op_model_mipsxx.c
 delete mode 100644 arch/parisc/oprofile/Makefile
 delete mode 100644 arch/parisc/oprofile/init.c
 delete mode 100644 arch/powerpc/include/asm/oprofile_impl.h
 delete mode 100644 arch/powerpc/oprofile/Makefile
 delete mode 100644 arch/powerpc/oprofile/backtrace.c
 delete mode 100644 arch/powerpc/oprofile/cell/pr_util.h
 delete mode 100644 arch/powerpc/oprofile/cell/spu_profiler.c
 delete mode 100644 arch/powerpc/oprofile/cell/spu_task_sync.c
 delete mode 100644 arch/powerpc/oprofile/cell/vma_map.c
 delete mode 100644 arch/powerpc/oprofile/common.c
 delete mode 100644 arch/powerpc/oprofile/op_model_7450.c
 delete mode 100644 arch/powerpc/oprofile/op_model_cell.c
 delete mode 100644 arch/powerpc/oprofile/op_model_fsl_emb.c
 delete mode 100644 arch/powerpc/oprofile/op_model_pa6t.c
 delete mode 100644 arch/powerpc/oprofile/op_model_power4.c
 delete mode 100644 arch/powerpc/platforms/cell/spu_notify.c
 delete mode 100644 arch/s390/oprofile/Makefile
 delete mode 100644 arch/s390/oprofile/init.c
 delete mode 100644 arch/sh/oprofile/Makefile
 delete mode 100644 arch/sh/oprofile/backtrace.c
 delete mode 100644 arch/sh/oprofile/common.c
 delete mode 100644 arch/sparc/oprofile/Makefile
 delete mode 100644 arch/sparc/oprofile/init.c
 delete mode 100644 arch/x86/oprofile/Makefile
 delete mode 100644 arch/x86/oprofile/backtrace.c
 delete mode 100644 arch/x86/oprofile/init.c
 delete mode 100644 arch/x86/oprofile/nmi_int.c
 delete mode 100644 arch/x86/oprofile/op_counter.h
 delete mode 100644 arch/x86/oprofile/op_model_amd.c
 delete mode 100644 arch/x86/oprofile/op_model_p4.c
 delete mode 100644 arch/x86/oprofile/op_model_ppro.c
 delete mode 100644 arch/x86/oprofile/op_x86_model.h
 delete mode 100644 arch/xtensa/oprofile/Makefile
 delete mode 100644 arch/xtensa/oprofile/backtrace.c
 delete mode 100644 arch/xtensa/oprofile/init.c
 delete mode 100644 drivers/oprofile/buffer_sync.c
 delete mode 100644 drivers/oprofile/buffer_sync.h
 delete mode 100644 drivers/oprofile/cpu_buffer.c
 delete mode 100644 drivers/oprofile/cpu_buffer.h
 delete mode 100644 drivers/oprofile/event_buffer.c
 delete mode 100644 drivers/oprofile/event_buffer.h
 delete mode 100644 drivers/oprofile/nmi_timer_int.c
 delete mode 100644 drivers/oprofile/oprof.c
 delete mode 100644 drivers/oprofile/oprof.h
 delete mode 100644 drivers/oprofile/oprofile_files.c
 delete mode 100644 drivers/oprofile/oprofile_perf.c
 delete mode 100644 drivers/oprofile/oprofile_stats.c
 delete mode 100644 drivers/oprofile/oprofile_stats.h
 delete mode 100644 drivers/oprofile/oprofilefs.c
 delete mode 100644 drivers/oprofile/timer_int.c
 delete mode 100644 fs/dcookies.c
 delete mode 100644 include/linux/dcookies.h
 delete mode 100644 include/linux/oprofile.h

base-commit: 7c53f6b671f4aba70ff15e1b05148b10d58c2837

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
#32 lore raw

+LKML (Not sure why the cover-letter didn't go to LKML but everything else).

Quoted 328 lines · Viresh Kumar

Hello,

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove oprofile and dcookies (whose only user is oprofile) support from the kernel.

This was suggested here [1] earlier.

This is build/boot tested by kernel test robot (Intel) and Linaro's Tuxmake[2] for a lot of architectures and no failures were reported.

--
Viresh

[1] https://lore.kernel.org/lkml/CAHk-=whw9t3ZtV8iA2SJWYQS1VOJuS14P_qhj3v5-9PCBmGQww@mail.gmail.com/
[2] https://lwn.net/Articles/841624/

Viresh Kumar (18):
arch: alpha: Remove CONFIG_OPROFILE support
arch: arm: Remove CONFIG_OPROFILE support
arch: arc: Remove CONFIG_OPROFILE support
arch: hexagon: Don't select HAVE_OPROFILE
arch: ia64: Remove CONFIG_OPROFILE support
arch: ia64: Remove rest of perfmon support
arch: microblaze: Remove CONFIG_OPROFILE support
arch: mips: Remove CONFIG_OPROFILE support
arch: parisc: Remove CONFIG_OPROFILE support
arch: powerpc: Stop building and using oprofile
arch: powerpc: Remove oprofile
arch: s390: Remove CONFIG_OPROFILE support
arch: sh: Remove CONFIG_OPROFILE support
arch: sparc: Remove CONFIG_OPROFILE support
arch: x86: Remove CONFIG_OPROFILE support
arch: xtensa: Remove CONFIG_OPROFILE support
drivers: Remove CONFIG_OPROFILE support
fs: Remove dcookies support

 Documentation/RCU/NMI-RCU.rst                 |    3 +-
 .../admin-guide/kernel-parameters.txt         |   14 -
 Documentation/kbuild/makefiles.rst            |    1 -
 Documentation/process/magic-number.rst        |    1 -
 .../it_IT/process/magic-number.rst            |    1 -
 .../zh_CN/process/magic-number.rst            |    1 -
 MAINTAINERS                                   |   11 -
 arch/Kconfig                                  |   32 -
 arch/alpha/Kconfig                            |    1 -
 arch/alpha/Makefile                           |    1 -
 arch/alpha/oprofile/Makefile                  |   20 -
 arch/alpha/oprofile/common.c                  |  189 --
 arch/alpha/oprofile/op_impl.h                 |   55 -
 arch/alpha/oprofile/op_model_ev4.c            |  114 --
 arch/alpha/oprofile/op_model_ev5.c            |  209 --
 arch/alpha/oprofile/op_model_ev6.c            |  101 -
 arch/alpha/oprofile/op_model_ev67.c           |  261 ---
 arch/arc/Kconfig                              |    1 -
 arch/arc/Makefile                             |    2 -
 arch/arc/oprofile/Makefile                    |   10 -
 arch/arc/oprofile/common.c                    |   23 -
 arch/arm/Kconfig                              |    1 -
 arch/arm/Makefile                             |    2 -
 arch/arm/configs/bcm2835_defconfig            |    1 -
 arch/arm/configs/cns3420vb_defconfig          |    1 -
 arch/arm/configs/corgi_defconfig              |    1 -
 arch/arm/configs/imx_v4_v5_defconfig          |    1 -
 arch/arm/configs/keystone_defconfig           |    1 -
 arch/arm/configs/multi_v5_defconfig           |    1 -
 arch/arm/configs/mv78xx0_defconfig            |    1 -
 arch/arm/configs/mvebu_v5_defconfig           |    1 -
 arch/arm/configs/omap1_defconfig              |    1 -
 arch/arm/configs/omap2plus_defconfig          |    1 -
 arch/arm/configs/orion5x_defconfig            |    1 -
 arch/arm/configs/pxa_defconfig                |    1 -
 arch/arm/configs/qcom_defconfig               |    1 -
 arch/arm/configs/socfpga_defconfig            |    1 -
 arch/arm/configs/spitz_defconfig              |    1 -
 arch/arm/configs/vexpress_defconfig           |    1 -
 arch/arm/oprofile/Makefile                    |   14 -
 arch/arm/oprofile/common.c                    |  132 --
 arch/hexagon/Kconfig                          |    1 -
 arch/ia64/Kconfig                             |    1 -
 arch/ia64/Makefile                            |    1 -
 arch/ia64/configs/bigsur_defconfig            |    1 -
 arch/ia64/include/asm/hw_irq.h                |    1 -
 arch/ia64/include/asm/perfmon.h               |  111 --
 arch/ia64/include/uapi/asm/perfmon.h          |  178 --
 .../include/uapi/asm/perfmon_default_smpl.h   |   84 -
 arch/ia64/kernel/palinfo.c                    |   41 -
 arch/ia64/kernel/perfmon_default_smpl.c       |  297 ---
 arch/ia64/kernel/perfmon_generic.h            |   46 -
 arch/ia64/kernel/perfmon_itanium.h            |    2 +-
 arch/ia64/kernel/perfmon_mckinley.h           |  188 --
 arch/ia64/kernel/perfmon_montecito.h          |  270 ---
 arch/ia64/oprofile/Makefile                   |   10 -
 arch/ia64/oprofile/backtrace.c                |  131 --
 arch/ia64/oprofile/init.c                     |   28 -
 arch/microblaze/Kconfig                       |    1 -
 arch/microblaze/Makefile                      |    2 -
 arch/microblaze/oprofile/Makefile             |   14 -
 .../microblaze/oprofile/microblaze_oprofile.c |   22 -
 arch/mips/Kconfig                             |    3 +-
 arch/mips/Makefile                            |    1 -
 arch/mips/configs/fuloong2e_defconfig         |    1 -
 arch/mips/configs/ip32_defconfig              |    1 -
 arch/mips/configs/lemote2f_defconfig          |    1 -
 arch/mips/configs/mtx1_defconfig              |    1 -
 arch/mips/configs/rs90_defconfig              |    1 -
 .../include/asm/mach-loongson2ef/loongson.h   |    9 -
 arch/mips/loongson2ef/fuloong-2e/irq.c        |    2 +-
 arch/mips/loongson2ef/lemote-2f/irq.c         |    1 -
 arch/mips/oprofile/Makefile                   |   18 -
 arch/mips/oprofile/backtrace.c                |  177 --
 arch/mips/oprofile/common.c                   |  147 --
 arch/mips/oprofile/op_impl.h                  |   41 -
 arch/mips/oprofile/op_model_loongson2.c       |  161 --
 arch/mips/oprofile/op_model_loongson3.c       |  213 --
 arch/mips/oprofile/op_model_mipsxx.c          |  479 -----
 arch/parisc/Kconfig                           |    1 -
 arch/parisc/Makefile                          |    2 -
 arch/parisc/oprofile/Makefile                 |   10 -
 arch/parisc/oprofile/init.c                   |   23 -
 arch/powerpc/Kconfig                          |    1 -
 arch/powerpc/Makefile                         |    2 -
 arch/powerpc/configs/44x/akebono_defconfig    |    1 -
 arch/powerpc/configs/44x/currituck_defconfig  |    1 -
 arch/powerpc/configs/44x/fsp2_defconfig       |    1 -
 arch/powerpc/configs/44x/iss476-smp_defconfig |    1 -
 arch/powerpc/configs/cell_defconfig           |    1 -
 arch/powerpc/configs/g5_defconfig             |    1 -
 arch/powerpc/configs/maple_defconfig          |    1 -
 arch/powerpc/configs/pasemi_defconfig         |    1 -
 arch/powerpc/configs/pmac32_defconfig         |    1 -
 arch/powerpc/configs/powernv_defconfig        |    1 -
 arch/powerpc/configs/ppc64_defconfig          |    1 -
 arch/powerpc/configs/ppc64e_defconfig         |    1 -
 arch/powerpc/configs/ppc6xx_defconfig         |    1 -
 arch/powerpc/configs/ps3_defconfig            |    1 -
 arch/powerpc/configs/pseries_defconfig        |    1 -
 arch/powerpc/include/asm/cputable.h           |   20 -
 arch/powerpc/include/asm/oprofile_impl.h      |  135 --
 arch/powerpc/include/asm/spu.h                |   33 -
 arch/powerpc/kernel/cputable.c                |   67 -
 arch/powerpc/kernel/dt_cpu_ftrs.c             |    2 -
 arch/powerpc/oprofile/Makefile                |   19 -
 arch/powerpc/oprofile/backtrace.c             |  120 --
 arch/powerpc/oprofile/cell/pr_util.h          |  110 --
 arch/powerpc/oprofile/cell/spu_profiler.c     |  248 ---
 arch/powerpc/oprofile/cell/spu_task_sync.c    |  657 -------
 arch/powerpc/oprofile/cell/vma_map.c          |  279 ---
 arch/powerpc/oprofile/common.c                |  243 ---
 arch/powerpc/oprofile/op_model_7450.c         |  207 --
 arch/powerpc/oprofile/op_model_cell.c         | 1709 -----------------
 arch/powerpc/oprofile/op_model_fsl_emb.c      |  380 ----
 arch/powerpc/oprofile/op_model_pa6t.c         |  227 ---
 arch/powerpc/oprofile/op_model_power4.c       |  438 -----
 arch/powerpc/platforms/cell/Kconfig           |    5 -
 arch/powerpc/platforms/cell/spu_notify.c      |   55 -
 arch/powerpc/platforms/cell/spufs/run.c       |    4 +-
 arch/powerpc/platforms/cell/spufs/sched.c     |    5 -
 arch/powerpc/platforms/cell/spufs/spufs.h     |    1 -
 arch/s390/Kconfig                             |    1 -
 arch/s390/Makefile                            |    3 -
 arch/s390/configs/debug_defconfig             |    1 -
 arch/s390/configs/defconfig                   |    1 -
 arch/s390/oprofile/Makefile                   |   10 -
 arch/s390/oprofile/init.c                     |   37 -
 arch/sh/Kconfig                               |    1 -
 arch/sh/Makefile                              |    1 -
 arch/sh/configs/espt_defconfig                |    1 -
 arch/sh/configs/migor_defconfig               |    1 -
 arch/sh/configs/r7780mp_defconfig             |    1 -
 arch/sh/configs/r7785rp_defconfig             |    1 -
 arch/sh/configs/rsk7201_defconfig             |    1 -
 arch/sh/configs/rsk7203_defconfig             |    1 -
 arch/sh/configs/rts7751r2d1_defconfig         |    1 -
 arch/sh/configs/rts7751r2dplus_defconfig      |    1 -
 arch/sh/configs/sdk7786_defconfig             |    1 -
 arch/sh/configs/se7206_defconfig              |    1 -
 arch/sh/configs/sh03_defconfig                |    1 -
 arch/sh/configs/sh7724_generic_defconfig      |    1 -
 arch/sh/configs/sh7763rdp_defconfig           |    1 -
 arch/sh/configs/sh7770_generic_defconfig      |    1 -
 arch/sh/configs/shx3_defconfig                |    1 -
 arch/sh/oprofile/Makefile                     |   16 -
 arch/sh/oprofile/backtrace.c                  |   80 -
 arch/sh/oprofile/common.c                     |   64 -
 arch/sparc/Kconfig                            |    1 -
 arch/sparc/Makefile                           |    1 -
 arch/sparc/configs/sparc64_defconfig          |    1 -
 arch/sparc/oprofile/Makefile                  |   10 -
 arch/sparc/oprofile/init.c                    |   87 -
 arch/x86/Kconfig                              |    1 -
 arch/x86/Makefile                             |    3 -
 arch/x86/include/asm/nmi.h                    |    1 -
 arch/x86/kernel/cpu/perfctr-watchdog.c        |   11 +-
 arch/x86/oprofile/Makefile                    |   12 -
 arch/x86/oprofile/backtrace.c                 |  127 --
 arch/x86/oprofile/init.c                      |   38 -
 arch/x86/oprofile/nmi_int.c                   |  780 --------
 arch/x86/oprofile/op_counter.h                |   30 -
 arch/x86/oprofile/op_model_amd.c              |  542 ------
 arch/x86/oprofile/op_model_p4.c               |  723 -------
 arch/x86/oprofile/op_model_ppro.c             |  245 ---
 arch/x86/oprofile/op_x86_model.h              |   90 -
 arch/xtensa/Kconfig                           |    1 -
 arch/xtensa/Makefile                          |    1 -
 arch/xtensa/configs/audio_kc705_defconfig     |    1 -
 arch/xtensa/configs/generic_kc705_defconfig   |    1 -
 arch/xtensa/configs/smp_lx200_defconfig       |    1 -
 arch/xtensa/configs/xip_kc705_defconfig       |    1 -
 arch/xtensa/kernel/stacktrace.c               |    2 +-
 arch/xtensa/oprofile/Makefile                 |   10 -
 arch/xtensa/oprofile/backtrace.c              |   27 -
 arch/xtensa/oprofile/init.c                   |   26 -
 drivers/oprofile/buffer_sync.c                |  591 ------
 drivers/oprofile/buffer_sync.h                |   22 -
 drivers/oprofile/cpu_buffer.c                 |  465 -----
 drivers/oprofile/cpu_buffer.h                 |  121 --
 drivers/oprofile/event_buffer.c               |  209 --
 drivers/oprofile/event_buffer.h               |   40 -
 drivers/oprofile/nmi_timer_int.c              |  157 --
 drivers/oprofile/oprof.c                      |  286 ---
 drivers/oprofile/oprof.h                      |   50 -
 drivers/oprofile/oprofile_files.c             |  201 --
 drivers/oprofile/oprofile_perf.c              |  328 ----
 drivers/oprofile/oprofile_stats.c             |   84 -
 drivers/oprofile/oprofile_stats.h             |   33 -
 drivers/oprofile/oprofilefs.c                 |  300 ---
 drivers/oprofile/timer_int.c                  |  122 --
 fs/Makefile                                   |    1 -
 fs/dcookies.c                                 |  356 ----
 include/linux/dcookies.h                      |   69 -
 include/linux/oprofile.h                      |  209 --
 init/Kconfig                                  |    2 +-
 kernel/sys.c                                  |    1 -
 usr/include/Makefile                          |    2 -
 198 files changed, 8 insertions(+), 15566 deletions(-)
 delete mode 100644 arch/alpha/oprofile/Makefile
 delete mode 100644 arch/alpha/oprofile/common.c
 delete mode 100644 arch/alpha/oprofile/op_impl.h
 delete mode 100644 arch/alpha/oprofile/op_model_ev4.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev5.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev6.c
 delete mode 100644 arch/alpha/oprofile/op_model_ev67.c
 delete mode 100644 arch/arc/oprofile/Makefile
 delete mode 100644 arch/arc/oprofile/common.c
 delete mode 100644 arch/arm/oprofile/Makefile
 delete mode 100644 arch/arm/oprofile/common.c
 delete mode 100644 arch/ia64/include/asm/perfmon.h
 delete mode 100644 arch/ia64/include/uapi/asm/perfmon.h
 delete mode 100644 arch/ia64/include/uapi/asm/perfmon_default_smpl.h
 delete mode 100644 arch/ia64/kernel/perfmon_default_smpl.c
 delete mode 100644 arch/ia64/kernel/perfmon_generic.h
 delete mode 100644 arch/ia64/kernel/perfmon_mckinley.h
 delete mode 100644 arch/ia64/kernel/perfmon_montecito.h
 delete mode 100644 arch/ia64/oprofile/Makefile
 delete mode 100644 arch/ia64/oprofile/backtrace.c
 delete mode 100644 arch/ia64/oprofile/init.c
 delete mode 100644 arch/microblaze/oprofile/Makefile
 delete mode 100644 arch/microblaze/oprofile/microblaze_oprofile.c
 delete mode 100644 arch/mips/oprofile/Makefile
 delete mode 100644 arch/mips/oprofile/backtrace.c
 delete mode 100644 arch/mips/oprofile/common.c
 delete mode 100644 arch/mips/oprofile/op_impl.h
 delete mode 100644 arch/mips/oprofile/op_model_loongson2.c
 delete mode 100644 arch/mips/oprofile/op_model_loongson3.c
 delete mode 100644 arch/mips/oprofile/op_model_mipsxx.c
 delete mode 100644 arch/parisc/oprofile/Makefile
 delete mode 100644 arch/parisc/oprofile/init.c
 delete mode 100644 arch/powerpc/include/asm/oprofile_impl.h
 delete mode 100644 arch/powerpc/oprofile/Makefile
 delete mode 100644 arch/powerpc/oprofile/backtrace.c
 delete mode 100644 arch/powerpc/oprofile/cell/pr_util.h
 delete mode 100644 arch/powerpc/oprofile/cell/spu_profiler.c
 delete mode 100644 arch/powerpc/oprofile/cell/spu_task_sync.c
 delete mode 100644 arch/powerpc/oprofile/cell/vma_map.c
 delete mode 100644 arch/powerpc/oprofile/common.c
 delete mode 100644 arch/powerpc/oprofile/op_model_7450.c
 delete mode 100644 arch/powerpc/oprofile/op_model_cell.c
 delete mode 100644 arch/powerpc/oprofile/op_model_fsl_emb.c
 delete mode 100644 arch/powerpc/oprofile/op_model_pa6t.c
 delete mode 100644 arch/powerpc/oprofile/op_model_power4.c
 delete mode 100644 arch/powerpc/platforms/cell/spu_notify.c
 delete mode 100644 arch/s390/oprofile/Makefile
 delete mode 100644 arch/s390/oprofile/init.c
 delete mode 100644 arch/sh/oprofile/Makefile
 delete mode 100644 arch/sh/oprofile/backtrace.c
 delete mode 100644 arch/sh/oprofile/common.c
 delete mode 100644 arch/sparc/oprofile/Makefile
 delete mode 100644 arch/sparc/oprofile/init.c
 delete mode 100644 arch/x86/oprofile/Makefile
 delete mode 100644 arch/x86/oprofile/backtrace.c
 delete mode 100644 arch/x86/oprofile/init.c
 delete mode 100644 arch/x86/oprofile/nmi_int.c
 delete mode 100644 arch/x86/oprofile/op_counter.h
 delete mode 100644 arch/x86/oprofile/op_model_amd.c
 delete mode 100644 arch/x86/oprofile/op_model_p4.c
 delete mode 100644 arch/x86/oprofile/op_model_ppro.c
 delete mode 100644 arch/x86/oprofile/op_x86_model.h
 delete mode 100644 arch/xtensa/oprofile/Makefile
 delete mode 100644 arch/xtensa/oprofile/backtrace.c
 delete mode 100644 arch/xtensa/oprofile/init.c
 delete mode 100644 drivers/oprofile/buffer_sync.c
 delete mode 100644 drivers/oprofile/buffer_sync.h
 delete mode 100644 drivers/oprofile/cpu_buffer.c
 delete mode 100644 drivers/oprofile/cpu_buffer.h
 delete mode 100644 drivers/oprofile/event_buffer.c
 delete mode 100644 drivers/oprofile/event_buffer.h
 delete mode 100644 drivers/oprofile/nmi_timer_int.c
 delete mode 100644 drivers/oprofile/oprof.c
 delete mode 100644 drivers/oprofile/oprof.h
 delete mode 100644 drivers/oprofile/oprofile_files.c
 delete mode 100644 drivers/oprofile/oprofile_perf.c
 delete mode 100644 drivers/oprofile/oprofile_stats.c
 delete mode 100644 drivers/oprofile/oprofile_stats.h
 delete mode 100644 drivers/oprofile/oprofilefs.c
 delete mode 100644 drivers/oprofile/timer_int.c
 delete mode 100644 fs/dcookies.c
 delete mode 100644 include/linux/dcookies.h
 delete mode 100644 include/linux/oprofile.h

base-commit: 7c53f6b671f4aba70ff15e1b05148b10d58c2837

Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
Signature · 1 line
viresh
maintainer Acked-by on v1 12/18
#20 lore raw

Re: [PATCH 12/18] arch: s390: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar
Quoted 9 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove the old oprofile's architecture specific support.

Quoted 10 lines
---
 arch/s390/Kconfig                 |  1 -
 arch/s390/Makefile                |  3 ---
 arch/s390/configs/debug_defconfig |  1 -
 arch/s390/configs/defconfig       |  1 -
 arch/s390/oprofile/Makefile       | 10 ---------
 arch/s390/oprofile/init.c         | 37 -------------------------------
 6 files changed, 53 deletions(-)
 delete mode 100644 arch/s390/oprofile/Makefile
 delete mode 100644 arch/s390/oprofile/init.c
Acked-by on v1 4/18
#7 lore raw

RE: [PATCH 04/18] arch: hexagon: Don't select HAVE_OPROFILE

In reply to Viresh Kumar
Quoted 3 lines

-----Original Message-----
From: Viresh Kumar <[email protected]>
Sent: Thursday, January 14, 2021 5:35 AM

...

Quoted 2 lines

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the

perf

Quoted 3 lines

interfaces.

Don't select HAVE_OPROFILE for hexagon anymore.

Quoted 21 lines
---
 arch/hexagon/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/hexagon/Kconfig index renamed from arch/hexagon/Kconfig +0 -0

6e00c16a36b5..44a409967af1 100644

arch/hexagon/Kconfig +0 -2
@@ -7,7 +7,6 @@ config HEXAGON
 	select ARCH_32BIT_OFF_T
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
 	select ARCH_NO_PREEMPT
-	select HAVE_OPROFILE
 	# Other pending projects/to-do items.
 	# select HAVE_REGS_AND_STACK_ACCESS_API
 	# select HAVE_HW_BREAKPOINT if PERF_EVENTS
--

2.25.0.rc1.19.g042ed3e048af

Acked-by
#31 lore raw
In reply to Robert Richter
Quoted 54 lines · Robert Richter
Quoted 31 lines · Viresh Kumar

Hello,

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove oprofile and dcookies (whose only user is oprofile) support from the kernel.

This was suggested here [1] earlier.

This is build/boot tested by kernel test robot (Intel) and Linaro's Tuxmake[2] for a lot of architectures and no failures were reported.

--
Viresh

[1] https://lore.kernel.org/lkml/CAHk-=whw9t3ZtV8iA2SJWYQS1VOJuS14P_qhj3v5-9PCBmGQww@mail.gmail.com/
[2] https://lwn.net/Articles/841624/

Viresh Kumar (18):
arch: alpha: Remove CONFIG_OPROFILE support
arch: arm: Remove CONFIG_OPROFILE support
arch: arc: Remove CONFIG_OPROFILE support
arch: hexagon: Don't select HAVE_OPROFILE
arch: ia64: Remove CONFIG_OPROFILE support
arch: ia64: Remove rest of perfmon support
arch: microblaze: Remove CONFIG_OPROFILE support
arch: mips: Remove CONFIG_OPROFILE support
arch: parisc: Remove CONFIG_OPROFILE support
arch: powerpc: Stop building and using oprofile

Quoted 8 lines

arch: powerpc: Remove oprofile
arch: s390: Remove CONFIG_OPROFILE support
arch: sh: Remove CONFIG_OPROFILE support
arch: sparc: Remove CONFIG_OPROFILE support
arch: x86: Remove CONFIG_OPROFILE support
arch: xtensa: Remove CONFIG_OPROFILE support
drivers: Remove CONFIG_OPROFILE support
fs: Remove dcookies support

After oprofile userland moved to version 1.x, the kernel support for it isn't needed anymore. The switch was back in 2014 when oprofile started using the perf syscall:

https://sourceforge.net/p/oprofile/oprofile/ci/ba9edea2bdfe2c9475749fc83105632bd916b96c

Since then I haven't received any significant patches to implement new features or add support for newer platforms in the kernel. There haven't been bug reports sent or questions asked on the mailing list for quite a while, which indicates there are no or less users. Users (if any) should switch to oprofile 1.x or the perf tool. No need to carry kernel support any longer with us.

Quoted 3 lines

So time to get rid of it. For the whole series:

The oprofile daemon that used the older oprofile kernel support was removed before OProfile 1.0 release by the following commit in August 2014:

https://sourceforge.net/p/oprofile/oprofile/ci/0c142c3a096d3e9ec42cc9b0ddad994fea60d135

At this point it makes sense to clean up the kernel and remove this unused code.

Quoted 7 lines

_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list

maintainer
#28 lore raw

Re: [PATCH 17/18] drivers: Remove CONFIG_OPROFILE support

In reply to Viresh Kumar
Quoted 6 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

Remove kernel's old oprofile support.

Quoted 8 lines
---
 Documentation/RCU/NMI-RCU.rst                 |   3 +-
 .../admin-guide/kernel-parameters.txt         |  14 -
 Documentation/process/magic-number.rst        |   1 -
 .../it_IT/process/magic-number.rst            |   1 -

Of course that's OK for the italian transation

Signature · 1 line
Federico Vaga
#16 lore raw

Re: [PATCH 10/18] arch: powerpc: Stop building and using oprofile

In reply to Viresh Kumar
I love your patch! Yet something to improve:

Hi Viresh,

I love your patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on arm/for-next linus/master v5.11-rc3 next-20210115] [cannot apply to ia64/next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Viresh-Kumar/arch-alpha-Remove-CONFIG_OPROFILE-support/20210115-114211
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/73eed49221cc7f2fd6ff596f2a2c4f32117917b4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Viresh-Kumar/arch-alpha-Remove-CONFIG_OPROFILE-support/20210115-114211 git checkout 73eed49221cc7f2fd6ff596f2a2c4f32117917b4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

>> make[4]: *** No rule to make target 'arch/powerpc/platforms/cell/spu_notify.o', needed by 'arch/powerpc/platforms/cell/built-in.a'.

make[4]: Target '__build' not remade because of errors.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#17 lore raw

Re: [PATCH 10/18] arch: powerpc: Stop building and using oprofile

In reply to Viresh Kumar
Quoted 33 lines · Viresh Kumar

The "oprofile" user-space tools don't use the kernel OPROFILE support any more, and haven't in a long time. User-space has been converted to the perf interfaces.

This commits stops building oprofile for powerpc and removes any reference to it from directories in arch/powerpc/ apart from arch/powerpc/oprofile, which will be removed in the next commit (this is broken into two commits as the size of the commit became very big, ~5k lines).

Note that the member "oprofile_cpu_type" in "struct cpu_spec" isn't removed as it was also used by other parts of the code.

---
 arch/powerpc/Kconfig                          |   1 -
 arch/powerpc/Makefile                         |   2 -
 arch/powerpc/configs/44x/akebono_defconfig    |   1 -
 arch/powerpc/configs/44x/currituck_defconfig  |   1 -
 arch/powerpc/configs/44x/fsp2_defconfig       |   1 -
 arch/powerpc/configs/44x/iss476-smp_defconfig |   1 -
 arch/powerpc/configs/cell_defconfig           |   1 -
 arch/powerpc/configs/g5_defconfig             |   1 -
 arch/powerpc/configs/maple_defconfig          |   1 -
 arch/powerpc/configs/pasemi_defconfig         |   1 -
 arch/powerpc/configs/pmac32_defconfig         |   1 -
 arch/powerpc/configs/powernv_defconfig        |   1 -
 arch/powerpc/configs/ppc64_defconfig          |   1 -
 arch/powerpc/configs/ppc64e_defconfig         |   1 -
 arch/powerpc/configs/ppc6xx_defconfig         |   1 -
 arch/powerpc/configs/ps3_defconfig            |   1 -
Quoted 8 lines
 arch/powerpc/configs/pseries_defconfig        |   1 -
 arch/powerpc/include/asm/cputable.h           |  20 ---
 arch/powerpc/include/asm/oprofile_impl.h      | 135 ------------------
 arch/powerpc/include/asm/spu.h                |  33 -----
 arch/powerpc/kernel/cputable.c                |  67 ---------
 arch/powerpc/kernel/dt_cpu_ftrs.c             |   2 -
 arch/powerpc/platforms/cell/Kconfig           |   5 -
 arch/powerpc/platforms/cell/spu_notify.c      |  55 -------

+ this..

arch/powerpc/platforms/cell/Makefile +0 -1
index 10064a33ca96..7ea6692f67e2 100644
@@ -19,7 +19,6 @@ spu-priv1-$(CONFIG_PPC_CELL_COMMON)   += spu_priv1_mmio.o
 spu-manage-$(CONFIG_PPC_CELL_COMMON)   += spu_manage.o
 
 obj-$(CONFIG_SPU_BASE)                 += spu_callbacks.o spu_base.o \
-                                          spu_notify.o \
                                           spu_syscalls.o \
                                           $(spu-priv1-y) \
                                           $(spu-manage-y) \
Signature · 1 line
viresh
#34 lore raw
In reply to a message not in the archive
Quoted 6 lines · Linus Torvalds
Quoted 3 lines · Viresh Kumar

This is build/boot tested by kernel test robot (Intel) and Linaro's Tuxmake[2] for a lot of architectures and no failures were reported.

Can you make sure this is in linux-next, and we'll get this in for 5.12?

This series is in linux-next now.

Signature · 1 line
viresh