]> sourceware.org Git - systemtap.git/commitdiff
noptrace sample: report blocked ptrace(2) attempt before changing request code
authorFrank Ch. Eigler <fche@elastic.org>
Sat, 19 Jun 2010 03:18:14 +0000 (23:18 -0400)
committerFrank Ch. Eigler <fche@elastic.org>
Sat, 19 Jun 2010 03:18:14 +0000 (23:18 -0400)
testsuite/systemtap.examples/process/noptrace.stp

index 9b0fa5426ce44601b1ebeb15a8302d5a89f45ada..173c23d70fcb3fd3d82ac017f730d8fd4615044f 100755 (executable)
@@ -46,14 +46,14 @@ probe procfs("unblock").write {  # unblock given pid
 
 probe syscall.ptrace {
       if (pid() in noptrace) {
+         # report
+         printf ("%s[%d] ptrace(%d) blocked: ", execname(), tid(), $request)
+         # (or if desired, accumulate counts and report at probe end {})
+
          # disable the ptrace call in progress
          # if it weren't for PTRACE_TRACEME, we could set $pid=1 => -EPERM
          # changing it to an invalid request number works too
          $request=0xbeef # anything invalid should do
-
-         # report
-         printf ("%s[%d] ptrace(%d) blocked: ", execname(), tid(), $request)
-         # (or if desired, accumulate counts and report at probe end {})
       }
 }
 
This page took 0.031367 seconds and 5 git commands to generate.