|
Packit |
577717 |
--- linux-2.6.13.perfctr26/CREDITS.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/CREDITS 2008-06-22 19:24:32.000000000 +0200
|
|
Packit |
577717 |
@@ -2624,9 +2624,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.13.perfctr26/Documentation/ioctl-number.txt.~1~ 2008-06-22 19:09:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/Documentation/ioctl-number.txt 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -190,6 +190,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.13.perfctr26/MAINTAINERS.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/MAINTAINERS 2008-06-22 19:24:32.000000000 +0200
|
|
Packit |
577717 |
@@ -1842,6 +1842,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@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.13.perfctr26/arch/i386/Kconfig.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/i386/Kconfig 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -941,6 +941,8 @@ config SECCOMP
|
|
Packit |
577717 |
|
|
Packit |
577717 |
If unsure, say Y. Only embedded should say N here.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
source kernel/Kconfig.hz
|
|
Packit |
577717 |
|
|
Packit |
577717 |
config PHYSICAL_START
|
|
Packit |
577717 |
--- linux-2.6.13.perfctr26/arch/i386/kernel/entry.S.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/i386/kernel/entry.S 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -427,6 +427,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.13.perfctr26/arch/i386/kernel/i8259.c.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/i386/kernel/i8259.c 2008-06-22 19:24:26.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 |
@@ -424,6 +425,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.13.perfctr26/arch/i386/kernel/process.c.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/i386/kernel/process.c 2008-06-22 19:24:26.000000000 +0200
|
|
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 |
@@ -399,6 +400,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 |
@@ -478,6 +480,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 |
@@ -728,6 +732,8 @@ 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 |
+
|
|
Packit |
577717 |
return prev_p;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
--- linux-2.6.13.perfctr26/arch/ppc/Kconfig.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/ppc/Kconfig 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -279,6 +279,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 |
--- linux-2.6.13.perfctr26/arch/ppc/kernel/head.S.~1~ 2008-06-22 19:21:37.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/ppc/kernel/head.S 2008-06-22 19:24:26.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.13.perfctr26/arch/ppc/kernel/process.c.~1~ 2008-06-22 19:09:53.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/ppc/kernel/process.c 2008-06-22 19:24:26.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 |
@@ -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 |
--- linux-2.6.13.perfctr26/arch/x86_64/Kconfig.~1~ 2008-06-22 19:21:38.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/x86_64/Kconfig 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -417,6 +417,8 @@ config SECCOMP
|
|
Packit |
577717 |
|
|
Packit |
577717 |
If unsure, say Y. Only embedded should say N here.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
source kernel/Kconfig.hz
|
|
Packit |
577717 |
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
--- linux-2.6.13.perfctr26/arch/x86_64/kernel/entry.S.~1~ 2008-06-22 19:21:38.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/x86_64/kernel/entry.S 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -554,6 +554,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.13.perfctr26/arch/x86_64/kernel/i8259.c.~1~ 2008-06-22 19:21:38.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/x86_64/kernel/i8259.c 2008-06-22 19:24:26.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 |
@@ -579,6 +580,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.13.perfctr26/arch/x86_64/kernel/process.c.~1~ 2008-06-22 19:21:38.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/arch/x86_64/kernel/process.c 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -34,6 +34,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/utsname.h>
|
|
Packit |
577717 |
#include <linux/random.h>
|
|
Packit |
577717 |
#include <linux/kprobes.h>
|
|
Packit |
577717 |
@@ -341,6 +342,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 |
@@ -450,6 +452,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 |
@@ -628,6 +632,8 @@ struct task_struct *__switch_to(struct t
|
|
Packit |
577717 |
|
|
Packit |
577717 |
disable_tsc(prev_p, next_p);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_resume_thread(next);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return prev_p;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
--- linux-2.6.13.perfctr26/drivers/Makefile.~1~ 2008-06-22 19:21:38.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/drivers/Makefile 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -63,5 +63,6 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq/
|
|
Packit |
577717 |
obj-$(CONFIG_MMC) += mmc/
|
|
Packit |
577717 |
obj-$(CONFIG_INFINIBAND) += infiniband/
|
|
Packit |
577717 |
obj-$(CONFIG_SGI_IOC4) += sn/
|
|
Packit |
577717 |
+obj-$(CONFIG_KPERFCTR) += perfctr/
|
|
Packit |
577717 |
obj-y += firmware/
|
|
Packit |
577717 |
obj-$(CONFIG_CRYPTO) += crypto/
|
|
Packit |
577717 |
--- linux-2.6.13.perfctr26/fs/exec.c.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/fs/exec.c 2008-06-22 19:24:32.000000000 +0200
|
|
Packit |
577717 |
@@ -48,6 +48,7 @@
|
|
Packit |
577717 |
#include <linux/syscalls.h>
|
|
Packit |
577717 |
#include <linux/rmap.h>
|
|
Packit |
577717 |
#include <linux/acct.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <asm/uaccess.h>
|
|
Packit |
577717 |
#include <asm/mmu_context.h>
|
|
Packit |
577717 |
@@ -896,6 +897,7 @@ int flush_old_exec(struct linux_binprm *
|
|
Packit |
577717 |
set_task_comm(current, tcomm);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
current->flags &= ~PF_RANDOMIZE;
|
|
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.13.perfctr26/include/asm-i386/mach-default/irq_vectors.h.~1~ 2008-06-22 15:56:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-i386/mach-default/irq_vectors.h 2008-06-22 19:24:26.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.13.perfctr26/include/asm-i386/mach-visws/irq_vectors.h.~1~ 2008-06-22 15:56:54.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-i386/mach-visws/irq_vectors.h 2008-06-22 19:24:26.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.13.perfctr26/include/asm-i386/processor.h.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-i386/processor.h 2008-06-22 19:24:26.000000000 +0200
|
|
Packit |
577717 |
@@ -456,6 +456,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.13.perfctr26/include/asm-i386/system.h.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-i386/system.h 2008-06-22 19:24:26.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.13.perfctr26/include/asm-ppc/processor.h.~1~ 2008-06-22 19:09:55.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-ppc/processor.h 2008-06-22 19:24:26.000000000 +0200
|
|
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 |
--- linux-2.6.13.perfctr26/include/asm-x86_64/hw_irq.h.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-x86_64/hw_irq.h 2008-06-22 19:24:26.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.13.perfctr26/include/asm-x86_64/irq.h.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-x86_64/irq.h 2008-06-22 19:24:26.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.13.perfctr26/include/asm-x86_64/processor.h.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-x86_64/processor.h 2008-06-22 19:24:26.000000000 +0200
|
|
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 |
--- linux-2.6.13.perfctr26/include/asm-x86_64/system.h.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/include/asm-x86_64/system.h 2008-06-22 19:24:26.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.13.perfctr26/kernel/exit.c.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/kernel/exit.c 2008-06-22 19:24:26.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/cpuset.h>
|
|
Packit |
577717 |
#include <linux/syscalls.h>
|
|
Packit |
577717 |
#include <linux/signal.h>
|
|
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 |
--- linux-2.6.13.perfctr26/kernel/sched.c.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/kernel/sched.c 2008-06-22 19:24:26.000000000 +0200
|
|
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 |
@@ -4252,6 +4253,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.13.perfctr26/kernel/timer.c.~1~ 2008-06-22 19:21:39.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.13.perfctr26/kernel/timer.c 2008-06-22 19:24:26.000000000 +0200
|
|
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);
|