]> sourceware.org Git - systemtap.git/commitdiff
2006-08-09 Josh Stone <joshua.i.stone@intel.com>
authorjistone <jistone>
Thu, 10 Aug 2006 01:43:44 +0000 (01:43 +0000)
committerjistone <jistone>
Thu, 10 Aug 2006 01:43:44 +0000 (01:43 +0000)
* stapprobes.5.in, testsuite/buildok/memory.stp: move pagefault
to vm.* namespace

tapset/
* memory.stp: move pagefault to vm.* namespace, and add many other
virtual-memory themed probes.

tapset/LKET/
* pagefault.stp: move pagefault to vm.* namespace

ChangeLog
stapprobes.5.in
tapset/ChangeLog
tapset/LKET/Changelog
tapset/LKET/pagefault.stp
tapset/memory.stp
testsuite/buildok/memory.stp

index 6dcbeb089e37bf926dcb821d6656f5871686d314..a8d193f88639c0ae42cc47851598f57d267582ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
        * examples/small_demos/proc_snoop.stp,
        testsuite/buildok/process_test.stp: Rename process.signal_* to
        new signal.* tapset.
+       * stapprobes.5.in, testsuite/buildok/memory.stp: move pagefault
+       to vm.* namespace
 
 2006-08-08  Eugene Teo  <eteo@redhat.com>
 
index 098a2bf0646283f681112ef8775fa444ee8c9da5..d18237142c14bdc287189981067e328390d2e980 100644 (file)
@@ -476,7 +476,7 @@ It contains the following probe points:
 
 .P
 .TP 
-.B pagefault
+.B vm.pagefault
 Fires when there is a pagefault
 
 .B Arguments:
index c9f9a1937fd86424c57a905b9df1ec98b847f3a4..db4765da54f385f2f17c03ebfe4f6bda2f07f2b6 100644 (file)
@@ -3,6 +3,8 @@
        * signal.stp: Create a new tapset that addresses process signals.
        Much of this was contributed by Manoj Pattabhiraman (IBM).
        * process.stp: Remove aliases that now belong in signal tapset
+       * memory.stp: move pagefault to vm.* namespace, and add many other
+       virtual-memory themed probes.
 
 2006-08-09  David Smith  <dsmith@redhat.com>
 
index f5cae33edb02a40b411adbcae9337c0d5f88e1d3..a81cb0cdf5519848c56b211e862043da506c0404 100644 (file)
@@ -1,3 +1,7 @@
+2006-08-09  Josh Stone  <joshua.i.stone@intel.com>
+
+       * pagefault.stp: move pagefault to vm.* namespace
+
 2006-07-14  Li Guanglei <guanglei@cn.ibm.com>
        
        * aio.stp: bugfix to make each aio sub event hook
index 3f15cf62ba87bfcd81a6fe2f0c6a5e0e6d5adaf1..1dcca518c358b92a89a3a8c84558bbed51c682cf 100755 (executable)
@@ -19,7 +19,7 @@ probe addevent.pagefault
 }
 
 probe _addevent.pagefault
-       =  pagefault
+       =  vm.pagefault
 {
        if(filter_by_pid() == 1 ) {
                log_pagefault_tracedata(HOOKID_PAGEFAULT, $address, $write_access)
index 2682b5a7f96f8342384d3a5ca5837f8a5f338a94..2c36f83e589b47b313ad3b71308a76dfd21fa3c5 100644 (file)
@@ -1,15 +1,26 @@
-// memory related tapset
+// memory/vm related tapset
 // Copyright (C) 2005, 2006 IBM Corp.
+// Copyright (C) 2006 Intel Corporation.
 //
 // This file is part of systemtap, and is free software.  You can
 // redistribute it and/or modify it under the terms of the GNU General
 // Public License (GPL); either version 2, or (at your option) any
 // later version.
 
-/* Record the page fault event */
-probe pagefault
-       =  kernel.function(%( kernel_v >= "2.6.13" %? "__handle_mm_fault"
-                                          %: "handle_mm_fault" %))
+/* probe vm.pagefault
+ *
+ *  Records that a page fault occurred.
+ *
+ * Context:
+ *  The process which triggered the fault.
+ *
+ * Arguments:
+ *  address - the address of the faulting memory access.
+ *  write_access - indicates whether this was a write
+ */
+probe vm.pagefault = kernel.function(
+        %( kernel_v >= "2.6.13" %? "__handle_mm_fault" %: "handle_mm_fault" %)
+        )
 {
        write_access = $write_access
        address =  $address
@@ -28,5 +39,109 @@ function addr_to_node:long(addr:long)  /* pure */
                        THIS->__retvalue = nid;
                         break;
                 }
+%}
 
+/* Return whether a page to be copied is a zero page. */
+function _IS_ZERO_PAGE:long(from:long, vaddr:long) %{ /* pure */
+    THIS->__retvalue = (from == ZERO_PAGE(vaddr));
 %}
+
+
+/* probe vm.write_shared
+ *
+ *  Fires when a process attempts to write to a shared page.  If a
+ *  copy is necessary, this will be followed by a vm.write_shared_copy.
+ *
+ * Context:
+ *  The process attempting the write.
+ *
+ * Arguments:
+ *  address - the address of the shared write.
+ */
+probe vm.write_shared = kernel.function("do_wp_page") {
+    address = $address
+}
+
+
+/* probe vm.write_shared_copy
+ *
+ *  Fires when a write to a shared page requires a page copy.  This is
+ *  always preceded by a vm.shared_write.
+ *
+ * Context:
+ *  The process attempting the write.
+ *
+ * Arguments:
+ *  address - the address of the shared write.
+ *  zero - boolean indicating whether it is a zero page
+ *         (can do a clear instead of a copy).
+ */
+probe vm.write_shared_copy = kernel.inline("copy_cow_page") {
+    address = $address
+    zero = _IS_ZERO_PAGE($from, address);
+}
+
+
+/* probe vm.mmap
+ *
+ *  Fires when an mmap is requested.
+ *
+ * Context:
+ *  The process calling mmap.
+ *
+ * Arguments:
+ *  address - the requested address
+ *  length - the length of the memory segment 
+ */
+probe vm.mmap = kernel.inline("do_mmap"), kernel.inline("do_mmap2") {
+    address = $addr
+    length = $len
+}
+
+
+/* probe vm.munmap
+ *
+ *  Fires when an munmap is requested.
+ *
+ * Context:
+ *  The process calling munmap.
+ *
+ * Arguments:
+ *  address - the requested address
+ *  length - the length of the memory segment 
+ */
+probe vm.munmap = kernel.function("do_munmap") {
+    address = $start
+    length = $len
+}
+
+/* probe vm.brk
+ *
+ *  Fires when a brk is requested (resizing a heap).
+ *
+ * Context:
+ *  The process calling brk.
+ *
+ * Arguments:
+ *  address - the requested address
+ *  length - the length of the memory segment 
+ */
+probe vm.brk = kernel.function("do_brk") {
+    address = $addr
+    length = $len
+}
+
+/* probe vm.oom_kill
+ *
+ *  Fires when a thread is targetted by the OOM killer.
+ *
+ * Context:
+ *  The process that tried to consume more memory, and thus
+ *  triggered the OOM. (correct?)
+ *
+ * Arguments:
+ *  task - the task being killed
+ */
+probe vm.oom_kill = kernel.function("__oom_kill_task") {
+    task = $p
+}
index c184e487518005de29305a03208966fb964f850c..ce9f28cb613b6498718e1847b44a568c882874f2 100755 (executable)
@@ -1,5 +1,5 @@
 #! stap -p4
-probe pagefault
+probe vm.pagefault
 {
        printf("ppname: %s, %d, %p\n", probefunc(), write_access, address)
 }
This page took 0.04777 seconds and 5 git commands to generate.