[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] added counter for pagefaults



ChangeSet 1.1245.1.1, 2005/03/16 17:31:15+00:00, 
rneugeba@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

        added counter for pagefaults
        
        Signed-off-by: michael.fetterman@xxxxxxxxxxxx



 kernel/syscall_stats.c |   10 ++++++++++
 mm/fault.c             |    9 +++++++++
 2 files changed, 19 insertions(+)


diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/syscall_stats.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/syscall_stats.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/syscall_stats.c      
2005-04-05 12:11:25 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/syscall_stats.c      
2005-04-05 12:11:25 -04:00
@@ -19,12 +19,19 @@
 unsigned long syscall_stats[NR_syscalls];
 static unsigned char foobar[4];
 
+unsigned long c_do_page_fault;
+unsigned long c_minor_page_fault;
+unsigned long c_major_page_fault;
+
 /* a write just resests the counter */
 static ssize_t syscall_write(struct file *f, const  char *data,
                              size_t size, loff_t  *pos)
 {
     printk("resetting syscall stats\n");
     memset(&syscall_stats, 0, sizeof(syscall_stats));
+    c_do_page_fault = 0;
+    c_minor_page_fault = 0;
+    c_major_page_fault = 0;
     return size;
 }
 
@@ -36,6 +43,9 @@
         seq_printf(m, "%lu ", syscall_stats[i]);
     }
     seq_printf(m, "\n");
+    seq_printf(m, "%lu %lu %lu\n", c_do_page_fault,
+               c_minor_page_fault, c_major_page_fault);
+    
     return 0;
 }
 
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c  2005-04-05 12:11:25 
-04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c  2005-04-05 12:11:25 
-04:00
@@ -216,6 +216,11 @@
  *     bit 1 == 0 means read, 1 means write
  *     bit 2 == 0 means kernel, 1 means user-mode
  */
+
+extern unsigned long c_do_page_fault;
+extern unsigned long c_minor_page_fault;
+extern unsigned long c_major_page_fault;
+
 fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code,
                              unsigned long address)
 {
@@ -226,6 +231,8 @@
        int write;
        siginfo_t info;
 
+    c_do_page_fault++;
+
        /* Set the "privileged fault" bit to something sane. */
        error_code &= 3;
        error_code |= (regs->xcs & 2) << 1;
@@ -359,9 +366,11 @@
        switch (handle_mm_fault(mm, vma, address, write)) {
                case VM_FAULT_MINOR:
                        tsk->min_flt++;
+            c_minor_page_fault++;
                        break;
                case VM_FAULT_MAJOR:
                        tsk->maj_flt++;
+            c_major_page_fault++;
                        break;
                case VM_FAULT_SIGBUS:
                        goto do_sigbus;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.