diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5fa580219a864e14982d5e7a9921b9f00a4cab0c..1e64da1d1de68d7e1b104806557d7a9f6f1b200a 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -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 diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 2faebfd72ecab5a4f1aa85c1dd1da40d8e66e08d..3bcbf52fb30eec85b7635a75bf2d11fc7c6cb6e8 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -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)) diff --git a/arch/sh/configs/espt_defconfig b/arch/sh/configs/espt_defconfig index 9a988c347e9d4e987336f15beb94f5417623a8dc..2804cb760a76152b6d15c60336d3e079ed1c55de 100644 --- a/arch/sh/configs/espt_defconfig +++ b/arch/sh/configs/espt_defconfig @@ -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 diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig index a24cf8cd2cea5694752df6b18dc99c9e31502444..4859cd30cfc4c666e3d446c76055a426c5333de4 100644 --- a/arch/sh/configs/migor_defconfig +++ b/arch/sh/configs/migor_defconfig @@ -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 diff --git a/arch/sh/configs/r7780mp_defconfig b/arch/sh/configs/r7780mp_defconfig index e922659fdadba9adf2b5edb49446af3ec89dd747..f823cc6b18f91d91b1ac46d34e93621f3e6ffc64 100644 --- a/arch/sh/configs/r7780mp_defconfig +++ b/arch/sh/configs/r7780mp_defconfig @@ -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 diff --git a/arch/sh/configs/r7785rp_defconfig b/arch/sh/configs/r7785rp_defconfig index 5978866358ec89f10818a91281b42a76eba4c1cb..f96bc20d4b1ac53c0ae0f73accdb3a7f87466ef3 100644 --- a/arch/sh/configs/r7785rp_defconfig +++ b/arch/sh/configs/r7785rp_defconfig @@ -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 diff --git a/arch/sh/configs/rsk7201_defconfig b/arch/sh/configs/rsk7201_defconfig index 841809b5c2dcc3e789320c50c41f08107fbd3576..e41526120be14baed6b122d1cccadc2c8f85b5b2 100644 --- a/arch/sh/configs/rsk7201_defconfig +++ b/arch/sh/configs/rsk7201_defconfig @@ -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 diff --git a/arch/sh/configs/rsk7203_defconfig b/arch/sh/configs/rsk7203_defconfig index 0055031664ad417a0a007bb622cebf35dd71ff51..6af08fa1ddf8a156535cbf7ad7f0beef7227919f 100644 --- a/arch/sh/configs/rsk7203_defconfig +++ b/arch/sh/configs/rsk7203_defconfig @@ -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 diff --git a/arch/sh/configs/rts7751r2d1_defconfig b/arch/sh/configs/rts7751r2d1_defconfig index fc9c22152b086dad40f366c20956364df786955b..96263a4912b726f7f880b8fc5a43c8cdf09091a0 100644 --- a/arch/sh/configs/rts7751r2d1_defconfig +++ b/arch/sh/configs/rts7751r2d1_defconfig @@ -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 diff --git a/arch/sh/configs/rts7751r2dplus_defconfig b/arch/sh/configs/rts7751r2dplus_defconfig index ff3fd6787fd61c21262c6275ae58fa2195842582..92e586e6c97432aedf230ba4cbb41012dff3ea75 100644 --- a/arch/sh/configs/rts7751r2dplus_defconfig +++ b/arch/sh/configs/rts7751r2dplus_defconfig @@ -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 diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig index 61bec46ebd66a857beedfbaaa9915e8bb48fa2d6..e804347cf68c397659c0b2eefbb5b765a53ee036 100644 --- a/arch/sh/configs/sdk7786_defconfig +++ b/arch/sh/configs/sdk7786_defconfig @@ -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 diff --git a/arch/sh/configs/se7206_defconfig b/arch/sh/configs/se7206_defconfig index ff5bb448992265466d5bc20d0682a6b4f1568863..315b04a8dd2fb3b5e63b92114646c8f4d87a5963 100644 --- a/arch/sh/configs/se7206_defconfig +++ b/arch/sh/configs/se7206_defconfig @@ -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 diff --git a/arch/sh/configs/sh03_defconfig b/arch/sh/configs/sh03_defconfig index f0073ed3994771c071effbf29365dc144a6c561d..f0ce5b0057ed6e8a4c55b24ee4fd7c8c7d806bbd 100644 --- a/arch/sh/configs/sh03_defconfig +++ b/arch/sh/configs/sh03_defconfig @@ -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 diff --git a/arch/sh/configs/sh7724_generic_defconfig b/arch/sh/configs/sh7724_generic_defconfig index 9adee90103199dc6014332443856bdc1c982a58f..2c46c0004780337a7b2f8bb19ebd315769b5bbcd 100644 --- a/arch/sh/configs/sh7724_generic_defconfig +++ b/arch/sh/configs/sh7724_generic_defconfig @@ -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 diff --git a/arch/sh/configs/sh7763rdp_defconfig b/arch/sh/configs/sh7763rdp_defconfig index 26c5fd02c87a152db4bb5ad67c3ced60f1038e52..8a6a446f9eb88a6f2e08d3aab4c6f5fa44c18847 100644 --- a/arch/sh/configs/sh7763rdp_defconfig +++ b/arch/sh/configs/sh7763rdp_defconfig @@ -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 diff --git a/arch/sh/configs/sh7770_generic_defconfig b/arch/sh/configs/sh7770_generic_defconfig index c17590f0df67aa1c67dff5e035cfa8f6e76e7ec9..88193153e51bfd809c57e44863bf4dabdf82a0a4 100644 --- a/arch/sh/configs/sh7770_generic_defconfig +++ b/arch/sh/configs/sh7770_generic_defconfig @@ -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 diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig index dc2be2514b6234a458f866ad180d44307206e988..32ec6eb1eabcfc2be257fde90b90883b672ad6b7 100644 --- a/arch/sh/configs/shx3_defconfig +++ b/arch/sh/configs/shx3_defconfig @@ -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 diff --git a/arch/sh/oprofile/Makefile b/arch/sh/oprofile/Makefile deleted file mode 100644 index d478dd8dac0b240bfecfef56039e3428b8a7ee07..0000000000000000000000000000000000000000 --- a/arch/sh/oprofile/Makefile +++ /dev/null @@ -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 diff --git a/arch/sh/oprofile/backtrace.c b/arch/sh/oprofile/backtrace.c deleted file mode 100644 index cc16cf86cd92fabeaade61f897fc62d26d2a288f..0000000000000000000000000000000000000000 --- a/arch/sh/oprofile/backtrace.c +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * SH specific backtracing code for oprofile - * - * Copyright 2007 STMicroelectronics Ltd. - * - * Author: Dave Peverley - * - * Based on ARM oprofile backtrace code by Richard Purdie and in turn, i386 - * oprofile backtrace code by John Levon, David Smith - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static void backtrace_address(void *data, unsigned long addr, int reliable) -{ - unsigned int *depth = data; - - if ((*depth)--) - oprofile_add_trace(addr); -} - -static struct stacktrace_ops backtrace_ops = { - .address = backtrace_address, -}; - -/* Limit to stop backtracing too far. */ -static int backtrace_limit = 20; - -static unsigned long * -user_backtrace(unsigned long *stackaddr, struct pt_regs *regs) -{ - unsigned long buf_stack; - - /* Also check accessibility of address */ - if (!access_ok(stackaddr, sizeof(unsigned long))) - return NULL; - - if (__copy_from_user_inatomic(&buf_stack, stackaddr, sizeof(unsigned long))) - return NULL; - - /* Quick paranoia check */ - if (buf_stack & 3) - return NULL; - - oprofile_add_trace(buf_stack); - - stackaddr++; - - return stackaddr; -} - -void sh_backtrace(struct pt_regs * const regs, unsigned int depth) -{ - unsigned long *stackaddr; - - /* - * Paranoia - clip max depth as we could get lost in the weeds. - */ - if (depth > backtrace_limit) - depth = backtrace_limit; - - stackaddr = (unsigned long *)kernel_stack_pointer(regs); - if (!user_mode(regs)) { - if (depth) - unwind_stack(NULL, regs, stackaddr, - &backtrace_ops, &depth); - return; - } - - while (depth-- && (stackaddr != NULL)) - stackaddr = user_backtrace(stackaddr, regs); -} diff --git a/arch/sh/oprofile/common.c b/arch/sh/oprofile/common.c deleted file mode 100644 index e4dd5d5a111506889b5a69284355721fc23c80f7..0000000000000000000000000000000000000000 --- a/arch/sh/oprofile/common.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * arch/sh/oprofile/init.c - * - * Copyright (C) 2003 - 2010 Paul Mundt - * - * Based on arch/mips/oprofile/common.c: - * - * Copyright (C) 2004, 2005 Ralf Baechle - * Copyright (C) 2005 MIPS Technologies, Inc. - * - * 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 -#include -#include -#include -#include -#include -#include -#include - -extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth); - -#ifdef CONFIG_HW_PERF_EVENTS -/* - * This will need to be reworked when multiple PMUs are supported. - */ -static char *sh_pmu_op_name; - -char *op_name_from_perf_id(void) -{ - return sh_pmu_op_name; -} - -int __init oprofile_arch_init(struct oprofile_operations *ops) -{ - ops->backtrace = sh_backtrace; - - if (perf_num_counters() == 0) - return -ENODEV; - - sh_pmu_op_name = kasprintf(GFP_KERNEL, "%s/%s", - UTS_MACHINE, perf_pmu_name()); - if (unlikely(!sh_pmu_op_name)) - return -ENOMEM; - - return oprofile_perf_init(ops); -} - -void oprofile_arch_exit(void) -{ - oprofile_perf_exit(); - kfree(sh_pmu_op_name); -} -#else -int __init oprofile_arch_init(struct oprofile_operations *ops) -{ - ops->backtrace = sh_backtrace; - return -ENODEV; -} -void oprofile_arch_exit(void) {} -#endif /* CONFIG_HW_PERF_EVENTS */