This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[patch] Fix io_submit.stp example script
- From: Jeff Moyer <jmoyer at redhat dot com>
- To: systemtap at sourceware dot org
- Date: Wed, 30 Jul 2014 14:03:42 -0400
- Subject: [patch] Fix io_submit.stp example script
- Authentication-results: sourceware.org; auth=none
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()]++
/*