|
Packit |
577717 |
--- linux-2.6.10.perfctr26/CREDITS.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/CREDITS 2008-06-22 20:57:42.000000000 +0200
|
|
Packit |
577717 |
@@ -2589,9 +2589,10 @@ S: Ottawa, Ontario
|
|
Packit |
577717 |
S: Canada K2P 0X8
|
|
Packit |
577717 |
|
|
Packit |
577717 |
N: Mikael Pettersson
|
|
Packit |
577717 |
-E: mikpe@csd.uu.se
|
|
Packit |
577717 |
-W: http://www.csd.uu.se/~mikpe/
|
|
Packit |
577717 |
+E: mikpe@it.uu.se
|
|
Packit |
577717 |
+W: http://user.it.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 |
--- linux-2.6.10.perfctr26/Documentation/ioctl-number.txt.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/Documentation/ioctl-number.txt 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -188,6 +188,8 @@ Code Seq# Include File Comments
|
|
Packit |
577717 |
0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
|
|
Packit |
577717 |
0xCB 00-1F CBM serial IEC bus in development:
|
|
Packit |
577717 |
<mailto:michael.klein@puffin.lb.shuttle.de>
|
|
Packit |
577717 |
+0xD0 all performance counters see drivers/perfctr/
|
|
Packit |
577717 |
+ <mailto:mikpe@csd.uu.se>
|
|
Packit |
577717 |
0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
|
|
Packit |
577717 |
<mailto:aherrman@de.ibm.com>
|
|
Packit |
577717 |
0xF3 00-3F video/sisfb.h sisfb (in development)
|
|
Packit |
577717 |
--- linux-2.6.10.perfctr26/MAINTAINERS.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/MAINTAINERS 2008-06-22 20:57:42.000000000 +0200
|
|
Packit |
577717 |
@@ -1731,6 +1731,12 @@ M: tsbogend@alpha.franken.de
|
|
Packit |
577717 |
L: linux-net@vger.kernel.org
|
|
Packit |
577717 |
S: Maintained
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+PERFORMANCE-MONITORING COUNTERS DRIVER
|
|
Packit |
577717 |
+P: Mikael Pettersson
|
|
Packit |
577717 |
+M: mikpe@it.uu.se
|
|
Packit |
577717 |
+W: http://user.it.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 |
--- linux-2.6.10.perfctr26/arch/i386/Kconfig.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/i386/Kconfig 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -874,6 +874,8 @@ config REGPARM
|
|
Packit |
577717 |
generate incorrect output with certain kernel constructs when
|
|
Packit |
577717 |
-mregparm=3 is used.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
|
|
Packit |
577717 |
|
|
Packit |
577717 |
--- linux-2.6.10.perfctr26/arch/i386/kernel/entry.S.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/i386/kernel/entry.S 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -375,6 +375,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_KPERFCTR)
|
|
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 |
--- linux-2.6.10.perfctr26/arch/i386/kernel/i8259.c.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/i386/kernel/i8259.c 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -24,6 +24,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 <linux/irq.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -413,6 +414,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 |
--- linux-2.6.10.perfctr26/arch/i386/kernel/process.c.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/i386/kernel/process.c 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -32,6 +32,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 |
@@ -323,6 +324,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 |
@@ -384,6 +386,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 |
@@ -607,6 +611,8 @@ struct task_struct fastcall * __switch_t
|
|
Packit |
577717 |
if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
|
|
Packit |
577717 |
handle_io_bitmap(next, tss);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_resume_thread(next);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return prev_p;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
--- linux-2.6.10.perfctr26/arch/ppc/Kconfig.~1~ 2008-06-22 20:48:52.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/ppc/Kconfig 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -236,6 +236,8 @@ config NOT_COHERENT_CACHE
|
|
Packit |
577717 |
depends on 4xx || 8xx
|
|
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 |
--- linux-2.6.10.perfctr26/arch/ppc/kernel/head.S.~1~ 2008-06-22 20:17:14.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/ppc/kernel/head.S 2008-06-22 20:57:10.000000000 +0200
|
|
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 |
--- linux-2.6.10.perfctr26/arch/ppc/kernel/process.c.~1~ 2008-06-22 20:48:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/ppc/kernel/process.c 2008-06-22 20:57:10.000000000 +0200
|
|
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 |
@@ -374,6 +377,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 |
@@ -466,6 +470,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 |
--- linux-2.6.10.perfctr26/arch/x86_64/Kconfig.~1~ 2008-06-22 20:48:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/x86_64/Kconfig 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -338,6 +338,8 @@ config X86_MCE
|
|
Packit |
577717 |
machine check error logs. See
|
|
Packit |
577717 |
ftp://ftp.x86-64.org/pub/linux/tools/mcelog
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#
|
|
Packit |
577717 |
--- linux-2.6.10.perfctr26/arch/x86_64/kernel/entry.S.~1~ 2008-06-22 20:48:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/x86_64/kernel/entry.S 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -560,6 +560,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_KPERFCTR)
|
|
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 |
--- linux-2.6.10.perfctr26/arch/x86_64/kernel/i8259.c.~1~ 2008-06-22 20:48:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/x86_64/kernel/i8259.c 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -24,6 +24,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 |
#include <linux/irq.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -560,6 +561,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 |
--- linux-2.6.10.perfctr26/arch/x86_64/kernel/process.c.~1~ 2008-06-22 20:48:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/arch/x86_64/kernel/process.c 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -32,6 +32,7 @@
|
|
Packit |
577717 |
#include <linux/delay.h>
|
|
Packit |
577717 |
#include <linux/irq.h>
|
|
Packit |
577717 |
#include <linux/ptrace.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/version.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <asm/uaccess.h>
|
|
Packit |
577717 |
@@ -276,6 +277,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 |
@@ -378,6 +380,8 @@ int copy_thread(int nr, unsigned long cl
|
|
Packit |
577717 |
asm("movl %%es,%0" : "=m" (p->thread.es));
|
|
Packit |
577717 |
asm("movl %%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 |
@@ -527,6 +531,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 |
--- linux-2.6.10.perfctr26/drivers/Makefile.~1~ 2008-06-22 20:48:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/drivers/Makefile 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -59,4 +59,5 @@ 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_KPERFCTR) += perfctr/
|
|
Packit |
577717 |
obj-y += firmware/
|
|
Packit |
577717 |
--- linux-2.6.10.perfctr26/fs/exec.c.~1~ 2008-06-22 20:48:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/fs/exec.c 2008-06-22 20:57:42.000000000 +0200
|
|
Packit |
577717 |
@@ -47,6 +47,7 @@
|
|
Packit |
577717 |
#include <linux/security.h>
|
|
Packit |
577717 |
#include <linux/syscalls.h>
|
|
Packit |
577717 |
#include <linux/rmap.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <asm/uaccess.h>
|
|
Packit |
577717 |
#include <asm/mmu_context.h>
|
|
Packit |
577717 |
@@ -843,6 +844,7 @@ int flush_old_exec(struct linux_binprm *
|
|
Packit |
577717 |
tcomm[i] = '\0';
|
|
Packit |
577717 |
set_task_comm(current, tcomm);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_flush_thread(¤t->thread);
|
|
Packit |
577717 |
flush_thread();
|
|
Packit |
577717 |
|
|
Packit |
577717 |
if (bprm->e_uid != current->euid || bprm->e_gid != current->egid ||
|
|
Packit |
577717 |
--- linux-2.6.10.perfctr26/include/asm-i386/mach-default/irq_vectors.h.~1~ 2008-06-22 15:56:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-i386/mach-default/irq_vectors.h 2008-06-22 20:57:10.000000000 +0200
|
|
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 |
--- linux-2.6.10.perfctr26/include/asm-i386/mach-visws/irq_vectors.h.~1~ 2008-06-22 15:56:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-i386/mach-visws/irq_vectors.h 2008-06-22 20:57:10.000000000 +0200
|
|
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 |
--- linux-2.6.10.perfctr26/include/asm-i386/processor.h.~1~ 2008-06-22 20:48:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-i386/processor.h 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -436,6 +436,8 @@ struct thread_struct {
|
|
Packit |
577717 |
unsigned long *io_bitmap_ptr;
|
|
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 |
--- linux-2.6.10.perfctr26/include/asm-i386/system.h.~1~ 2008-06-22 20:48:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-i386/system.h 2008-06-22 20:57:10.000000000 +0200
|
|
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("pushfl\n\t" \
|
|
Packit |
577717 |
"pushl %%ebp\n\t" \
|
|
Packit |
577717 |
"movl %%esp,%0\n\t" /* save ESP */ \
|
|
Packit |
577717 |
--- linux-2.6.10.perfctr26/include/asm-ppc/processor.h.~1~ 2008-06-22 20:48:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-ppc/processor.h 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -126,6 +126,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 |
--- linux-2.6.10.perfctr26/include/asm-x86_64/hw_irq.h.~1~ 2008-06-22 20:48:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-x86_64/hw_irq.h 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -65,14 +65,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 |
--- linux-2.6.10.perfctr26/include/asm-x86_64/irq.h.~1~ 2008-06-22 19:39:46.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-x86_64/irq.h 2008-06-22 20:57:10.000000000 +0200
|
|
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 |
--- linux-2.6.10.perfctr26/include/asm-x86_64/processor.h.~1~ 2008-06-22 20:48:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-x86_64/processor.h 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -258,6 +258,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 |
--- linux-2.6.10.perfctr26/include/asm-x86_64/system.h.~1~ 2008-06-22 20:48:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/include/asm-x86_64/system.h 2008-06-22 20:57:10.000000000 +0200
|
|
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 |
--- linux-2.6.10.perfctr26/kernel/exit.c.~1~ 2008-06-22 20:48:55.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/kernel/exit.c 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -25,6 +25,7 @@
|
|
Packit |
577717 |
#include <linux/mount.h>
|
|
Packit |
577717 |
#include <linux/proc_fs.h>
|
|
Packit |
577717 |
#include <linux/mempolicy.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/syscalls.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <asm/uaccess.h>
|
|
Packit |
577717 |
@@ -91,6 +92,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 |
--- linux-2.6.10.perfctr26/kernel/sched.c.~1~ 2008-06-22 20:48:55.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/kernel/sched.c 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -40,6 +40,7 @@
|
|
Packit |
577717 |
#include <linux/rcupdate.h>
|
|
Packit |
577717 |
#include <linux/cpu.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 |
@@ -3751,6 +3752,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 |
--- linux-2.6.10.perfctr26/kernel/timer.c.~1~ 2008-06-22 20:48:55.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.10.perfctr26/kernel/timer.c 2008-06-22 20:57:10.000000000 +0200
|
|
Packit |
577717 |
@@ -31,6 +31,7 @@
|
|
Packit |
577717 |
#include <linux/time.h>
|
|
Packit |
577717 |
#include <linux/jiffies.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 |
@@ -850,6 +851,7 @@ static void update_one_process(struct ta
|
|
Packit |
577717 |
do_process_times(p, user, system);
|
|
Packit |
577717 |
do_it_virt(p, user);
|
|
Packit |
577717 |
do_it_prof(p);
|
|
Packit |
577717 |
+ perfctr_sample_thread(&p->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|