|
Packit |
577717 |
--- linux-2.6.24.perfctr26/CREDITS.~1~ 2008-06-22 15:42:29.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/CREDITS 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -2710,6 +2710,7 @@ N: Mikael Pettersson
|
|
Packit |
577717 |
E: mikpe@it.uu.se
|
|
Packit |
577717 |
W: http://user.it.uu.se/~mikpe/linux/
|
|
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.24.perfctr26/Documentation/ioctl-number.txt.~1~ 2008-06-22 15:42:29.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/Documentation/ioctl-number.txt 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -187,6 +187,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@it.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.24.perfctr26/MAINTAINERS.~1~ 2008-06-22 15:42:29.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/MAINTAINERS 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -2980,6 +2980,12 @@ M: nagar@watson.ibm.com
|
|
Packit |
577717 |
L: linux-kernel@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 |
PERSONALITY HANDLING
|
|
Packit |
577717 |
P: Christoph Hellwig
|
|
Packit |
577717 |
M: hch@infradead.org
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/arm/Kconfig.~1~ 2008-06-22 15:42:29.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/arm/Kconfig 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -494,6 +494,10 @@ config IWMMXT
|
|
Packit |
577717 |
Enable support for iWMMXt context switching at run time if
|
|
Packit |
577717 |
running on a CPU that supports it.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+if CPU_XSCALE
|
|
Packit |
577717 |
+source drivers/perfctr/Kconfig
|
|
Packit |
577717 |
+endif
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
# bool 'Use XScale PMU as timer source' CONFIG_XSCALE_PMU_TIMER
|
|
Packit |
577717 |
config XSCALE_PMU
|
|
Packit |
577717 |
bool
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/arm/kernel/process.c.~1~ 2008-06-22 15:42:29.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/arm/kernel/process.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -27,6 +27,7 @@
|
|
Packit |
577717 |
#include <linux/cpu.h>
|
|
Packit |
577717 |
#include <linux/elfcore.h>
|
|
Packit |
577717 |
#include <linux/pm.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/tick.h>
|
|
Packit |
577717 |
#include <linux/utsname.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
@@ -304,6 +305,7 @@ void show_fpregs(struct user_fp *regs)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
void exit_thread(void)
|
|
Packit |
577717 |
{
|
|
Packit |
577717 |
+ perfctr_exit_thread(¤t->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
ATOMIC_NOTIFIER_HEAD(thread_notify_head);
|
|
Packit |
577717 |
@@ -349,6 +351,8 @@ copy_thread(int nr, unsigned long clone_
|
|
Packit |
577717 |
if (clone_flags & CLONE_SETTLS)
|
|
Packit |
577717 |
thread->tp_value = regs->ARM_r3;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_copy_task(p, regs);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return 0;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/powerpc/kernel/process.c.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/powerpc/kernel/process.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -30,6 +30,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 |
#include <linux/utsname.h>
|
|
Packit |
577717 |
@@ -353,7 +354,9 @@ struct task_struct *__switch_to(struct t
|
|
Packit |
577717 |
account_process_vtime(current);
|
|
Packit |
577717 |
calculate_steal_time();
|
|
Packit |
577717 |
|
|
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 |
@@ -491,6 +494,7 @@ void show_regs(struct pt_regs * regs)
|
|
Packit |
577717 |
void exit_thread(void)
|
|
Packit |
577717 |
{
|
|
Packit |
577717 |
discard_lazy_cpu_state();
|
|
Packit |
577717 |
+ perfctr_exit_thread(¤t->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void flush_thread(void)
|
|
Packit |
577717 |
@@ -610,6 +614,8 @@ int copy_thread(int nr, unsigned long cl
|
|
Packit |
577717 |
kregs->nip = (unsigned long)ret_from_fork;
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_copy_task(p, regs);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return 0;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/powerpc/platforms/Kconfig.cputype.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/powerpc/platforms/Kconfig.cputype 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -234,4 +234,8 @@ config NOT_COHERENT_CACHE
|
|
Packit |
577717 |
config CHECK_CACHE_COHERENCY
|
|
Packit |
577717 |
bool
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+if PPC32
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+endif
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
endmenu
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/x86/Kconfig.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/x86/Kconfig 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -1060,6 +1060,8 @@ config CC_STACKPROTECTOR_ALL
|
|
Packit |
577717 |
functions that use large-ish on-stack buffers. By enabling
|
|
Packit |
577717 |
this option, GCC will be asked to do this for ALL functions.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+source "drivers/perfctr/Kconfig"
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
source kernel/Kconfig.hz
|
|
Packit |
577717 |
|
|
Packit |
577717 |
config KEXEC
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/x86/kernel/entry_32.S.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/x86/kernel/entry_32.S 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -639,6 +639,23 @@ ENDPROC(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 |
+ RING0_INT_FRAME
|
|
Packit |
577717 |
+ pushl $~(LOCAL_PERFCTR_VECTOR)
|
|
Packit |
577717 |
+ CFI_ADJUST_CFA_OFFSET 4
|
|
Packit |
577717 |
+ SAVE_ALL
|
|
Packit |
577717 |
+ TRACE_IRQS_OFF
|
|
Packit |
577717 |
+ pushl %esp
|
|
Packit |
577717 |
+ CFI_ADJUST_CFA_OFFSET 4
|
|
Packit |
577717 |
+ call smp_perfctr_interrupt
|
|
Packit |
577717 |
+ addl $4, %esp
|
|
Packit |
577717 |
+ CFI_ADJUST_CFA_OFFSET -4
|
|
Packit |
577717 |
+ jmp ret_from_intr
|
|
Packit |
577717 |
+ CFI_ENDPROC
|
|
Packit |
577717 |
+ENDPROC(perfctr_interrupt)
|
|
Packit |
577717 |
+#endif
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
KPROBE_ENTRY(page_fault)
|
|
Packit |
577717 |
RING0_EC_FRAME
|
|
Packit |
577717 |
pushl $do_page_fault
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/x86/kernel/entry_64.S.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/x86/kernel/entry_64.S 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -696,6 +696,12 @@ ENTRY(spurious_interrupt)
|
|
Packit |
577717 |
apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
|
|
Packit |
577717 |
END(spurious_interrupt)
|
|
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 |
+END(perfctr_interrupt)
|
|
Packit |
577717 |
+#endif
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Exception entry points.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/x86/kernel/i8259_32.c.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/x86/kernel/i8259_32.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -20,6 +20,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 |
@@ -413,6 +414,8 @@ void __init native_init_IRQ(void)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
intr_init_hook();
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_vector_init();
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* External FPU? Set up irq13 if so, for
|
|
Packit |
577717 |
* original braindamaged IBM FERR coupling.
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/x86/kernel/i8259_64.c.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/x86/kernel/i8259_64.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -21,6 +21,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 |
@@ -497,6 +498,8 @@ void __init init_IRQ(void)
|
|
Packit |
577717 |
set_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
|
|
Packit |
577717 |
set_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_vector_init();
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
if (!acpi_ioapic)
|
|
Packit |
577717 |
setup_irq(2, &irq2);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/arch/x86/kernel/process_32.c.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/x86/kernel/process_32.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -29,6 +29,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 |
@@ -429,6 +430,7 @@ void exit_thread(void)
|
|
Packit |
577717 |
tss->x86_tss.io_bitmap_base = INVALID_IO_BITMAP_OFFSET;
|
|
Packit |
577717 |
put_cpu();
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
+ perfctr_exit_thread(¤t->thread);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void flush_thread(void)
|
|
Packit |
577717 |
@@ -480,6 +482,8 @@ int copy_thread(int nr, unsigned long cl
|
|
Packit |
577717 |
|
|
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(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) {
|
|
Packit |
577717 |
p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr,
|
|
Packit |
577717 |
@@ -769,6 +773,8 @@ struct task_struct fastcall * __switch_t
|
|
Packit |
577717 |
|
|
Packit |
577717 |
x86_write_percpu(current_task, 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.24.perfctr26/arch/x86/kernel/process_64.c.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/arch/x86/kernel/process_64.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -31,6 +31,7 @@
|
|
Packit |
577717 |
#include <linux/interrupt.h>
|
|
Packit |
577717 |
#include <linux/delay.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/notifier.h>
|
|
Packit |
577717 |
@@ -403,6 +404,7 @@ void exit_thread(void)
|
|
Packit |
577717 |
t->io_bitmap_max = 0;
|
|
Packit |
577717 |
put_cpu();
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
+ perfctr_exit_thread(t);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void flush_thread(void)
|
|
Packit |
577717 |
@@ -511,6 +513,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(test_tsk_thread_flag(me, TIF_IO_BITMAP))) {
|
|
Packit |
577717 |
p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
|
|
Packit |
577717 |
if (!p->thread.io_bitmap_ptr) {
|
|
Packit |
577717 |
@@ -694,6 +698,9 @@ __switch_to(struct task_struct *prev_p,
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
if (next_p->fpu_counter>5)
|
|
Packit |
577717 |
math_state_restore();
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
+ perfctr_resume_thread(next);
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
return prev_p;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/drivers/Makefile.~1~ 2008-06-22 15:42:30.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/drivers/Makefile 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -80,6 +80,7 @@ obj-$(CONFIG_MMC) += mmc/
|
|
Packit |
577717 |
obj-$(CONFIG_NEW_LEDS) += leds/
|
|
Packit |
577717 |
obj-$(CONFIG_INFINIBAND) += infiniband/
|
|
Packit |
577717 |
obj-$(CONFIG_SGI_SN) += sn/
|
|
Packit |
577717 |
+obj-$(CONFIG_KPERFCTR) += perfctr/
|
|
Packit |
577717 |
obj-y += firmware/
|
|
Packit |
577717 |
obj-$(CONFIG_CRYPTO) += crypto/
|
|
Packit |
577717 |
obj-$(CONFIG_SUPERH) += sh/
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/fs/exec.c.~1~ 2008-06-22 15:42:32.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/fs/exec.c 2008-06-22 15:43:55.000000000 +0200
|
|
Packit |
577717 |
@@ -51,6 +51,7 @@
|
|
Packit |
577717 |
#include <linux/tsacct_kern.h>
|
|
Packit |
577717 |
#include <linux/cn_proc.h>
|
|
Packit |
577717 |
#include <linux/audit.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <asm/uaccess.h>
|
|
Packit |
577717 |
#include <asm/mmu_context.h>
|
|
Packit |
577717 |
@@ -1019,6 +1020,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 |
/* Set the new mm task size. We have to do that late because it may
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/include/asm-arm/processor.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-arm/processor.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -44,6 +44,10 @@ struct thread_struct {
|
|
Packit |
577717 |
unsigned long error_code;
|
|
Packit |
577717 |
/* debugging */
|
|
Packit |
577717 |
struct debug_info debug;
|
|
Packit |
577717 |
+
|
|
Packit |
577717 |
+#ifdef CONFIG_PERFCTR_VIRTUAL
|
|
Packit |
577717 |
+ struct vperfctr *perfctr; /* performance counters */
|
|
Packit |
577717 |
+#endif
|
|
Packit |
577717 |
};
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define INIT_THREAD { }
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/include/asm-arm/system.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-arm/system.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -264,7 +264,9 @@ extern struct task_struct *__switch_to(s
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define switch_to(prev,next,last) \
|
|
Packit |
577717 |
do { \
|
|
Packit |
577717 |
+ perfctr_suspend_thread(&(prev)->thread); \
|
|
Packit |
577717 |
last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
|
|
Packit |
577717 |
+ perfctr_resume_thread(&(current)->thread); \
|
|
Packit |
577717 |
} while (0)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/include/asm-powerpc/processor.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-powerpc/processor.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -157,6 +157,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.24.perfctr26/include/asm-x86/hw_irq_64.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/hw_irq_64.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -84,14 +84,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 0x41 to spread out vectors evenly between priority
|
|
Packit |
577717 |
* levels. (0x80 is the syscall vector)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#define FIRST_DEVICE_VECTOR (IRQ15_VECTOR + 2)
|
|
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.24.perfctr26/include/asm-x86/irq_64.h.~1~ 2008-01-25 12:31:58.000000000 +0100
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/irq_64.h 2008-06-22 15:44:14.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 |
#define NR_IRQS (NR_VECTORS + (32 *NR_CPUS))
|
|
Packit |
577717 |
#define NR_IRQ_VECTORS NR_IRQS
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/include/asm-x86/mach-default/irq_vectors.h.~1~ 2008-01-25 12:31:58.000000000 +0100
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/mach-default/irq_vectors.h 2008-06-22 15:44:14.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.24.perfctr26/include/asm-x86/mach-visws/irq_vectors.h.~1~ 2008-01-25 12:31:58.000000000 +0100
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/mach-visws/irq_vectors.h 2008-06-22 15:44:14.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.24.perfctr26/include/asm-x86/processor_32.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/processor_32.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -369,6 +369,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 |
--- linux-2.6.24.perfctr26/include/asm-x86/processor_64.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/processor_64.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -241,6 +241,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.24.perfctr26/include/asm-x86/system_32.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/system_32.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -18,6 +18,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" /* Save flags */ \
|
|
Packit |
577717 |
"pushl %%ebp\n\t" \
|
|
Packit |
577717 |
"movl %%esp,%0\n\t" /* save ESP */ \
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/include/asm-x86/system_64.h.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/include/asm-x86/system_64.h 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -25,7 +25,8 @@
|
|
Packit |
577717 |
,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* Save restore flags to clear handle leaking NT */
|
|
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 |
@@ -45,7 +46,8 @@
|
|
Packit |
577717 |
[tif_fork] "i" (TIF_FORK), \
|
|
Packit |
577717 |
[thread_info] "i" (offsetof(struct task_struct, stack)), \
|
|
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.24.perfctr26/kernel/exit.c.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/kernel/exit.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -28,6 +28,7 @@
|
|
Packit |
577717 |
#include <linux/proc_fs.h>
|
|
Packit |
577717 |
#include <linux/kthread.h>
|
|
Packit |
577717 |
#include <linux/mempolicy.h>
|
|
Packit |
577717 |
+#include <linux/perfctr.h>
|
|
Packit |
577717 |
#include <linux/taskstats_kern.h>
|
|
Packit |
577717 |
#include <linux/delayacct.h>
|
|
Packit |
577717 |
#include <linux/freezer.h>
|
|
Packit |
577717 |
@@ -175,6 +176,7 @@ repeat:
|
|
Packit |
577717 |
zap_leader = (leader->exit_signal == -1);
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
+ perfctr_release_task(p);
|
|
Packit |
577717 |
write_unlock_irq(&tasklist_lock);
|
|
Packit |
577717 |
release_thread(p);
|
|
Packit |
577717 |
call_rcu(&p->rcu, delayed_put_task_struct);
|
|
Packit |
577717 |
--- linux-2.6.24.perfctr26/kernel/sched.c.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/kernel/sched.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -52,6 +52,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/sysctl.h>
|
|
Packit |
577717 |
@@ -5071,6 +5072,8 @@ int set_cpus_allowed(struct task_struct
|
|
Packit |
577717 |
struct rq *rq;
|
|
Packit |
577717 |
int ret = 0;
|
|
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.24.perfctr26/kernel/timer.c.~1~ 2008-06-22 15:42:33.000000000 +0200
|
|
Packit |
577717 |
+++ linux-2.6.24.perfctr26/kernel/timer.c 2008-06-22 15:44:14.000000000 +0200
|
|
Packit |
577717 |
@@ -33,6 +33,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 |
#include <linux/delay.h>
|
|
Packit |
577717 |
#include <linux/tick.h>
|
|
Packit |
577717 |
@@ -841,6 +842,7 @@ void update_process_times(int user_tick)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* Note: this timer irq context must be accounted for as well. */
|
|
Packit |
577717 |
account_process_tick(p, user_tick);
|
|
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);
|