|
Packit |
577717 |
diff -rupN linux-2.6.14/CREDITS linux-2.6.14.perfctr27/CREDITS
|
|
Packit |
577717 |
--- linux-2.6.14/CREDITS 2005-10-28 11:24:05.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/CREDITS 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -2629,6 +2629,7 @@ N: Mikael Pettersson
|
|
Packit |
577717 |
E: mikpe@csd.uu.se
|
|
Packit |
577717 |
W: http://www.csd.uu.se/~mikpe/
|
|
Packit |
577717 |
D: Miscellaneous fixes
|
|
Packit |
577717 |
+D: Performance-monitoring counters driver
|
|
Packit |
577717 |
|
|
Packit |
577717 |
N: Reed H. Petty
|
|
Packit |
577717 |
E: rhp@draper.net
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/MAINTAINERS linux-2.6.14.perfctr27/MAINTAINERS
|
|
Packit |
577717 |
--- linux-2.6.14/MAINTAINERS 2005-10-28 11:24:05.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/MAINTAINERS 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -1923,6 +1923,12 @@ M: tsbogend@alpha.franken.de
|
|
Packit |
577717 |
L: netdev@vger.kernel.org
|
|
Packit |
577717 |
S: Maintained
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+PERFORMANCE-MONITORING COUNTERS DRIVER
|
|
Packit |
577717 |
+P: Mikael Pettersson
|
|
Packit |
577717 |
+M: mikpe@csd.uu.se
|
|
Packit |
577717 |
+W: http://www.csd.uu.se/~mikpe/linux/perfctr/
|
|
Packit |
577717 |
+S: Maintained
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
PHRAM MTD DRIVER
|
|
Packit |
577717 |
P: Jörn Engel
|
|
Packit |
577717 |
M: joern@wh.fh-wedel.de
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/i386/Kconfig linux-2.6.14.perfctr27/arch/i386/Kconfig
|
|
Packit |
577717 |
--- linux-2.6.14/arch/i386/Kconfig 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/i386/Kconfig 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -982,6 +982,9 @@ config CRASH_DUMP
|
|
Packit |
577717 |
depends on HIGHMEM
|
|
Packit |
577717 |
help
|
|
Packit |
577717 |
Generate crash dump after being started by kexec.
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/i386/kernel/entry.S linux-2.6.14.perfctr27/arch/i386/kernel/entry.S
|
|
Packit |
577717 |
--- linux-2.6.14/arch/i386/kernel/entry.S 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/i386/kernel/entry.S 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -430,6 +430,16 @@ ENTRY(name) \
|
|
Packit |
577717 |
/* The include is where all of the SMP etc. interrupts come from */
|
|
Packit |
577717 |
#include "entry_arch.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PERFCTR)
|
|
Packit |
577717 |
+ENTRY(perfctr_interrupt)
|
|
Packit |
577717 |
+ pushl $LOCAL_PERFCTR_VECTOR-256
|
|
Packit |
577717 |
+ SAVE_ALL
|
|
Packit |
577717 |
+ pushl %esp
|
|
Packit |
577717 |
+ call smp_perfctr_interrupt
|
|
Packit |
577717 |
+ addl $4, %esp
|
|
Packit |
577717 |
+ jmp ret_from_intr
|
|
Packit |
577717 |
+#endif
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
ENTRY(divide_error)
|
|
Packit |
577717 |
pushl $0 # no error code
|
|
Packit |
577717 |
pushl $do_divide_error
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/i386/kernel/i8259.c linux-2.6.14.perfctr27/arch/i386/kernel/i8259.c
|
|
Packit |
577717 |
--- linux-2.6.14/arch/i386/kernel/i8259.c 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/i386/kernel/i8259.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -23,6 +23,7 @@
|
|
Packit |
577717 |
#include <asm/apic.h>
|
|
Packit |
577717 |
#include <asm/arch_hooks.h>
|
|
Packit |
577717 |
#include <asm/i8259.h>
|
|
Packit |
577717 |
+#include <asm/perfctr.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <io_ports.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -421,6 +422,8 @@ void __init init_IRQ(void)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
intr_init_hook();
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_vector_init();
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Set the clock to HZ Hz, we already have a valid
|
|
Packit |
577717 |
* vector now:
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/i386/kernel/process.c linux-2.6.14.perfctr27/arch/i386/kernel/process.c
|
|
Packit |
577717 |
--- linux-2.6.14/arch/i386/kernel/process.c 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/i386/kernel/process.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -33,6 +33,7 @@
|
|
Packit |
577717 |
#include <linux/delay.h>
|
|
Packit |
577717 |
#include <linux/reboot.h>
|
|
Packit |
577717 |
#include <linux/init.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/mc146818rtc.h>
|
|
Packit |
577717 |
#include <linux/module.h>
|
|
Packit |
577717 |
#include <linux/kallsyms.h>
|
|
Packit |
577717 |
@@ -393,6 +394,7 @@ void exit_thread(void)
|
|
Packit |
577717 |
tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET;
|
|
Packit |
577717 |
put_cpu();
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
+ perfctr_exit_thread(&tsk->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void flush_thread(void)
|
|
Packit |
577717 |
@@ -472,6 +474,8 @@ int copy_thread(int nr, unsigned long cl
|
|
Packit |
577717 |
savesegment(fs,p->thread.fs);
|
|
Packit |
577717 |
savesegment(gs,p->thread.gs);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_copy_task(p, regs);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
tsk = current;
|
|
Packit |
577717 |
if (unlikely(NULL != tsk->thread.io_bitmap_ptr)) {
|
|
Packit |
577717 |
p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
|
|
Packit |
577717 |
@@ -733,6 +737,7 @@ struct task_struct fastcall * __switch_t
|
|
Packit |
577717 |
|
|
Packit |
577717 |
disable_tsc(prev_p, next_p);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_resume_thread(next);
|
|
Packit |
577717 |
return prev_p;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/i386/kernel/syscall_table.S linux-2.6.14.perfctr27/arch/i386/kernel/syscall_table.S
|
|
Packit |
577717 |
--- linux-2.6.14/arch/i386/kernel/syscall_table.S 2005-08-29 14:34:27.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/i386/kernel/syscall_table.S 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -294,3 +294,9 @@ ENTRY(sys_call_table)
|
|
Packit |
577717 |
.long sys_inotify_init
|
|
Packit |
577717 |
.long sys_inotify_add_watch
|
|
Packit |
577717 |
.long sys_inotify_rm_watch
|
|
Packit |
577717 |
+ .long sys_ni_syscall
|
|
Packit |
577717 |
+ .long sys_ni_syscall /* 295 */
|
|
Packit |
577717 |
+ .long sys_vperfctr_open
|
|
Packit |
577717 |
+ .long sys_vperfctr_control
|
|
Packit |
577717 |
+ .long sys_vperfctr_write
|
|
Packit |
577717 |
+ .long sys_vperfctr_read
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/ppc/Kconfig linux-2.6.14.perfctr27/arch/ppc/Kconfig
|
|
Packit |
577717 |
--- linux-2.6.14/arch/ppc/Kconfig 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/ppc/Kconfig 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -288,6 +288,8 @@ config NOT_COHERENT_CACHE
|
|
Packit |
577717 |
depends on 4xx || 8xx || E200
|
|
Packit |
577717 |
default y
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
|
|
Packit |
577717 |
menu "Platform options"
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/ppc/kernel/head.S linux-2.6.14.perfctr27/arch/ppc/kernel/head.S
|
|
Packit |
577717 |
--- linux-2.6.14/arch/ppc/kernel/head.S 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/ppc/kernel/head.S 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -502,7 +502,11 @@ SystemCall:
|
|
Packit |
577717 |
Trap_0f:
|
|
Packit |
577717 |
EXCEPTION_PROLOG
|
|
Packit |
577717 |
addi r3,r1,STACK_FRAME_OVERHEAD
|
|
Packit |
577717 |
+#ifdef CONFIG_PERFCTR_INTERRUPT_SUPPORT
|
|
Packit |
577717 |
+ EXC_XFER_EE(0xf00, do_perfctr_interrupt)
|
|
Packit |
577717 |
+#else
|
|
Packit |
577717 |
EXC_XFER_EE(0xf00, UnknownException)
|
|
Packit |
577717 |
+#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Handle TLB miss for instruction on 603/603e.
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/ppc/kernel/misc.S linux-2.6.14.perfctr27/arch/ppc/kernel/misc.S
|
|
Packit |
577717 |
--- linux-2.6.14/arch/ppc/kernel/misc.S 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/ppc/kernel/misc.S 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -1455,3 +1455,9 @@ _GLOBAL(sys_call_table)
|
|
Packit |
577717 |
.long sys_inotify_init /* 275 */
|
|
Packit |
577717 |
.long sys_inotify_add_watch
|
|
Packit |
577717 |
.long sys_inotify_rm_watch
|
|
Packit |
577717 |
+ .long sys_ni_syscall
|
|
Packit |
577717 |
+ .long sys_ni_syscall
|
|
Packit |
577717 |
+ .long sys_vperfctr_open /* 280 */
|
|
Packit |
577717 |
+ .long sys_vperfctr_control
|
|
Packit |
577717 |
+ .long sys_vperfctr_write
|
|
Packit |
577717 |
+ .long sys_vperfctr_read
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/ppc/kernel/process.c linux-2.6.14.perfctr27/arch/ppc/kernel/process.c
|
|
Packit |
577717 |
--- linux-2.6.14/arch/ppc/kernel/process.c 2005-03-02 19:24:14.000000000 +0100
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/ppc/kernel/process.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -35,6 +35,7 @@
|
|
Packit |
577717 |
#include <linux/init_task.h>
|
|
Packit |
577717 |
#include <linux/module.h>
|
|
Packit |
577717 |
#include <linux/kallsyms.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/mqueue.h>
|
|
Packit |
577717 |
#include <linux/hardirq.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -301,7 +302,9 @@ struct task_struct *__switch_to(struct t
|
|
Packit |
577717 |
#endif /* CONFIG_SPE */
|
|
Packit |
577717 |
new_thread = &new->thread;
|
|
Packit |
577717 |
old_thread = ¤t->thread;
|
|
Packit |
577717 |
+ perfctr_suspend_thread(&prev->thread);
|
|
Packit |
577717 |
last = _switch(old_thread, new_thread);
|
|
Packit |
577717 |
+ perfctr_resume_thread(¤t->thread);
|
|
Packit |
577717 |
local_irq_restore(s);
|
|
Packit |
577717 |
return last;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
@@ -363,6 +366,7 @@ void exit_thread(void)
|
|
Packit |
577717 |
if (last_task_used_spe == current)
|
|
Packit |
577717 |
last_task_used_spe = NULL;
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
+ perfctr_exit_thread(¤t->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void flush_thread(void)
|
|
Packit |
577717 |
@@ -455,6 +459,8 @@ copy_thread(int nr, unsigned long clone_
|
|
Packit |
577717 |
|
|
Packit |
577717 |
p->thread.last_syscall = -1;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_copy_task(p, regs);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return 0;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/ppc64/Kconfig linux-2.6.14.perfctr27/arch/ppc64/Kconfig
|
|
Packit |
577717 |
--- linux-2.6.14/arch/ppc64/Kconfig 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/ppc64/Kconfig 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -377,6 +377,8 @@ config CMDLINE
|
|
Packit |
577717 |
some command-line options at build time by entering them here. In
|
|
Packit |
577717 |
most cases you will need to specify the root device here.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
|
|
Packit |
577717 |
config ISA_DMA_API
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/ppc64/kernel/misc.S linux-2.6.14.perfctr27/arch/ppc64/kernel/misc.S
|
|
Packit |
577717 |
--- linux-2.6.14/arch/ppc64/kernel/misc.S 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/ppc64/kernel/misc.S 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -1230,6 +1230,12 @@ _GLOBAL(sys_call_table32)
|
|
Packit |
577717 |
.llong .sys_inotify_init /* 275 */
|
|
Packit |
577717 |
.llong .sys_inotify_add_watch
|
|
Packit |
577717 |
.llong .sys_inotify_rm_watch
|
|
Packit |
577717 |
+ .llong .sys_ni_syscall
|
|
Packit |
577717 |
+ .llong .sys_ni_syscall
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_open /* 280 */
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_control
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_write
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_read
|
|
Packit |
577717 |
|
|
Packit |
577717 |
.balign 8
|
|
Packit |
577717 |
_GLOBAL(sys_call_table)
|
|
Packit |
577717 |
@@ -1511,3 +1517,9 @@ _GLOBAL(sys_call_table)
|
|
Packit |
577717 |
.llong .sys_inotify_init /* 275 */
|
|
Packit |
577717 |
.llong .sys_inotify_add_watch
|
|
Packit |
577717 |
.llong .sys_inotify_rm_watch
|
|
Packit |
577717 |
+ .llong .sys_ni_syscall
|
|
Packit |
577717 |
+ .llong .sys_ni_syscall
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_open /* 280 */
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_control
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_write
|
|
Packit |
577717 |
+ .llong .sys_vperfctr_read
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/ppc64/kernel/process.c linux-2.6.14.perfctr27/arch/ppc64/kernel/process.c
|
|
Packit |
577717 |
--- linux-2.6.14/arch/ppc64/kernel/process.c 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/ppc64/kernel/process.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -37,6 +37,7 @@
|
|
Packit |
577717 |
#include <linux/interrupt.h>
|
|
Packit |
577717 |
#include <linux/utsname.h>
|
|
Packit |
577717 |
#include <linux/kprobes.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <asm/pgtable.h>
|
|
Packit |
577717 |
#include <asm/uaccess.h>
|
|
Packit |
577717 |
@@ -245,7 +246,9 @@ struct task_struct *__switch_to(struct t
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
local_irq_save(flags);
|
|
Packit |
577717 |
+ perfctr_suspend_thread(&prev->thread);
|
|
Packit |
577717 |
last = _switch(old_thread, new_thread);
|
|
Packit |
577717 |
+ perfctr_resume_thread(¤t->thread);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
local_irq_restore(flags);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -345,6 +348,7 @@ void exit_thread(void)
|
|
Packit |
577717 |
last_task_used_altivec = NULL;
|
|
Packit |
577717 |
#endif /* CONFIG_ALTIVEC */
|
|
Packit |
577717 |
#endif /* CONFIG_SMP */
|
|
Packit |
577717 |
+ perfctr_exit_thread(¤t->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void flush_thread(void)
|
|
Packit |
577717 |
@@ -450,6 +454,8 @@ copy_thread(int nr, unsigned long clone_
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
kregs->nip = *((unsigned long *)ret_from_fork);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_copy_task(p, regs);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return 0;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/x86_64/Kconfig linux-2.6.14.perfctr27/arch/x86_64/Kconfig
|
|
Packit |
577717 |
--- linux-2.6.14/arch/x86_64/Kconfig 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/x86_64/Kconfig 2005-11-08 01:40:55.000000000 +0100
|
|
Packit |
577717 |
@@ -421,6 +421,8 @@ config SECCOMP
|
|
Packit |
577717 |
|
|
Packit |
577717 |
source kernel/Kconfig.hz
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/x86_64/ia32/ia32entry.S linux-2.6.14.perfctr27/arch/x86_64/ia32/ia32entry.S
|
|
Packit |
577717 |
--- linux-2.6.14/arch/x86_64/ia32/ia32entry.S 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/x86_64/ia32/ia32entry.S 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -643,6 +643,12 @@ ia32_sys_call_table:
|
|
Packit |
577717 |
.quad sys_inotify_init
|
|
Packit |
577717 |
.quad sys_inotify_add_watch
|
|
Packit |
577717 |
.quad sys_inotify_rm_watch
|
|
Packit |
577717 |
+ .quad quiet_ni_syscall /* pselect6 */
|
|
Packit |
577717 |
+ .quad quiet_ni_syscall /* ppoll 295 */
|
|
Packit |
577717 |
+ .quad sys_vperfctr_open
|
|
Packit |
577717 |
+ .quad sys_vperfctr_control
|
|
Packit |
577717 |
+ .quad sys_vperfctr_write
|
|
Packit |
577717 |
+ .quad sys_vperfctr_read
|
|
Packit |
577717 |
ia32_syscall_end:
|
|
Packit |
577717 |
.rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
|
|
Packit |
577717 |
.quad ni_syscall
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/x86_64/kernel/entry.S linux-2.6.14.perfctr27/arch/x86_64/kernel/entry.S
|
|
Packit |
577717 |
--- linux-2.6.14/arch/x86_64/kernel/entry.S 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/x86_64/kernel/entry.S 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -645,6 +645,11 @@ ENTRY(spurious_interrupt)
|
|
Packit |
577717 |
apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PERFCTR)
|
|
Packit |
577717 |
+ENTRY(perfctr_interrupt)
|
|
Packit |
577717 |
+ apicinterrupt LOCAL_PERFCTR_VECTOR,smp_perfctr_interrupt
|
|
Packit |
577717 |
+#endif
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Exception entry points.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/x86_64/kernel/i8259.c linux-2.6.14.perfctr27/arch/x86_64/kernel/i8259.c
|
|
Packit |
577717 |
--- linux-2.6.14/arch/x86_64/kernel/i8259.c 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/x86_64/kernel/i8259.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -23,6 +23,7 @@
|
|
Packit |
577717 |
#include <asm/delay.h>
|
|
Packit |
577717 |
#include <asm/desc.h>
|
|
Packit |
577717 |
#include <asm/apic.h>
|
|
Packit |
577717 |
+#include <asm/perfctr.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Common place to define all x86 IRQ vectors
|
|
Packit |
577717 |
@@ -590,6 +591,8 @@ void __init init_IRQ(void)
|
|
Packit |
577717 |
set_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_vector_init();
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Set the clock to HZ Hz, we already have a valid
|
|
Packit |
577717 |
* vector now:
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/arch/x86_64/kernel/process.c linux-2.6.14.perfctr27/arch/x86_64/kernel/process.c
|
|
Packit |
577717 |
--- linux-2.6.14/arch/x86_64/kernel/process.c 2005-10-28 11:24:06.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/arch/x86_64/kernel/process.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -34,6 +34,7 @@
|
|
Packit |
577717 |
#include <linux/delay.h>
|
|
Packit |
577717 |
#include <linux/ptrace.h>
|
|
Packit |
577717 |
#include <linux/utsname.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/random.h>
|
|
Packit |
577717 |
#include <linux/kprobes.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -345,6 +346,7 @@ void exit_thread(void)
|
|
Packit |
577717 |
t->io_bitmap_max = 0;
|
|
Packit |
577717 |
put_cpu();
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
+ perfctr_exit_thread(&me->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void flush_thread(void)
|
|
Packit |
577717 |
@@ -454,6 +456,8 @@ int copy_thread(int nr, unsigned long cl
|
|
Packit |
577717 |
asm("mov %%es,%0" : "=m" (p->thread.es));
|
|
Packit |
577717 |
asm("mov %%ds,%0" : "=m" (p->thread.ds));
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_copy_task(p, regs);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
if (unlikely(me->thread.io_bitmap_ptr != NULL)) {
|
|
Packit |
577717 |
p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
|
|
Packit |
577717 |
if (!p->thread.io_bitmap_ptr) {
|
|
Packit |
577717 |
@@ -603,6 +607,8 @@ struct task_struct *__switch_to(struct t
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_resume_thread(next);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return prev_p;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/drivers/Makefile linux-2.6.14.perfctr27/drivers/Makefile
|
|
Packit |
577717 |
--- linux-2.6.14/drivers/Makefile 2005-10-28 11:24:07.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/drivers/Makefile 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -63,6 +63,7 @@ obj-$(CONFIG_MCA) += mca/
|
|
Packit |
577717 |
obj-$(CONFIG_EISA) += eisa/
|
|
Packit |
577717 |
obj-$(CONFIG_CPU_FREQ) += cpufreq/
|
|
Packit |
577717 |
obj-$(CONFIG_MMC) += mmc/
|
|
Packit |
577717 |
+obj-$(CONFIG_PERFCTR) += perfctr/
|
|
Packit |
577717 |
obj-$(CONFIG_INFINIBAND) += infiniband/
|
|
Packit |
577717 |
obj-$(CONFIG_SGI_IOC4) += sn/
|
|
Packit |
577717 |
obj-y += firmware/
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-i386/mach-default/irq_vectors.h linux-2.6.14.perfctr27/include/asm-i386/mach-default/irq_vectors.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-i386/mach-default/irq_vectors.h 2004-05-10 11:14:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-i386/mach-default/irq_vectors.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -56,14 +56,15 @@
|
|
Packit |
577717 |
* sources per level' errata.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define LOCAL_TIMER_VECTOR 0xef
|
|
Packit |
577717 |
+#define LOCAL_PERFCTR_VECTOR 0xee
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
- * First APIC vector available to drivers: (vectors 0x30-0xee)
|
|
Packit |
577717 |
+ * First APIC vector available to drivers: (vectors 0x30-0xed)
|
|
Packit |
577717 |
* we start at 0x31 to spread out vectors evenly between priority
|
|
Packit |
577717 |
* levels. (0x80 is the syscall vector)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define FIRST_DEVICE_VECTOR 0x31
|
|
Packit |
577717 |
-#define FIRST_SYSTEM_VECTOR 0xef
|
|
Packit |
577717 |
+#define FIRST_SYSTEM_VECTOR 0xee
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define TIMER_IRQ 0
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-i386/mach-visws/irq_vectors.h linux-2.6.14.perfctr27/include/asm-i386/mach-visws/irq_vectors.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-i386/mach-visws/irq_vectors.h 2004-01-09 13:19:11.000000000 +0100
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-i386/mach-visws/irq_vectors.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -35,14 +35,15 @@
|
|
Packit |
577717 |
* sources per level' errata.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define LOCAL_TIMER_VECTOR 0xef
|
|
Packit |
577717 |
+#define LOCAL_PERFCTR_VECTOR 0xee
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
- * First APIC vector available to drivers: (vectors 0x30-0xee)
|
|
Packit |
577717 |
+ * First APIC vector available to drivers: (vectors 0x30-0xed)
|
|
Packit |
577717 |
* we start at 0x31 to spread out vectors evenly between priority
|
|
Packit |
577717 |
* levels. (0x80 is the syscall vector)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define FIRST_DEVICE_VECTOR 0x31
|
|
Packit |
577717 |
-#define FIRST_SYSTEM_VECTOR 0xef
|
|
Packit |
577717 |
+#define FIRST_SYSTEM_VECTOR 0xee
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define TIMER_IRQ 0
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-i386/processor.h linux-2.6.14.perfctr27/include/asm-i386/processor.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-i386/processor.h 2005-10-28 11:24:11.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-i386/processor.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -458,6 +458,8 @@ struct thread_struct {
|
|
Packit |
577717 |
unsigned long iopl;
|
|
Packit |
577717 |
/* max allowed port in the bitmap, in bytes: */
|
|
Packit |
577717 |
unsigned long io_bitmap_max;
|
|
Packit |
577717 |
+/* performance counters */
|
|
Packit |
577717 |
+ struct vperfctr *perfctr;
|
|
Packit |
577717 |
};
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define INIT_THREAD { \
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-i386/system.h linux-2.6.14.perfctr27/include/asm-i386/system.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-i386/system.h 2005-10-28 11:24:11.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-i386/system.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -14,6 +14,7 @@ extern struct task_struct * FASTCALL(__s
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define switch_to(prev,next,last) do { \
|
|
Packit |
577717 |
unsigned long esi,edi; \
|
|
Packit |
577717 |
+ perfctr_suspend_thread(&(prev)->thread); \
|
|
Packit |
577717 |
asm volatile("pushl %%ebp\n\t" \
|
|
Packit |
577717 |
"movl %%esp,%0\n\t" /* save ESP */ \
|
|
Packit |
577717 |
"movl %5,%%esp\n\t" /* restore ESP */ \
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-i386/unistd.h linux-2.6.14.perfctr27/include/asm-i386/unistd.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-i386/unistd.h 2005-10-28 11:24:11.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-i386/unistd.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -299,8 +299,12 @@
|
|
Packit |
577717 |
#define __NR_inotify_init 291
|
|
Packit |
577717 |
#define __NR_inotify_add_watch 292
|
|
Packit |
577717 |
#define __NR_inotify_rm_watch 293
|
|
Packit |
577717 |
+#define __NR_vperfctr_open 296
|
|
Packit |
577717 |
+#define __NR_vperfctr_control (__NR_vperfctr_open+1)
|
|
Packit |
577717 |
+#define __NR_vperfctr_write (__NR_vperfctr_open+2)
|
|
Packit |
577717 |
+#define __NR_vperfctr_read (__NR_vperfctr_open+3)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
-#define NR_syscalls 294
|
|
Packit |
577717 |
+#define NR_syscalls 300
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* user-visible error numbers are in the range -1 - -128: see
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-ppc/processor.h linux-2.6.14.perfctr27/include/asm-ppc/processor.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-ppc/processor.h 2005-03-02 19:24:19.000000000 +0100
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-ppc/processor.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -122,6 +122,9 @@ struct thread_struct {
|
|
Packit |
577717 |
unsigned long spefscr; /* SPE & eFP status */
|
|
Packit |
577717 |
int used_spe; /* set if process has used spe */
|
|
Packit |
577717 |
#endif /* CONFIG_SPE */
|
|
Packit |
577717 |
+#ifdef CONFIG_PERFCTR_VIRTUAL
|
|
Packit |
577717 |
+ struct vperfctr *perfctr; /* performance counters */
|
|
Packit |
577717 |
+#endif
|
|
Packit |
577717 |
};
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define ARCH_MIN_TASKALIGN 16
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-ppc/reg.h linux-2.6.14.perfctr27/include/asm-ppc/reg.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-ppc/reg.h 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-ppc/reg.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -275,22 +275,14 @@
|
|
Packit |
577717 |
#define SPRN_LDSTCR 0x3f8 /* Load/Store control register */
|
|
Packit |
577717 |
#define SPRN_LDSTDB 0x3f4 /* */
|
|
Packit |
577717 |
#define SPRN_LR 0x008 /* Link Register */
|
|
Packit |
577717 |
-#define SPRN_MMCR0 0x3B8 /* Monitor Mode Control Register 0 */
|
|
Packit |
577717 |
-#define SPRN_MMCR1 0x3BC /* Monitor Mode Control Register 1 */
|
|
Packit |
577717 |
#ifndef SPRN_PIR
|
|
Packit |
577717 |
#define SPRN_PIR 0x3FF /* Processor Identification Register */
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
-#define SPRN_PMC1 0x3B9 /* Performance Counter Register 1 */
|
|
Packit |
577717 |
-#define SPRN_PMC2 0x3BA /* Performance Counter Register 2 */
|
|
Packit |
577717 |
-#define SPRN_PMC3 0x3BD /* Performance Counter Register 3 */
|
|
Packit |
577717 |
-#define SPRN_PMC4 0x3BE /* Performance Counter Register 4 */
|
|
Packit |
577717 |
#define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */
|
|
Packit |
577717 |
#define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */
|
|
Packit |
577717 |
#define SPRN_PVR 0x11F /* Processor Version Register */
|
|
Packit |
577717 |
#define SPRN_RPA 0x3D6 /* Required Physical Address Register */
|
|
Packit |
577717 |
-#define SPRN_SDA 0x3BF /* Sampled Data Address Register */
|
|
Packit |
577717 |
#define SPRN_SDR1 0x019 /* MMU Hash Base Register */
|
|
Packit |
577717 |
-#define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */
|
|
Packit |
577717 |
#define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */
|
|
Packit |
577717 |
#define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */
|
|
Packit |
577717 |
#define SPRN_SPRG2 0x112 /* Special Purpose Register General 2 */
|
|
Packit |
577717 |
@@ -317,16 +309,79 @@
|
|
Packit |
577717 |
#define SPRN_THRM3 0x3FE /* Thermal Management Register 3 */
|
|
Packit |
577717 |
#define THRM3_E (1<<0)
|
|
Packit |
577717 |
#define SPRN_TLBMISS 0x3D4 /* 980 7450 TLB Miss Register */
|
|
Packit |
577717 |
-#define SPRN_UMMCR0 0x3A8 /* User Monitor Mode Control Register 0 */
|
|
Packit |
577717 |
-#define SPRN_UMMCR1 0x3AC /* User Monitor Mode Control Register 0 */
|
|
Packit |
577717 |
-#define SPRN_UPMC1 0x3A9 /* User Performance Counter Register 1 */
|
|
Packit |
577717 |
-#define SPRN_UPMC2 0x3AA /* User Performance Counter Register 2 */
|
|
Packit |
577717 |
-#define SPRN_UPMC3 0x3AD /* User Performance Counter Register 3 */
|
|
Packit |
577717 |
-#define SPRN_UPMC4 0x3AE /* User Performance Counter Register 4 */
|
|
Packit |
577717 |
-#define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */
|
|
Packit |
577717 |
#define SPRN_VRSAVE 0x100 /* Vector Register Save Register */
|
|
Packit |
577717 |
#define SPRN_XER 0x001 /* Fixed Point Exception Register */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+/* Performance-monitoring control and counter registers */
|
|
Packit |
577717 |
+#define SPRN_MMCR0 0x3B8 /* Monitor Mode Control Register 0 (604 and up) */
|
|
Packit |
577717 |
+#define SPRN_MMCR1 0x3BC /* Monitor Mode Control Register 1 (604e and up) */
|
|
Packit |
577717 |
+#define SPRN_MMCR2 0x3B0 /* Monitor Mode Control Register 2 (7400 and up) */
|
|
Packit |
577717 |
+#define SPRN_PMC1 0x3B9 /* Performance Counter Register 1 (604 and up) */
|
|
Packit |
577717 |
+#define SPRN_PMC2 0x3BA /* Performance Counter Register 2 (604 and up) */
|
|
Packit |
577717 |
+#define SPRN_PMC3 0x3BD /* Performance Counter Register 3 (604e and up) */
|
|
Packit |
577717 |
+#define SPRN_PMC4 0x3BE /* Performance Counter Register 4 (604e and up) */
|
|
Packit |
577717 |
+#define SPRN_PMC5 0x3B1 /* Performance Counter Register 5 (7450 and up) */
|
|
Packit |
577717 |
+#define SPRN_PMC6 0x3B2 /* Performance Counter Register 6 (7450 and up) */
|
|
Packit |
577717 |
+#define SPRN_SIA 0x3BB /* Sampled Instruction Address Register (604 and up) */
|
|
Packit |
577717 |
+#define SPRN_SDA 0x3BF /* Sampled Data Address Register (604/604e only) */
|
|
Packit |
577717 |
+#define SPRN_BAMR 0x3B7 /* Breakpoint Address Mask Register (7400 and up) */
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
+#define SPRN_UMMCR0 0x3A8 /* User Monitor Mode Control Register 0 (750 and up) */
|
|
Packit |
577717 |
+#define SPRN_UMMCR1 0x3AC /* User Monitor Mode Control Register 0 (750 and up) */
|
|
Packit |
577717 |
+#define SPRN_UMMCR2 0x3A0 /* User Monitor Mode Control Register 0 (7400 and up) */
|
|
Packit |
577717 |
+#define SPRN_UPMC1 0x3A9 /* User Performance Counter Register 1 (750 and up) */
|
|
Packit |
577717 |
+#define SPRN_UPMC2 0x3AA /* User Performance Counter Register 2 (750 and up) */
|
|
Packit |
577717 |
+#define SPRN_UPMC3 0x3AD /* User Performance Counter Register 3 (750 and up) */
|
|
Packit |
577717 |
+#define SPRN_UPMC4 0x3AE /* User Performance Counter Register 4 (750 and up) */
|
|
Packit |
577717 |
+#define SPRN_UPMC5 0x3A1 /* User Performance Counter Register 5 (7450 and up) */
|
|
Packit |
577717 |
+#define SPRN_UPMC6 0x3A2 /* User Performance Counter Register 5 (7450 and up) */
|
|
Packit |
577717 |
+#define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register (750 and up) */
|
|
Packit |
577717 |
+#define SPRN_UBAMR 0x3A7 /* User Breakpoint Address Mask Register (7400 and up) */
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
+/* MMCR0 layout (74xx terminology) */
|
|
Packit |
577717 |
+#define MMCR0_FC 0x80000000 /* Freeze counters unconditionally. */
|
|
Packit |
577717 |
+#define MMCR0_FCS 0x40000000 /* Freeze counters while MSR[PR]=0 (supervisor mode). */
|
|
Packit |
577717 |
+#define MMCR0_FCP 0x20000000 /* Freeze counters while MSR[PR]=1 (user mode). */
|
|
Packit |
577717 |
+#define MMCR0_FCM1 0x10000000 /* Freeze counters while MSR[PM]=1. */
|
|
Packit |
577717 |
+#define MMCR0_FCM0 0x08000000 /* Freeze counters while MSR[PM]=0. */
|
|
Packit |
577717 |
+#define MMCR0_PMXE 0x04000000 /* Enable performance monitor exceptions.
|
|
Packit |
577717 |
+ * Cleared by hardware when a PM exception occurs.
|
|
Packit |
577717 |
+ * 604: PMXE is not cleared by hardware.
|
|
Packit |
577717 |
+ */
|
|
Packit |
577717 |
+#define MMCR0_FCECE 0x02000000 /* Freeze counters on enabled condition or event.
|
|
Packit |
577717 |
+ * FCECE is treated as 0 if TRIGGER is 1.
|
|
Packit |
577717 |
+ * 74xx: FC is set when the event occurs.
|
|
Packit |
577717 |
+ * 604/750: ineffective when PMXE=0.
|
|
Packit |
577717 |
+ */
|
|
Packit |
577717 |
+#define MMCR0_TBSEL 0x01800000 /* Time base lower (TBL) bit selector.
|
|
Packit |
577717 |
+ * 00: bit 31, 01: bit 23, 10: bit 19, 11: bit 15.
|
|
Packit |
577717 |
+ */
|
|
Packit |
577717 |
+#define MMCR0_TBEE 0x00400000 /* Enable event on TBL bit transition from 0 to 1. */
|
|
Packit |
577717 |
+#define MMCR0_THRESHOLD 0x003F0000 /* Threshold value for certain events. */
|
|
Packit |
577717 |
+#define MMCR0_PMC1CE 0x00008000 /* Enable event on PMC1 overflow. */
|
|
Packit |
577717 |
+#define MMCR0_PMCjCE 0x00004000 /* Enable event on PMC2-PMC6 overflow.
|
|
Packit |
577717 |
+ * 604/750: Overrides FCECE (DISCOUNT).
|
|
Packit |
577717 |
+ */
|
|
Packit |
577717 |
+#define MMCR0_TRIGGER 0x00002000 /* Disable PMC2-PMC6 until PMC1 overflow or other event.
|
|
Packit |
577717 |
+ * 74xx: cleared by hardware when the event occurs.
|
|
Packit |
577717 |
+ */
|
|
Packit |
577717 |
+#define MMCR0_PMC1SEL 0x00001FB0 /* PMC1 event selector, 7 bits. */
|
|
Packit |
577717 |
+#define MMCR0_PMC2SEL 0x0000003F /* PMC2 event selector, 6 bits. */
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
+/* MMCR1 layout (604e-7457) */
|
|
Packit |
577717 |
+#define MMCR1_PMC3SEL 0xF8000000 /* PMC3 event selector, 5 bits. */
|
|
Packit |
577717 |
+#define MMCR1_PMC4SEL 0x07B00000 /* PMC4 event selector, 5 bits. */
|
|
Packit |
577717 |
+#define MMCR1_PMC5SEL 0x003E0000 /* PMC5 event selector, 5 bits. (745x only) */
|
|
Packit |
577717 |
+#define MMCR1_PMC6SEL 0x0001F800 /* PMC6 event selector, 6 bits. (745x only) */
|
|
Packit |
577717 |
+#define MMCR1__RESERVED 0x000007FF /* should be zero */
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
+/* MMCR2 layout (7400-7457) */
|
|
Packit |
577717 |
+#define MMCR2_THRESHMULT 0x80000000 /* MMCR0[THRESHOLD] multiplier. */
|
|
Packit |
577717 |
+#define MMCR2_SMCNTEN 0x40000000 /* 7400/7410 only, should be zero. */
|
|
Packit |
577717 |
+#define MMCR2_SMINTEN 0x20000000 /* 7400/7410 only, should be zero. */
|
|
Packit |
577717 |
+#define MMCR2__RESERVED 0x1FFFFFFF /* should be zero */
|
|
Packit |
577717 |
+#define MMCR2_RESERVED (MMCR2_SMCNTEN | MMCR2_SMINTEN | MMCR2__RESERVED)
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
/* Bit definitions for MMCR0 and PMC1 / PMC2. */
|
|
Packit |
577717 |
#define MMCR0_PMC1_CYCLES (1 << 7)
|
|
Packit |
577717 |
#define MMCR0_PMC1_ICACHEMISS (5 << 7)
|
|
Packit |
577717 |
@@ -335,7 +390,6 @@
|
|
Packit |
577717 |
#define MMCR0_PMC2_CYCLES 0x1
|
|
Packit |
577717 |
#define MMCR0_PMC2_ITLB 0x7
|
|
Packit |
577717 |
#define MMCR0_PMC2_LOADMISSTIME 0x5
|
|
Packit |
577717 |
-#define MMCR0_PMXE (1 << 26)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* Processor Version Register */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-ppc/unistd.h linux-2.6.14.perfctr27/include/asm-ppc/unistd.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-ppc/unistd.h 2005-08-29 14:34:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-ppc/unistd.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -282,8 +282,12 @@
|
|
Packit |
577717 |
#define __NR_inotify_init 275
|
|
Packit |
577717 |
#define __NR_inotify_add_watch 276
|
|
Packit |
577717 |
#define __NR_inotify_rm_watch 277
|
|
Packit |
577717 |
+#define __NR_vperfctr_open 280
|
|
Packit |
577717 |
+#define __NR_vperfctr_control (__NR_vperfctr_open+1)
|
|
Packit |
577717 |
+#define __NR_vperfctr_write (__NR_vperfctr_open+2)
|
|
Packit |
577717 |
+#define __NR_vperfctr_read (__NR_vperfctr_open+3)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
-#define __NR_syscalls 278
|
|
Packit |
577717 |
+#define __NR_syscalls 284
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define __NR(n) #n
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-ppc64/processor.h linux-2.6.14.perfctr27/include/asm-ppc64/processor.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-ppc64/processor.h 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-ppc64/processor.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -442,6 +442,8 @@ struct thread_struct {
|
|
Packit |
577717 |
unsigned long vrsave;
|
|
Packit |
577717 |
int used_vr; /* set if process has used altivec */
|
|
Packit |
577717 |
#endif /* CONFIG_ALTIVEC */
|
|
Packit |
577717 |
+ /* performance counters */
|
|
Packit |
577717 |
+ struct vperfctr *perfctr;
|
|
Packit |
577717 |
};
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define ARCH_MIN_TASKALIGN 16
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-ppc64/unistd.h linux-2.6.14.perfctr27/include/asm-ppc64/unistd.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-ppc64/unistd.h 2005-08-29 14:34:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-ppc64/unistd.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -288,8 +288,12 @@
|
|
Packit |
577717 |
#define __NR_inotify_init 275
|
|
Packit |
577717 |
#define __NR_inotify_add_watch 276
|
|
Packit |
577717 |
#define __NR_inotify_rm_watch 277
|
|
Packit |
577717 |
+#define __NR_vperfctr_open 280
|
|
Packit |
577717 |
+#define __NR_vperfctr_control (__NR_vperfctr_open+1)
|
|
Packit |
577717 |
+#define __NR_vperfctr_write (__NR_vperfctr_open+2)
|
|
Packit |
577717 |
+#define __NR_vperfctr_read (__NR_vperfctr_open+3)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
-#define __NR_syscalls 278
|
|
Packit |
577717 |
+#define __NR_syscalls 284
|
|
Packit |
577717 |
#ifdef __KERNEL__
|
|
Packit |
577717 |
#define NR_syscalls __NR_syscalls
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-x86_64/hw_irq.h linux-2.6.14.perfctr27/include/asm-x86_64/hw_irq.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-x86_64/hw_irq.h 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-x86_64/hw_irq.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -67,14 +67,15 @@ struct hw_interrupt_type;
|
|
Packit |
577717 |
* sources per level' errata.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define LOCAL_TIMER_VECTOR 0xef
|
|
Packit |
577717 |
+#define LOCAL_PERFCTR_VECTOR 0xee
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
- * First APIC vector available to drivers: (vectors 0x30-0xee)
|
|
Packit |
577717 |
+ * First APIC vector available to drivers: (vectors 0x30-0xed)
|
|
Packit |
577717 |
* we start at 0x31 to spread out vectors evenly between priority
|
|
Packit |
577717 |
* levels. (0x80 is the syscall vector)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define FIRST_DEVICE_VECTOR 0x31
|
|
Packit |
577717 |
-#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */
|
|
Packit |
577717 |
+#define FIRST_SYSTEM_VECTOR 0xee /* duplicated in irq.h */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#ifndef __ASSEMBLY__
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-x86_64/ia32_unistd.h linux-2.6.14.perfctr27/include/asm-x86_64/ia32_unistd.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-x86_64/ia32_unistd.h 2005-08-29 14:34:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-x86_64/ia32_unistd.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -299,7 +299,11 @@
|
|
Packit |
577717 |
#define __NR_ia32_inotify_init 291
|
|
Packit |
577717 |
#define __NR_ia32_inotify_add_watch 292
|
|
Packit |
577717 |
#define __NR_ia32_inotify_rm_watch 293
|
|
Packit |
577717 |
+#define __NR_ia32_vperfctr_open 296
|
|
Packit |
577717 |
+#define __NR_ia32_vperfctr_control (__NR_ia32_vperfctr_open+1)
|
|
Packit |
577717 |
+#define __NR_ia32_vperfctr_write (__NR_ia32_vperfctr_open+2)
|
|
Packit |
577717 |
+#define __NR_ia32_vperfctr_read (__NR_ia32_vperfctr_open+3)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
-#define IA32_NR_syscalls 294 /* must be > than biggest syscall! */
|
|
Packit |
577717 |
+#define IA32_NR_syscalls 300 /* must be > than biggest syscall! */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#endif /* _ASM_X86_64_IA32_UNISTD_H_ */
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-x86_64/irq.h linux-2.6.14.perfctr27/include/asm-x86_64/irq.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-x86_64/irq.h 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-x86_64/irq.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -29,7 +29,7 @@
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define NR_VECTORS 256
|
|
Packit |
577717 |
|
|
Packit |
577717 |
-#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in hw_irq.h */
|
|
Packit |
577717 |
+#define FIRST_SYSTEM_VECTOR 0xee /* duplicated in hw_irq.h */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#ifdef CONFIG_PCI_MSI
|
|
Packit |
577717 |
#define NR_IRQS FIRST_SYSTEM_VECTOR
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-x86_64/processor.h linux-2.6.14.perfctr27/include/asm-x86_64/processor.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-x86_64/processor.h 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-x86_64/processor.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -252,6 +252,8 @@ struct thread_struct {
|
|
Packit |
577717 |
unsigned io_bitmap_max;
|
|
Packit |
577717 |
/* cached TLS descriptors. */
|
|
Packit |
577717 |
u64 tls_array[GDT_ENTRY_TLS_ENTRIES];
|
|
Packit |
577717 |
+/* performance counters */
|
|
Packit |
577717 |
+ struct vperfctr *perfctr;
|
|
Packit |
577717 |
} __attribute__((aligned(16)));
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define INIT_THREAD { \
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-x86_64/system.h linux-2.6.14.perfctr27/include/asm-x86_64/system.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-x86_64/system.h 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-x86_64/system.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -26,7 +26,8 @@
|
|
Packit |
577717 |
#define __EXTRA_CLOBBER \
|
|
Packit |
577717 |
,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
-#define switch_to(prev,next,last) \
|
|
Packit |
577717 |
+#define switch_to(prev,next,last) do { \
|
|
Packit |
577717 |
+ perfctr_suspend_thread(&(prev)->thread); \
|
|
Packit |
577717 |
asm volatile(SAVE_CONTEXT \
|
|
Packit |
577717 |
"movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
|
|
Packit |
577717 |
"movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
|
|
Packit |
577717 |
@@ -46,7 +47,8 @@
|
|
Packit |
577717 |
[tif_fork] "i" (TIF_FORK), \
|
|
Packit |
577717 |
[thread_info] "i" (offsetof(struct task_struct, thread_info)), \
|
|
Packit |
577717 |
[pda_pcurrent] "i" (offsetof(struct x8664_pda, pcurrent)) \
|
|
Packit |
577717 |
- : "memory", "cc" __EXTRA_CLOBBER)
|
|
Packit |
577717 |
+ : "memory", "cc" __EXTRA_CLOBBER); \
|
|
Packit |
577717 |
+} while (0)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
extern void load_gs_index(unsigned);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/asm-x86_64/unistd.h linux-2.6.14.perfctr27/include/asm-x86_64/unistd.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/asm-x86_64/unistd.h 2005-08-29 14:34:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/asm-x86_64/unistd.h 2005-11-08 01:40:55.000000000 +0100
|
|
Packit |
577717 |
@@ -571,8 +571,18 @@ __SYSCALL(__NR_inotify_init, sys_inotify
|
|
Packit |
577717 |
__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
|
|
Packit |
577717 |
#define __NR_inotify_rm_watch 255
|
|
Packit |
577717 |
__SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
|
|
Packit |
577717 |
+#define __NR_migrate_pages 256
|
|
Packit |
577717 |
+__SYSCALL(__NR_migrate_pages, sys_ni_syscall)
|
|
Packit |
577717 |
+#define __NR_vperfctr_open 257
|
|
Packit |
577717 |
+__SYSCALL(__NR_vperfctr_open, sys_vperfctr_open)
|
|
Packit |
577717 |
+#define __NR_vperfctr_control (__NR_vperfctr_open+1)
|
|
Packit |
577717 |
+__SYSCALL(__NR_vperfctr_control, sys_vperfctr_control)
|
|
Packit |
577717 |
+#define __NR_vperfctr_write (__NR_vperfctr_open+2)
|
|
Packit |
577717 |
+__SYSCALL(__NR_vperfctr_write, sys_vperfctr_write)
|
|
Packit |
577717 |
+#define __NR_vperfctr_read (__NR_vperfctr_open+3)
|
|
Packit |
577717 |
+__SYSCALL(__NR_vperfctr_read, sys_vperfctr_read)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
-#define __NR_syscall_max __NR_inotify_rm_watch
|
|
Packit |
577717 |
+#define __NR_syscall_max __NR_vperfctr_read
|
|
Packit |
577717 |
#ifndef __NO_STUBS
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* user-visible error numbers are in the range -1 - -4095 */
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/include/linux/sched.h linux-2.6.14.perfctr27/include/linux/sched.h
|
|
Packit |
577717 |
--- linux-2.6.14/include/linux/sched.h 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/include/linux/sched.h 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -1168,6 +1168,9 @@ extern void unhash_process(struct task_s
|
|
Packit |
577717 |
* subscriptions and synchronises with wait4(). Also used in procfs. Also
|
|
Packit |
577717 |
* pins the final release of task.io_context.
|
|
Packit |
577717 |
*
|
|
Packit |
577717 |
+ * Synchronises set_cpus_allowed(), unlink, and creat of ->thread.perfctr.
|
|
Packit |
577717 |
+ * [if CONFIG_PERFCTR_VIRTUAL]
|
|
Packit |
577717 |
+ *
|
|
Packit |
577717 |
* Nests both inside and outside of read_lock(&tasklist_lock).
|
|
Packit |
577717 |
* It must not be nested with write_lock_irq(&tasklist_lock),
|
|
Packit |
577717 |
* neither inside nor outside.
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/kernel/exit.c linux-2.6.14.perfctr27/kernel/exit.c
|
|
Packit |
577717 |
--- linux-2.6.14/kernel/exit.c 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/kernel/exit.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -26,6 +26,7 @@
|
|
Packit |
577717 |
#include <linux/proc_fs.h>
|
|
Packit |
577717 |
#include <linux/mempolicy.h>
|
|
Packit |
577717 |
#include <linux/cpuset.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/syscalls.h>
|
|
Packit |
577717 |
#include <linux/signal.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -100,6 +101,7 @@ repeat:
|
|
Packit |
577717 |
zap_leader = (leader->exit_signal == -1);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_release_task(p);
|
|
Packit |
577717 |
sched_exit(p);
|
|
Packit |
577717 |
write_unlock_irq(&tasklist_lock);
|
|
Packit |
577717 |
spin_unlock(&p->proc_lock);
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/kernel/sched.c linux-2.6.14.perfctr27/kernel/sched.c
|
|
Packit |
577717 |
--- linux-2.6.14/kernel/sched.c 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/kernel/sched.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -42,6 +42,7 @@
|
|
Packit |
577717 |
#include <linux/cpu.h>
|
|
Packit |
577717 |
#include <linux/cpuset.h>
|
|
Packit |
577717 |
#include <linux/percpu.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/kthread.h>
|
|
Packit |
577717 |
#include <linux/seq_file.h>
|
|
Packit |
577717 |
#include <linux/syscalls.h>
|
|
Packit |
577717 |
@@ -4361,6 +4362,8 @@ int set_cpus_allowed(task_t *p, cpumask_
|
|
Packit |
577717 |
migration_req_t req;
|
|
Packit |
577717 |
runqueue_t *rq;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_set_cpus_allowed(p, new_mask);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
rq = task_rq_lock(p, &flags);
|
|
Packit |
577717 |
if (!cpus_intersects(new_mask, cpu_online_map)) {
|
|
Packit |
577717 |
ret = -EINVAL;
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/kernel/sys_ni.c linux-2.6.14.perfctr27/kernel/sys_ni.c
|
|
Packit |
577717 |
--- linux-2.6.14/kernel/sys_ni.c 2005-08-29 14:34:34.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/kernel/sys_ni.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -68,6 +68,10 @@ cond_syscall(compat_sys_mq_timedsend);
|
|
Packit |
577717 |
cond_syscall(compat_sys_mq_timedreceive);
|
|
Packit |
577717 |
cond_syscall(compat_sys_mq_notify);
|
|
Packit |
577717 |
cond_syscall(compat_sys_mq_getsetattr);
|
|
Packit |
577717 |
+cond_syscall(sys_vperfctr_open);
|
|
Packit |
577717 |
+cond_syscall(sys_vperfctr_control);
|
|
Packit |
577717 |
+cond_syscall(sys_vperfctr_write);
|
|
Packit |
577717 |
+cond_syscall(sys_vperfctr_read);
|
|
Packit |
577717 |
cond_syscall(sys_mbind);
|
|
Packit |
577717 |
cond_syscall(sys_get_mempolicy);
|
|
Packit |
577717 |
cond_syscall(sys_set_mempolicy);
|
|
Packit |
577717 |
diff -rupN linux-2.6.14/kernel/timer.c linux-2.6.14.perfctr27/kernel/timer.c
|
|
Packit |
577717 |
--- linux-2.6.14/kernel/timer.c 2005-10-28 11:24:12.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.14.perfctr27/kernel/timer.c 2005-11-08 01:40:51.000000000 +0100
|
|
Packit |
577717 |
@@ -32,6 +32,7 @@
|
|
Packit |
577717 |
#include <linux/jiffies.h>
|
|
Packit |
577717 |
#include <linux/posix-timers.h>
|
|
Packit |
577717 |
#include <linux/cpu.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/syscalls.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <asm/uaccess.h>
|
|
Packit |
577717 |
@@ -846,6 +847,7 @@ void update_process_times(int user_tick)
|
|
Packit |
577717 |
account_user_time(p, jiffies_to_cputime(1));
|
|
Packit |
577717 |
else
|
|
Packit |
577717 |
account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1));
|
|
Packit |
577717 |
+ perfctr_sample_thread(&p->thread);
|
|
Packit |
577717 |
run_local_timers();
|
|
Packit |
577717 |
if (rcu_pending(cpu))
|
|
Packit |
577717 |
rcu_check_callbacks(cpu, user_tick);
|