mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
ia64: Remove perfmon
perfmon has been marked broken and thus been disabled for all builds for more than two years. Remove it entirely. Cc: Anant Thazhemadam <anant.thazhemadam@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Enthusiastically-ACKed-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20200911094920.1173631-1-hch@lst.de
This commit is contained in:
parent
f4d51dffc6
commit
ecf5b72d5f
@ -362,15 +362,6 @@ config ARCH_PROC_KCORE_TEXT
|
|||||||
config IA64_MCA_RECOVERY
|
config IA64_MCA_RECOVERY
|
||||||
tristate "MCA recovery from errors other than TLB."
|
tristate "MCA recovery from errors other than TLB."
|
||||||
|
|
||||||
config PERFMON
|
|
||||||
bool "Performance monitor support"
|
|
||||||
depends on BROKEN
|
|
||||||
help
|
|
||||||
Selects whether support for the IA-64 performance monitor hardware
|
|
||||||
is included in the kernel. This makes some kernel data-structures a
|
|
||||||
little bigger and slows down execution a bit, but it is generally
|
|
||||||
a good idea to turn this on. If you're unsure, say Y.
|
|
||||||
|
|
||||||
config IA64_PALINFO
|
config IA64_PALINFO
|
||||||
tristate "/proc/pal support"
|
tristate "/proc/pal support"
|
||||||
help
|
help
|
||||||
|
@ -11,7 +11,6 @@ CONFIG_SMP=y
|
|||||||
CONFIG_NR_CPUS=2
|
CONFIG_NR_CPUS=2
|
||||||
CONFIG_PREEMPT=y
|
CONFIG_PREEMPT=y
|
||||||
# CONFIG_VIRTUAL_MEM_MAP is not set
|
# CONFIG_VIRTUAL_MEM_MAP is not set
|
||||||
CONFIG_PERFMON=y
|
|
||||||
CONFIG_IA64_PALINFO=y
|
CONFIG_IA64_PALINFO=y
|
||||||
CONFIG_EFI_VARS=y
|
CONFIG_EFI_VARS=y
|
||||||
CONFIG_BINFMT_MISC=m
|
CONFIG_BINFMT_MISC=m
|
||||||
|
@ -18,7 +18,6 @@ CONFIG_IA64_CYCLONE=y
|
|||||||
CONFIG_SMP=y
|
CONFIG_SMP=y
|
||||||
CONFIG_HOTPLUG_CPU=y
|
CONFIG_HOTPLUG_CPU=y
|
||||||
CONFIG_IA64_MCA_RECOVERY=y
|
CONFIG_IA64_MCA_RECOVERY=y
|
||||||
CONFIG_PERFMON=y
|
|
||||||
CONFIG_IA64_PALINFO=y
|
CONFIG_IA64_PALINFO=y
|
||||||
CONFIG_KEXEC=y
|
CONFIG_KEXEC=y
|
||||||
CONFIG_CRASH_DUMP=y
|
CONFIG_CRASH_DUMP=y
|
||||||
|
@ -17,7 +17,6 @@ CONFIG_NR_CPUS=512
|
|||||||
CONFIG_HOTPLUG_CPU=y
|
CONFIG_HOTPLUG_CPU=y
|
||||||
CONFIG_SPARSEMEM_MANUAL=y
|
CONFIG_SPARSEMEM_MANUAL=y
|
||||||
CONFIG_IA64_MCA_RECOVERY=y
|
CONFIG_IA64_MCA_RECOVERY=y
|
||||||
CONFIG_PERFMON=y
|
|
||||||
CONFIG_IA64_PALINFO=y
|
CONFIG_IA64_PALINFO=y
|
||||||
CONFIG_EFI_VARS=y
|
CONFIG_EFI_VARS=y
|
||||||
CONFIG_BINFMT_MISC=m
|
CONFIG_BINFMT_MISC=m
|
||||||
|
@ -21,7 +21,6 @@ CONFIG_HOTPLUG_CPU=y
|
|||||||
CONFIG_PERMIT_BSP_REMOVE=y
|
CONFIG_PERMIT_BSP_REMOVE=y
|
||||||
CONFIG_FORCE_CPEI_RETARGET=y
|
CONFIG_FORCE_CPEI_RETARGET=y
|
||||||
CONFIG_IA64_MCA_RECOVERY=y
|
CONFIG_IA64_MCA_RECOVERY=y
|
||||||
CONFIG_PERFMON=y
|
|
||||||
CONFIG_IA64_PALINFO=y
|
CONFIG_IA64_PALINFO=y
|
||||||
CONFIG_KEXEC=y
|
CONFIG_KEXEC=y
|
||||||
CONFIG_EFI_VARS=y
|
CONFIG_EFI_VARS=y
|
||||||
|
@ -10,7 +10,6 @@ CONFIG_NR_CPUS=16
|
|||||||
CONFIG_HOTPLUG_CPU=y
|
CONFIG_HOTPLUG_CPU=y
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
CONFIG_IA64_MCA_RECOVERY=y
|
CONFIG_IA64_MCA_RECOVERY=y
|
||||||
CONFIG_PERFMON=y
|
|
||||||
CONFIG_IA64_PALINFO=y
|
CONFIG_IA64_PALINFO=y
|
||||||
CONFIG_CRASH_DUMP=y
|
CONFIG_CRASH_DUMP=y
|
||||||
CONFIG_EFI_VARS=y
|
CONFIG_EFI_VARS=y
|
||||||
|
@ -280,15 +280,6 @@ struct thread_struct {
|
|||||||
__u64 map_base; /* base address for get_unmapped_area() */
|
__u64 map_base; /* base address for get_unmapped_area() */
|
||||||
__u64 rbs_bot; /* the base address for the RBS */
|
__u64 rbs_bot; /* the base address for the RBS */
|
||||||
int last_fph_cpu; /* CPU that may hold the contents of f32-f127 */
|
int last_fph_cpu; /* CPU that may hold the contents of f32-f127 */
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
void *pfm_context; /* pointer to detailed PMU context */
|
|
||||||
unsigned long pfm_needs_checking; /* when >0, pending perfmon work on kernel exit */
|
|
||||||
# define INIT_THREAD_PM .pfm_context = NULL, \
|
|
||||||
.pfm_needs_checking = 0UL,
|
|
||||||
#else
|
|
||||||
# define INIT_THREAD_PM
|
|
||||||
#endif
|
|
||||||
unsigned long dbr[IA64_NUM_DBG_REGS];
|
unsigned long dbr[IA64_NUM_DBG_REGS];
|
||||||
unsigned long ibr[IA64_NUM_DBG_REGS];
|
unsigned long ibr[IA64_NUM_DBG_REGS];
|
||||||
struct ia64_fpreg fph[96]; /* saved/loaded on demand */
|
struct ia64_fpreg fph[96]; /* saved/loaded on demand */
|
||||||
@ -301,7 +292,6 @@ struct thread_struct {
|
|||||||
.map_base = DEFAULT_MAP_BASE, \
|
.map_base = DEFAULT_MAP_BASE, \
|
||||||
.rbs_bot = STACK_TOP - DEFAULT_USER_STACK_SIZE, \
|
.rbs_bot = STACK_TOP - DEFAULT_USER_STACK_SIZE, \
|
||||||
.last_fph_cpu = -1, \
|
.last_fph_cpu = -1, \
|
||||||
INIT_THREAD_PM \
|
|
||||||
.dbr = {0, }, \
|
.dbr = {0, }, \
|
||||||
.ibr = {0, }, \
|
.ibr = {0, }, \
|
||||||
.fph = {{{{0}}}, } \
|
.fph = {{{{0}}}, } \
|
||||||
|
@ -31,16 +31,8 @@ extern struct task_struct *ia64_switch_to (void *next_task);
|
|||||||
extern void ia64_save_extra (struct task_struct *task);
|
extern void ia64_save_extra (struct task_struct *task);
|
||||||
extern void ia64_load_extra (struct task_struct *task);
|
extern void ia64_load_extra (struct task_struct *task);
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
DECLARE_PER_CPU(unsigned long, pfm_syst_info);
|
|
||||||
# define PERFMON_IS_SYSWIDE() (__this_cpu_read(pfm_syst_info) & 0x1)
|
|
||||||
#else
|
|
||||||
# define PERFMON_IS_SYSWIDE() (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IA64_HAS_EXTRA_STATE(t) \
|
#define IA64_HAS_EXTRA_STATE(t) \
|
||||||
((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID) \
|
((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID))
|
||||||
|| PERFMON_IS_SYSWIDE())
|
|
||||||
|
|
||||||
#define __switch_to(prev,next,last) do { \
|
#define __switch_to(prev,next,last) do { \
|
||||||
if (IA64_HAS_EXTRA_STATE(prev)) \
|
if (IA64_HAS_EXTRA_STATE(prev)) \
|
||||||
|
@ -10,7 +10,7 @@ endif
|
|||||||
extra-y := head.o vmlinux.lds
|
extra-y := head.o vmlinux.lds
|
||||||
|
|
||||||
obj-y := entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \
|
obj-y := entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \
|
||||||
irq_lsapic.o ivt.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \
|
irq_lsapic.o ivt.o pal.o patch.o process.o ptrace.o sal.o \
|
||||||
salinfo.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
|
salinfo.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
|
||||||
unwind.o mca.o mca_asm.o topology.o dma-mapping.o iosapic.o acpi.o \
|
unwind.o mca.o mca_asm.o topology.o dma-mapping.o iosapic.o acpi.o \
|
||||||
acpi-ext.o
|
acpi-ext.o
|
||||||
@ -21,7 +21,6 @@ obj-$(CONFIG_IA64_PALINFO) += palinfo.o
|
|||||||
obj-$(CONFIG_MODULES) += module.o
|
obj-$(CONFIG_MODULES) += module.o
|
||||||
obj-$(CONFIG_SMP) += smp.o smpboot.o
|
obj-$(CONFIG_SMP) += smp.o smpboot.o
|
||||||
obj-$(CONFIG_NUMA) += numa.o
|
obj-$(CONFIG_NUMA) += numa.o
|
||||||
obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o
|
|
||||||
obj-$(CONFIG_IA64_CYCLONE) += cyclone.o
|
obj-$(CONFIG_IA64_CYCLONE) += cyclone.o
|
||||||
obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
|
obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
|
||||||
obj-$(CONFIG_KPROBES) += kprobes.o
|
obj-$(CONFIG_KPROBES) += kprobes.o
|
||||||
|
@ -40,10 +40,6 @@
|
|||||||
#include <asm/hw_irq.h>
|
#include <asm/hw_irq.h>
|
||||||
#include <asm/tlbflush.h>
|
#include <asm/tlbflush.h>
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
# include <asm/perfmon.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IRQ_DEBUG 0
|
#define IRQ_DEBUG 0
|
||||||
|
|
||||||
#define IRQ_VECTOR_UNASSIGNED (0)
|
#define IRQ_VECTOR_UNASSIGNED (0)
|
||||||
@ -627,9 +623,6 @@ init_IRQ (void)
|
|||||||
"irq_move");
|
"irq_move");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
pfm_init_percpu();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -51,10 +51,6 @@
|
|||||||
|
|
||||||
#include "entry.h"
|
#include "entry.h"
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
# include <asm/perfmon.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "sigframe.h"
|
#include "sigframe.h"
|
||||||
|
|
||||||
void (*ia64_mark_idle)(int);
|
void (*ia64_mark_idle)(int);
|
||||||
@ -174,15 +170,6 @@ do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long in_syscall)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
if (current->thread.pfm_needs_checking)
|
|
||||||
/*
|
|
||||||
* Note: pfm_handle_work() allow us to call it with interrupts
|
|
||||||
* disabled, and may enable interrupts within the function.
|
|
||||||
*/
|
|
||||||
pfm_handle_work();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* deal with pending signal delivery */
|
/* deal with pending signal delivery */
|
||||||
if (test_thread_flag(TIF_SIGPENDING)) {
|
if (test_thread_flag(TIF_SIGPENDING)) {
|
||||||
local_irq_enable(); /* force interrupt enable */
|
local_irq_enable(); /* force interrupt enable */
|
||||||
@ -264,41 +251,15 @@ void arch_cpu_idle(void)
|
|||||||
void
|
void
|
||||||
ia64_save_extra (struct task_struct *task)
|
ia64_save_extra (struct task_struct *task)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
unsigned long info;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0)
|
if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0)
|
||||||
ia64_save_debug_regs(&task->thread.dbr[0]);
|
ia64_save_debug_regs(&task->thread.dbr[0]);
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0)
|
|
||||||
pfm_save_regs(task);
|
|
||||||
|
|
||||||
info = __this_cpu_read(pfm_syst_info);
|
|
||||||
if (info & PFM_CPUINFO_SYST_WIDE)
|
|
||||||
pfm_syst_wide_update_task(task, info, 0);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ia64_load_extra (struct task_struct *task)
|
ia64_load_extra (struct task_struct *task)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
unsigned long info;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0)
|
if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0)
|
||||||
ia64_load_debug_regs(&task->thread.dbr[0]);
|
ia64_load_debug_regs(&task->thread.dbr[0]);
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0)
|
|
||||||
pfm_load_regs(task);
|
|
||||||
|
|
||||||
info = __this_cpu_read(pfm_syst_info);
|
|
||||||
if (info & PFM_CPUINFO_SYST_WIDE)
|
|
||||||
pfm_syst_wide_update_task(task, info, 1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -432,11 +393,6 @@ copy_thread(unsigned long clone_flags, unsigned long user_stack_base,
|
|||||||
*/
|
*/
|
||||||
child_ptregs->cr_ipsr = ((child_ptregs->cr_ipsr | IA64_PSR_BITS_TO_SET)
|
child_ptregs->cr_ipsr = ((child_ptregs->cr_ipsr | IA64_PSR_BITS_TO_SET)
|
||||||
& ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_PP | IA64_PSR_UP));
|
& ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_PP | IA64_PSR_UP));
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
if (current->thread.pfm_context)
|
|
||||||
pfm_inherit(p, child_ptregs);
|
|
||||||
#endif
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -563,15 +519,6 @@ exit_thread (struct task_struct *tsk)
|
|||||||
{
|
{
|
||||||
|
|
||||||
ia64_drop_fpu(tsk);
|
ia64_drop_fpu(tsk);
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
/* if needed, stop monitoring and flush state to perfmon context */
|
|
||||||
if (tsk->thread.pfm_context)
|
|
||||||
pfm_exit_thread(tsk);
|
|
||||||
|
|
||||||
/* free debug register resources */
|
|
||||||
if (tsk->thread.flags & IA64_THREAD_DBG_VALID)
|
|
||||||
pfm_release_debug_registers(tsk);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
|
@ -30,9 +30,6 @@
|
|||||||
#include <asm/rse.h>
|
#include <asm/rse.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include <asm/unwind.h>
|
#include <asm/unwind.h>
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
#include <asm/perfmon.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "entry.h"
|
#include "entry.h"
|
||||||
|
|
||||||
@ -1951,27 +1948,6 @@ access_uarea(struct task_struct *child, unsigned long addr,
|
|||||||
"address 0x%lx\n", addr);
|
"address 0x%lx\n", addr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
/*
|
|
||||||
* Check if debug registers are used by perfmon. This
|
|
||||||
* test must be done once we know that we can do the
|
|
||||||
* operation, i.e. the arguments are all valid, but
|
|
||||||
* before we start modifying the state.
|
|
||||||
*
|
|
||||||
* Perfmon needs to keep a count of how many processes
|
|
||||||
* are trying to modify the debug registers for system
|
|
||||||
* wide monitoring sessions.
|
|
||||||
*
|
|
||||||
* We also include read access here, because they may
|
|
||||||
* cause the PMU-installed debug register state
|
|
||||||
* (dbr[], ibr[]) to be reset. The two arrays are also
|
|
||||||
* used by perfmon, but we do not use
|
|
||||||
* IA64_THREAD_DBG_VALID. The registers are restored
|
|
||||||
* by the PMU context switch code.
|
|
||||||
*/
|
|
||||||
if (pfm_use_debug_registers(child))
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(child->thread.flags & IA64_THREAD_DBG_VALID)) {
|
if (!(child->thread.flags & IA64_THREAD_DBG_VALID)) {
|
||||||
child->thread.flags |= IA64_THREAD_DBG_VALID;
|
child->thread.flags |= IA64_THREAD_DBG_VALID;
|
||||||
|
@ -355,10 +355,6 @@ smp_callin (void)
|
|||||||
extern void ia64_init_itm(void);
|
extern void ia64_init_itm(void);
|
||||||
extern volatile int time_keeper_id;
|
extern volatile int time_keeper_id;
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
extern void pfm_init_percpu(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cpuid = smp_processor_id();
|
cpuid = smp_processor_id();
|
||||||
phys_id = hard_smp_processor_id();
|
phys_id = hard_smp_processor_id();
|
||||||
itc_master = time_keeper_id;
|
itc_master = time_keeper_id;
|
||||||
@ -389,10 +385,6 @@ smp_callin (void)
|
|||||||
|
|
||||||
ia64_mca_cmc_vector_setup(); /* Setup vector on AP */
|
ia64_mca_cmc_vector_setup(); /* Setup vector on AP */
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
pfm_init_percpu();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
local_irq_enable();
|
local_irq_enable();
|
||||||
|
|
||||||
if (!(sal_platform_features & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT)) {
|
if (!(sal_platform_features & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT)) {
|
||||||
|
@ -160,7 +160,7 @@
|
|||||||
148 common mmap2 sys_mmap2
|
148 common mmap2 sys_mmap2
|
||||||
149 common pciconfig_read sys_pciconfig_read
|
149 common pciconfig_read sys_pciconfig_read
|
||||||
150 common pciconfig_write sys_pciconfig_write
|
150 common pciconfig_write sys_pciconfig_write
|
||||||
151 common perfmonctl sys_perfmonctl
|
151 common perfmonctl sys_ni_syscall
|
||||||
152 common sigaltstack sys_sigaltstack
|
152 common sigaltstack sys_sigaltstack
|
||||||
153 common rt_sigaction sys_rt_sigaction
|
153 common rt_sigaction sys_rt_sigaction
|
||||||
154 common rt_sigpending sys_rt_sigpending
|
154 common rt_sigpending sys_rt_sigpending
|
||||||
|
@ -12,7 +12,6 @@ lib-y := io.o __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
|
|||||||
|
|
||||||
lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
|
lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
|
||||||
lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
|
lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
|
||||||
lib-$(CONFIG_PERFMON) += carta_random.o
|
|
||||||
|
|
||||||
AFLAGS___divdi3.o =
|
AFLAGS___divdi3.o =
|
||||||
AFLAGS___udivdi3.o = -DUNSIGNED
|
AFLAGS___udivdi3.o = -DUNSIGNED
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
/*
|
|
||||||
* Fast, simple, yet decent quality random number generator based on
|
|
||||||
* a paper by David G. Carta ("Two Fast Implementations of the
|
|
||||||
* `Minimal Standard' Random Number Generator," Communications of the
|
|
||||||
* ACM, January, 1990).
|
|
||||||
*
|
|
||||||
* Copyright (C) 2002 Hewlett-Packard Co
|
|
||||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <asm/asmmacro.h>
|
|
||||||
|
|
||||||
#define a r2
|
|
||||||
#define m r3
|
|
||||||
#define lo r8
|
|
||||||
#define hi r9
|
|
||||||
#define t0 r16
|
|
||||||
#define t1 r17
|
|
||||||
#define seed r32
|
|
||||||
|
|
||||||
GLOBAL_ENTRY(carta_random32)
|
|
||||||
movl a = (16807 << 16) | 16807
|
|
||||||
;;
|
|
||||||
pmpyshr2.u t0 = a, seed, 0
|
|
||||||
pmpyshr2.u t1 = a, seed, 16
|
|
||||||
;;
|
|
||||||
unpack2.l t0 = t1, t0
|
|
||||||
dep m = -1, r0, 0, 31
|
|
||||||
;;
|
|
||||||
zxt4 lo = t0
|
|
||||||
shr.u hi = t0, 32
|
|
||||||
;;
|
|
||||||
dep t0 = 0, hi, 15, 49 // t0 = (hi & 0x7fff)
|
|
||||||
;;
|
|
||||||
shl t0 = t0, 16 // t0 = (hi & 0x7fff) << 16
|
|
||||||
shr t1 = hi, 15 // t1 = (hi >> 15)
|
|
||||||
;;
|
|
||||||
add lo = lo, t0
|
|
||||||
;;
|
|
||||||
cmp.gtu p6, p0 = lo, m
|
|
||||||
;;
|
|
||||||
(p6) and lo = lo, m
|
|
||||||
;;
|
|
||||||
(p6) add lo = 1, lo
|
|
||||||
;;
|
|
||||||
add lo = lo, t1
|
|
||||||
;;
|
|
||||||
cmp.gtu p6, p0 = lo, m
|
|
||||||
;;
|
|
||||||
(p6) and lo = lo, m
|
|
||||||
;;
|
|
||||||
(p6) add lo = 1, lo
|
|
||||||
br.ret.sptk.many rp
|
|
||||||
END(carta_random32)
|
|
@ -8,4 +8,3 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
|
|||||||
timer_int.o )
|
timer_int.o )
|
||||||
|
|
||||||
oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
|
oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
|
||||||
oprofile-$(CONFIG_PERFMON) += perfmon.o
|
|
||||||
|
@ -18,21 +18,11 @@ extern void ia64_backtrace(struct pt_regs * const regs, unsigned int depth);
|
|||||||
|
|
||||||
int __init oprofile_arch_init(struct oprofile_operations *ops)
|
int __init oprofile_arch_init(struct oprofile_operations *ops)
|
||||||
{
|
{
|
||||||
int ret = -ENODEV;
|
|
||||||
|
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
/* perfmon_init() can fail, but we have no way to report it */
|
|
||||||
ret = perfmon_init(ops);
|
|
||||||
#endif
|
|
||||||
ops->backtrace = ia64_backtrace;
|
ops->backtrace = ia64_backtrace;
|
||||||
|
return -ENODEV;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void oprofile_arch_exit(void)
|
void oprofile_arch_exit(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PERFMON
|
|
||||||
perfmon_exit();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -1,99 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file perfmon.c
|
|
||||||
*
|
|
||||||
* @remark Copyright 2003 OProfile authors
|
|
||||||
* @remark Read the file COPYING
|
|
||||||
*
|
|
||||||
* @author John Levon <levon@movementarian.org>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/oprofile.h>
|
|
||||||
#include <linux/sched.h>
|
|
||||||
#include <asm/perfmon.h>
|
|
||||||
#include <asm/ptrace.h>
|
|
||||||
#include <asm/errno.h>
|
|
||||||
|
|
||||||
static int allow_ints;
|
|
||||||
|
|
||||||
static int
|
|
||||||
perfmon_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg,
|
|
||||||
struct pt_regs *regs, unsigned long stamp)
|
|
||||||
{
|
|
||||||
int event = arg->pmd_eventid;
|
|
||||||
|
|
||||||
arg->ovfl_ctrl.bits.reset_ovfl_pmds = 1;
|
|
||||||
|
|
||||||
/* the owner of the oprofile event buffer may have exited
|
|
||||||
* without perfmon being shutdown (e.g. SIGSEGV)
|
|
||||||
*/
|
|
||||||
if (allow_ints)
|
|
||||||
oprofile_add_sample(regs, event);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int perfmon_start(void)
|
|
||||||
{
|
|
||||||
allow_ints = 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void perfmon_stop(void)
|
|
||||||
{
|
|
||||||
allow_ints = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#define OPROFILE_FMT_UUID { \
|
|
||||||
0x77, 0x7a, 0x6e, 0x61, 0x20, 0x65, 0x73, 0x69, 0x74, 0x6e, 0x72, 0x20, 0x61, 0x65, 0x0a, 0x6c }
|
|
||||||
|
|
||||||
static pfm_buffer_fmt_t oprofile_fmt = {
|
|
||||||
.fmt_name = "oprofile_format",
|
|
||||||
.fmt_uuid = OPROFILE_FMT_UUID,
|
|
||||||
.fmt_handler = perfmon_handler,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static char *get_cpu_type(void)
|
|
||||||
{
|
|
||||||
__u8 family = local_cpu_data->family;
|
|
||||||
|
|
||||||
switch (family) {
|
|
||||||
case 0x07:
|
|
||||||
return "ia64/itanium";
|
|
||||||
case 0x1f:
|
|
||||||
return "ia64/itanium2";
|
|
||||||
default:
|
|
||||||
return "ia64/ia64";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* all the ops are handled via userspace for IA64 perfmon */
|
|
||||||
|
|
||||||
static int using_perfmon;
|
|
||||||
|
|
||||||
int perfmon_init(struct oprofile_operations *ops)
|
|
||||||
{
|
|
||||||
int ret = pfm_register_buffer_fmt(&oprofile_fmt);
|
|
||||||
if (ret)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
ops->cpu_type = get_cpu_type();
|
|
||||||
ops->start = perfmon_start;
|
|
||||||
ops->stop = perfmon_stop;
|
|
||||||
using_perfmon = 1;
|
|
||||||
printk(KERN_INFO "oprofile: using perfmon.\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void perfmon_exit(void)
|
|
||||||
{
|
|
||||||
if (!using_perfmon)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pfm_unregister_buffer_fmt(oprofile_fmt.fmt_uuid);
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user