Blame src/perfctr-2.6.x/patches/patch-kernel-2.6.32

Packit 577717
--- linux-2.6.32.perfctr26/CREDITS.~1~	2009-12-03 12:38:30.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/CREDITS	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -2771,6 +2771,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.32.perfctr26/Documentation/ioctl/ioctl-number.txt.~1~	2009-12-03 12:38:31.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/Documentation/ioctl/ioctl-number.txt	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -200,6 +200,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.32.perfctr26/MAINTAINERS.~1~	2009-12-03 12:38:31.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/MAINTAINERS	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -4119,6 +4119,11 @@ F:	arch/*/lib/perf_event.c
Packit 577717
 F:	arch/*/kernel/perf_callchain.c
Packit 577717
 F:	tools/perf/
Packit 577717
 
Packit 577717
+PERFORMANCE-MONITORING COUNTERS DRIVER
Packit 577717
+M:	Mikael Pettersson <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
 M:	Christoph Hellwig <hch@infradead.org>
Packit 577717
 L:	linux-abi-devel@lists.sourceforge.net
Packit 577717
--- linux-2.6.32.perfctr26/arch/arm/Kconfig.~1~	2009-12-03 12:38:31.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/arm/Kconfig	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -827,6 +827,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.32.perfctr26/arch/arm/include/asm/processor.h.~1~	2009-09-10 13:41:49.000000000 +0200
Packit 577717
+++ linux-2.6.32.perfctr26/arch/arm/include/asm/processor.h	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -50,6 +50,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.32.perfctr26/arch/arm/include/asm/system.h.~1~	2009-06-10 12:00:43.000000000 +0200
Packit 577717
+++ linux-2.6.32.perfctr26/arch/arm/include/asm/system.h	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -215,7 +215,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.32.perfctr26/arch/arm/kernel/process.c.~1~	2009-12-03 12:38:31.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/arm/kernel/process.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -26,6 +26,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
 #include <linux/uaccess.h>
Packit 577717
@@ -279,6 +280,7 @@ void show_regs(struct pt_regs * regs)
Packit 577717
  */
Packit 577717
 void exit_thread(void)
Packit 577717
 {
Packit 577717
+	perfctr_exit_thread(&current->thread);
Packit 577717
 }
Packit 577717
 
Packit 577717
 ATOMIC_NOTIFIER_HEAD(thread_notify_head);
Packit 577717
@@ -324,6 +326,8 @@ copy_thread(unsigned long clone_flags, u
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.32.perfctr26/arch/powerpc/include/asm/processor.h.~1~	2009-06-10 12:00:43.000000000 +0200
Packit 577717
+++ linux-2.6.32.perfctr26/arch/powerpc/include/asm/processor.h	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -197,6 +197,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.32.perfctr26/arch/powerpc/kernel/process.c.~1~	2009-12-03 12:38:31.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/powerpc/kernel/process.c	2009-12-03 12:49:22.000000000 +0100
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
@@ -409,8 +410,10 @@ struct task_struct *__switch_to(struct t
Packit 577717
 	 * window where the kernel stack SLB and the kernel stack are out
Packit 577717
 	 * of sync. Hard disable here.
Packit 577717
 	 */
Packit 577717
+	perfctr_suspend_thread(&prev->thread);
Packit 577717
 	hard_irq_disable();
Packit 577717
 	last = _switch(old_thread, new_thread);
Packit 577717
+	perfctr_resume_thread(&current->thread);
Packit 577717
 
Packit 577717
 	local_irq_restore(flags);
Packit 577717
 
Packit 577717
@@ -550,6 +553,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(&current->thread);
Packit 577717
 }
Packit 577717
 
Packit 577717
 void flush_thread(void)
Packit 577717
@@ -678,6 +682,8 @@ int copy_thread(unsigned long clone_flag
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.32.perfctr26/arch/powerpc/platforms/Kconfig.cputype.~1~	2009-12-03 12:38:31.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/powerpc/platforms/Kconfig.cputype	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -318,4 +318,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.32.perfctr26/arch/x86/Kconfig.~1~	2009-12-03 12:38:31.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/Kconfig	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -1459,6 +1459,8 @@ config CC_STACKPROTECTOR
Packit 577717
 	  detected and for those versions, this configuration option is
Packit 577717
 	  ignored. (and a warning is printed during bootup)
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.32.perfctr26/arch/x86/include/asm/irq_vectors.h.~1~	2009-09-10 13:41:50.000000000 +0200
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/include/asm/irq_vectors.h	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -102,6 +102,7 @@
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
  * Generic system vector for platform specific use
Packit 577717
@@ -121,7 +122,7 @@
Packit 577717
 #define MCE_SELF_VECTOR			0xeb
Packit 577717
 
Packit 577717
 /*
Packit 577717
- * First APIC vector available to drivers: (vectors 0x30-0xee) we
Packit 577717
+ * First APIC vector available to drivers: (vectors 0x30-0xea) we
Packit 577717
  * start at 0x31(0x41) to spread out vectors evenly between priority
Packit 577717
  * levels. (0x80 is the syscall vector)
Packit 577717
  */
Packit 577717
--- linux-2.6.32.perfctr26/arch/x86/include/asm/processor.h.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/include/asm/processor.h	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -471,6 +471,8 @@ struct thread_struct {
Packit 577717
 	unsigned long		iopl;
Packit 577717
 	/* Max allowed port in the bitmap, in bytes: */
Packit 577717
 	unsigned		io_bitmap_max;
Packit 577717
+/* performance counters */
Packit 577717
+	struct vperfctr		*perfctr;
Packit 577717
 /* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set.  */
Packit 577717
 	unsigned long	debugctlmsr;
Packit 577717
 	/* Debug Store context; see asm/ds.h */
Packit 577717
--- linux-2.6.32.perfctr26/arch/x86/include/asm/system.h.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/include/asm/system.h	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -55,6 +55,7 @@ do {									\
Packit 577717
 	 */								\
Packit 577717
 	unsigned long ebx, ecx, edx, esi, edi;				\
Packit 577717
 									\
Packit 577717
+	perfctr_suspend_thread(&(prev)->thread);			\
Packit 577717
 	asm volatile("pushfl\n\t"		/* save    flags */	\
Packit 577717
 		     "pushl %%ebp\n\t"		/* save    EBP   */	\
Packit 577717
 		     "movl %%esp,%[prev_sp]\n\t"	/* save    ESP   */ \
Packit 577717
@@ -123,7 +124,8 @@ do {									\
Packit 577717
 #endif	/* CC_STACKPROTECTOR */
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
@@ -146,7 +148,8 @@ do {									\
Packit 577717
 	       [thread_info] "i" (offsetof(struct task_struct, stack)),   \
Packit 577717
 	       [current_task] "m" (per_cpu_var(current_task))		  \
Packit 577717
 	       __switch_canary_iparam					  \
Packit 577717
-	     : "memory", "cc" __EXTRA_CLOBBER)
Packit 577717
+	     : "memory", "cc" __EXTRA_CLOBBER); \
Packit 577717
+} while (0)
Packit 577717
 #endif
Packit 577717
 
Packit 577717
 #ifdef __KERNEL__
Packit 577717
--- linux-2.6.32.perfctr26/arch/x86/kernel/entry_32.S.~1~	2009-09-10 13:41:50.000000000 +0200
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/kernel/entry_32.S	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -832,6 +832,23 @@ ENDPROC(name)
Packit 577717
 /* The include is where all of the SMP etc. interrupts come from */
Packit 577717
 #include <asm/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
 ENTRY(coprocessor_error)
Packit 577717
 	RING0_INT_FRAME
Packit 577717
 	pushl $0
Packit 577717
--- linux-2.6.32.perfctr26/arch/x86/kernel/entry_64.S.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/kernel/entry_64.S	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -1020,6 +1020,11 @@ apicinterrupt LOCAL_PENDING_VECTOR \
Packit 577717
 	perf_pending_interrupt smp_perf_pending_interrupt
Packit 577717
 #endif
Packit 577717
 
Packit 577717
+#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_KPERFCTR)
Packit 577717
+apicinterrupt LOCAL_PERFCTR_VECTOR \
Packit 577717
+	perfctr_interrupt smp_perfctr_interrupt
Packit 577717
+#endif
Packit 577717
+
Packit 577717
 /*
Packit 577717
  * Exception entry points.
Packit 577717
  */
Packit 577717
--- linux-2.6.32.perfctr26/arch/x86/kernel/irqinit.c.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/kernel/irqinit.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -25,6 +25,7 @@
Packit 577717
 #include <asm/apic.h>
Packit 577717
 #include <asm/setup.h>
Packit 577717
 #include <asm/i8259.h>
Packit 577717
+#include <asm/perfctr.h>
Packit 577717
 #include <asm/traps.h>
Packit 577717
 
Packit 577717
 /*
Packit 577717
@@ -235,6 +236,8 @@ void __init native_init_IRQ(void)
Packit 577717
 			set_intr_gate(i, interrupt[i-FIRST_EXTERNAL_VECTOR]);
Packit 577717
 	}
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.32.perfctr26/arch/x86/kernel/process.c.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/kernel/process.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -8,6 +8,7 @@
Packit 577717
 #include <linux/module.h>
Packit 577717
 #include <linux/pm.h>
Packit 577717
 #include <linux/clockchips.h>
Packit 577717
+#include <linux/perfctr.h>
Packit 577717
 #include <linux/random.h>
Packit 577717
 #include <trace/events/power.h>
Packit 577717
 #include <asm/system.h>
Packit 577717
@@ -85,6 +86,7 @@ void exit_thread(void)
Packit 577717
 		put_cpu();
Packit 577717
 		kfree(bp);
Packit 577717
 	}
Packit 577717
+	perfctr_exit_thread(t);
Packit 577717
 }
Packit 577717
 
Packit 577717
 void flush_thread(void)
Packit 577717
--- linux-2.6.32.perfctr26/arch/x86/kernel/process_32.c.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/kernel/process_32.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -27,6 +27,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
@@ -259,6 +260,8 @@ int copy_thread(unsigned long clone_flag
Packit 577717
 
Packit 577717
 	task_user_gs(p) = get_user_gs(regs);
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
@@ -427,6 +430,8 @@ __switch_to(struct task_struct *prev_p, 
Packit 577717
 
Packit 577717
 	percpu_write(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.32.perfctr26/arch/x86/kernel/process_64.c.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/arch/x86/kernel/process_64.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -30,6 +30,7 @@
Packit 577717
 #include <linux/delay.h>
Packit 577717
 #include <linux/module.h>
Packit 577717
 #include <linux/ptrace.h>
Packit 577717
+#include <linux/perfctr.h>
Packit 577717
 #include <linux/notifier.h>
Packit 577717
 #include <linux/kprobes.h>
Packit 577717
 #include <linux/kdebug.h>
Packit 577717
@@ -303,6 +304,8 @@ int copy_thread(unsigned long clone_flag
Packit 577717
 	savesegment(es, p->thread.es);
Packit 577717
 	savesegment(ds, 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
@@ -495,6 +498,9 @@ __switch_to(struct task_struct *prev_p, 
Packit 577717
 	 */
Packit 577717
 	if (preload_fpu)
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.32.perfctr26/drivers/Makefile.~1~	2009-12-03 12:38:32.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/drivers/Makefile	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -96,6 +96,7 @@ obj-$(CONFIG_MEMSTICK)		+= memstick/
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.32.perfctr26/fs/exec.c.~1~	2009-12-03 12:38:35.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/fs/exec.c	2009-12-03 12:49:22.000000000 +0100
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
 #include <linux/tracehook.h>
Packit 577717
 #include <linux/kmod.h>
Packit 577717
 #include <linux/fsnotify.h>
Packit 577717
@@ -976,6 +977,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(&current->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.32.perfctr26/kernel/exit.c.~1~	2009-12-03 12:38:35.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/kernel/exit.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -29,6 +29,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
@@ -206,6 +207,7 @@ repeat:
Packit 577717
 			leader->exit_state = EXIT_DEAD;
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.32.perfctr26/kernel/pid.c.~1~	2009-12-03 12:38:35.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/kernel/pid.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -387,6 +387,7 @@ struct task_struct *find_task_by_vpid(pi
Packit 577717
 {
Packit 577717
 	return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns);
Packit 577717
 }
Packit 577717
+EXPORT_SYMBOL(find_task_by_vpid);
Packit 577717
 
Packit 577717
 struct pid *get_task_pid(struct task_struct *task, enum pid_type type)
Packit 577717
 {
Packit 577717
--- linux-2.6.32.perfctr26/kernel/sched.c.~1~	2009-12-03 12:38:35.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/kernel/sched.c	2009-12-03 12:49:22.000000000 +0100
Packit 577717
@@ -55,6 +55,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/proc_fs.h>
Packit 577717
 #include <linux/seq_file.h>
Packit 577717
@@ -7054,6 +7055,8 @@ int set_cpus_allowed_ptr(struct task_str
Packit 577717
 	struct rq *rq;
Packit 577717
 	int ret = 0;
Packit 577717
 
Packit 577717
+	perfctr_set_cpus_allowed(p, *new_mask); /* XXX: convert to _ptr */
Packit 577717
+
Packit 577717
 	rq = task_rq_lock(p, &flags);
Packit 577717
 	if (!cpumask_intersects(new_mask, cpu_online_mask)) {
Packit 577717
 		ret = -EINVAL;
Packit 577717
--- linux-2.6.32.perfctr26/kernel/timer.c.~1~	2009-12-03 12:38:35.000000000 +0100
Packit 577717
+++ linux-2.6.32.perfctr26/kernel/timer.c	2009-12-03 12:49:22.000000000 +0100
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
@@ -1197,6 +1198,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
 	rcu_check_callbacks(cpu, user_tick);
Packit 577717
 	printk_tick();