summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/locks
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-11-18 17:59:24 +0800
committerWenji Huang <wenji.huang@oracle.com>2009-11-18 17:59:24 +0800
commit66f73b62a4ed147b229237407a00688e61f96d5a (patch)
tree83e36258ada8be05220b976b350d580a36733565 /testsuite/systemtap.examples/locks
parent2e66901da2ffed2261784f458a2fc57d6f059725 (diff)
downloadsystemtap-steved-66f73b62a4ed147b229237407a00688e61f96d5a.tar.gz
systemtap-steved-66f73b62a4ed147b229237407a00688e61f96d5a.tar.xz
systemtap-steved-66f73b62a4ed147b229237407a00688e61f96d5a.zip
Clean up examples
Diffstat (limited to 'testsuite/systemtap.examples/locks')
-rw-r--r--testsuite/systemtap.examples/locks/bkl_stats.meta2
-rwxr-xr-xtestsuite/systemtap.examples/locks/bkl_stats.stp10
2 files changed, 3 insertions, 9 deletions
diff --git a/testsuite/systemtap.examples/locks/bkl_stats.meta b/testsuite/systemtap.examples/locks/bkl_stats.meta
index 16ac2911..e8080bf4 100644
--- a/testsuite/systemtap.examples/locks/bkl_stats.meta
+++ b/testsuite/systemtap.examples/locks/bkl_stats.meta
@@ -8,7 +8,7 @@ status: production
exit: user-controlled
output: sorted-list
scope: system-wide
-description: The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent holding the lock for each of the processes.
+description: The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent in holding the lock for each of the processes.
test_support: stap -l 'kernel.function("lock_kernel").return'
test_check: stap -p4 bkl_stats.stp
test_installcheck: stap bkl_stats.stp -c "sleep 0.2"
diff --git a/testsuite/systemtap.examples/locks/bkl_stats.stp b/testsuite/systemtap.examples/locks/bkl_stats.stp
index 4481e493..4a8eba6d 100755
--- a/testsuite/systemtap.examples/locks/bkl_stats.stp
+++ b/testsuite/systemtap.examples/locks/bkl_stats.stp
@@ -11,12 +11,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Print out the amount of time spent in the read and write systemcall
- * when a process closes each file is closed. Note that the systemtap
- * script needs to be running before the open operations occur for
- * the script to record data.
- *
- * Description: displays statisics for waiting and holding big kernel lock (BKL)
+ * Description: displays statistics for waiting and holding big kernel lock (BKL)
*
* Run: stap bkl_stats.stap
*
@@ -73,11 +68,10 @@ probe kernel.function("lock_kernel").return {
}
probe kernel.function("unlock_kernel") {
- # record the amount of time the process held the lock
t = gettimeofday_us()
s = holder_time[tid()]
holder_time[tid()] = t
- # record the amount of time waiting for the lock
+ # record the amount of time the process held the lock
if (s) {
holder_stats[tid()] <<< t - s
names[tid()] = execname()