Adding a bit more to Chopstix for better monitoring mlab.
authorSapan Bhatia <sapanb@cs.princeton.edu>
Tue, 17 Feb 2009 22:16:28 +0000 (22:16 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Tue, 17 Feb 2009 22:16:28 +0000 (22:16 +0000)
linux-2.6-590-chopstix-intern.patch

index 0f20cea..a70f76e 100644 (file)
@@ -725,3 +725,54 @@ diff -Nurb linux-2.6.22-580/mm/slab.c linux-2.6.22-590/mm/slab.c
        local_irq_restore(flags);
  }
  EXPORT_SYMBOL(kfree);
+--- mm/memory.c.orig   2008-02-25 18:59:40.000000000 -0500
++++ mm/memory.c        2009-02-17 17:14:01.000000000 -0500
+@@ -59,6 +59,7 @@
+ #include <linux/swapops.h>
+ #include <linux/elf.h>
++#include <linux/arrays.h>
+ #ifndef CONFIG_NEED_MULTIPLE_NODES
+ /* use the per-pgdat data instead for discontigmem - mbligh */
+@@ -2581,6 +2582,15 @@
+       return VM_FAULT_MINOR;
+ }
++extern void (*rec_event)(void *,unsigned int);
++struct event_spec {
++      unsigned long pc;
++      unsigned long dcookie; 
++      unsigned count;
++      unsigned char reason;
++};
++
++
+ /*
+  * By the time we get here, we already hold the mm semaphore
+  */
+@@ -2610,6 +2620,24 @@
+       if (!pte)
+               return VM_FAULT_OOM;
++#ifdef CONFIG_CHOPSTIX
++      if (rec_event) {
++              struct event event;
++              struct event_spec espec;
++        struct pt_regs *regs;
++        unsigned int pc;
++        regs = task_pt_regs(current);
++        pc = regs->eip & 4095;
++
++              espec.reason = 0; /* alloc */
++              event.event_data=&espec;
++              event.task = current;
++              espec.pc=pc;
++              event.event_type=5; 
++              (*rec_event)(&event, 1);
++      }
++#endif
++
+       return handle_pte_fault(mm, vma, address, pte, pmd, write_access);
+ }