WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] added counter for pagefaults

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] added counter for pagefaults
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 16 Mar 2005 17:31:15 +0000
Delivery-date: Tue, 05 Apr 2005 16:11:22 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] added counter for pagefaults, BitKeeper Bot <=