summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.samples
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.samples')
-rw-r--r--testsuite/systemtap.samples/pfaults.exp16
-rw-r--r--testsuite/systemtap.samples/pfaults.stp58
2 files changed, 0 insertions, 74 deletions
diff --git a/testsuite/systemtap.samples/pfaults.exp b/testsuite/systemtap.samples/pfaults.exp
deleted file mode 100644
index 2cab7c14..00000000
--- a/testsuite/systemtap.samples/pfaults.exp
+++ /dev/null
@@ -1,16 +0,0 @@
-set test "pfaults"
-if {![installtest_p]} { untested $test; return }
-
-spawn stap -DMAXACTION=10000 -g $srcdir/$subdir/pfaults.stp
-set pid $spawn_id
-set ok 0
-expect {
- -timeout 240
- -re {Page fault tracking, start time[^\r\n]+\r\n} { incr ok; exp_continue }
- -re {Page fault tracking, end time[^\r\n]+\r\n} { incr ok; exp_continue }
- timeout { fail "$test (timeout)" }
- eof { }
-}
-#FIXME does not handle case of hanging pfaults.stp correctly
-wait
-if {$ok == 2} { pass "$test ($ok)" } { fail "$test ($ok)" }
diff --git a/testsuite/systemtap.samples/pfaults.stp b/testsuite/systemtap.samples/pfaults.stp
deleted file mode 100644
index 577e93cd..00000000
--- a/testsuite/systemtap.samples/pfaults.stp
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /usr/bin/env stap
-
-global pidnames, faults, fault_types
-
-probe vm.pagefault {
- # Maintain a pid-to-execname mapping. This logic should get transplanted
- # into a tapset script that is automatically included upon reference to
- # its exported global variable.
- pidnames[pid()] = execname()
-
- faults [pid(), $write_access ? 1 : 0] ++
-}
-
-probe vm.pagefault.return {
- fault_types [pid(), $return] ++
-}
-
-
-# Some constants, to come from a future "VM tapset"
-
-global VM_FAULT_OOM, VM_FAULT_SIGBUS, VM_FAULT_MINOR, VM_FAULT_MAJOR
-probe begin {
- VM_FAULT_OOM=-1
- VM_FAULT_SIGBUS=0
- VM_FAULT_MINOR=1
- VM_FAULT_MAJOR=2
-}
-
-
-# Shut down the probing session after a while
-probe timer.ms(1000) { report() }
-probe timer.ms(10000) { exit() }
-
-function _(n) { return sprint(n) } # let's abbreviate
-
-function report () {
- print ("time=" . _(gettimeofday_s()) . "\n")
- foreach ([pid] in pidnames) {
- if (faults[pid,0]+faults[pid,1] == 0) continue
- print (pidnames[pid] . "[" . _(pid) . "]" .
- " reads=" . _(faults[pid,0]) .
- " writes=" . _(faults[pid,1]) .
- " oom=" . _(fault_types[pid,VM_FAULT_OOM]) .
- " sigbus=" . _(fault_types[pid,VM_FAULT_SIGBUS]) .
- " minor=" . _(fault_types[pid,VM_FAULT_MINOR]) .
- " major=" . _(fault_types[pid,VM_FAULT_MAJOR]) .
- "\n")
- }
- delete faults
- delete fault_types
-}
-
-probe begin {
- print ("Page fault tracking, start time=" . _(gettimeofday_s()) . "\n")
-}
-probe end {
- print ("Page fault tracking, end time=" . _(gettimeofday_s()) . "\n")
-}