This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix io_submit.stp example script


Hi,

As written, this script will store backtraces for every thread that
calls schedule so long as it has also called io_submit at any time in
the past.  Fix this so it only stores a backtrace if the current thread
is actually in an io_submit system call.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

diff --git a/testsuite/systemtap.examples/io/io_submit.stp b/testsuite/systemtap.examples/io/io_submit.stp
index 74ab639..9c397c6 100755
--- a/testsuite/systemtap.examples/io/io_submit.stp
+++ b/testsuite/systemtap.examples/io/io_submit.stp
@@ -41,7 +41,7 @@ probe syscall.io_submit.return {
  * io_submit.  If so, record our backtrace into the traces histogram
  */
 probe kernel.function("schedule") {
-  if (tid() in in_iosubmit) {
+  if (in_iosubmit[tid()] == 1) {
     traces[backtrace()]++
 
     /*


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]