arch: sparc: Remove CONFIG_OPROFILE support
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 14 Jan 2021 11:35:27 +0000 (17:05 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 29 Jan 2021 04:35:51 +0000 (10:05 +0530)
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.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Robert Richter <rric@kernel.org>
Acked-by: William Cohen <wcohen@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Documentation/kbuild/makefiles.rst
arch/sparc/Kconfig
arch/sparc/Makefile
arch/sparc/configs/sparc64_defconfig
arch/sparc/oprofile/Makefile [deleted file]
arch/sparc/oprofile/init.c [deleted file]

index 9f6a118..d7b2e02 100644 (file)
@@ -1317,7 +1317,6 @@ When kbuild executes, the following steps are followed (roughly):
                libs-y                 += arch/sparc/lib/
 
                drivers-$(CONFIG_PM) += arch/sparc/power/
-               drivers-$(CONFIG_OPROFILE)      += arch/sparc/oprofile/
 
 7.5 Architecture-specific boot images
 -------------------------------------
index c9c34dc..caf95e6 100644 (file)
@@ -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
index 4a09195..bee99e6 100644 (file)
@@ -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
 
index bde4d21..d91eb6a 100644 (file)
@@ -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
diff --git a/arch/sparc/oprofile/Makefile b/arch/sparc/oprofile/Makefile
deleted file mode 100644 (file)
index fe906e4..0000000
+++ /dev/null
@@ -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
diff --git a/arch/sparc/oprofile/init.c b/arch/sparc/oprofile/init.c
deleted file mode 100644 (file)
index 43730c9..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * @file init.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- */
-
-#include <linux/kernel.h>
-#include <linux/oprofile.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/param.h>       /* for HZ */
-#ifdef CONFIG_SPARC64
-#include <linux/notifier.h>
-#include <linux/rcupdate.h>
-#include <linux/kdebug.h>
-#include <asm/nmi.h>
-
-static int profile_timer_exceptions_notify(struct notifier_block *self,
-                                          unsigned long val, void *data)
-{
-       struct die_args *args = data;
-       int ret = NOTIFY_DONE;
-
-       switch (val) {
-       case DIE_NMI:
-               oprofile_add_sample(args->regs, 0);
-               ret = NOTIFY_STOP;
-               break;
-       default:
-               break;
-       }
-       return ret;
-}
-
-static struct notifier_block profile_timer_exceptions_nb = {
-       .notifier_call  = profile_timer_exceptions_notify,
-};
-
-static int timer_start(void)
-{
-       if (register_die_notifier(&profile_timer_exceptions_nb))
-               return 1;
-       nmi_adjust_hz(HZ);
-       return 0;
-}
-
-
-static void timer_stop(void)
-{
-       nmi_adjust_hz(1);
-       unregister_die_notifier(&profile_timer_exceptions_nb);
-       synchronize_rcu();  /* Allow already-started NMIs to complete. */
-}
-
-static int op_nmi_timer_init(struct oprofile_operations *ops)
-{
-       if (atomic_read(&nmi_active) <= 0)
-               return -ENODEV;
-
-       ops->start = timer_start;
-       ops->stop = timer_stop;
-       ops->cpu_type = "timer";
-       printk(KERN_INFO "oprofile: Using perfctr NMI timer interrupt.\n");
-       return 0;
-}
-#endif
-
-int __init oprofile_arch_init(struct oprofile_operations *ops)
-{
-       int ret = -ENODEV;
-
-#ifdef CONFIG_SPARC64
-       ret = op_nmi_timer_init(ops);
-       if (!ret)
-               return ret;
-#endif
-
-       return ret;
-}
-
-void oprofile_arch_exit(void)
-{
-}