Skip to content

Commit

Permalink
arch: powerpc: Stop building and using oprofile
Browse files Browse the repository at this point in the history
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.

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>
  • Loading branch information
Viresh Kumar committed Jan 29, 2021
1 parent 7a22384 commit 7a3c90d
Show file tree
Hide file tree
Showing 28 changed files with 1 addition and 347 deletions.
1 change: 0 additions & 1 deletion arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/44x/akebono_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/44x/currituck_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/44x/fsp2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/44x/iss476-smp_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/cell_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/g5_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/maple_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/pasemi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/pmac32_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/powernv_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/ppc64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/ppc64e_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/ppc6xx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/ps3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/pseries_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 0 additions & 20 deletions arch/powerpc/include/asm/cputable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down
135 changes: 0 additions & 135 deletions arch/powerpc/include/asm/oprofile_impl.h

This file was deleted.

33 changes: 0 additions & 33 deletions arch/powerpc/include/asm/spu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 7a3c90d

Please sign in to comment.