summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/io/disktop.stp
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2008-10-27 13:11:44 -0400
committerWilliam Cohen <wcohen@redhat.com>2008-10-27 13:11:44 -0400
commit26343b47cdaff0420e6405295a0788b334be4eb6 (patch)
treed168400a01999289691bcab09a1d6d8896d6c3e3 /testsuite/systemtap.examples/io/disktop.stp
parent83b7815f1adaa6f44a7ad9e151dd78caf79bdb0e (diff)
downloadsystemtap-steved-26343b47cdaff0420e6405295a0788b334be4eb6.tar.gz
systemtap-steved-26343b47cdaff0420e6405295a0788b334be4eb6.tar.xz
systemtap-steved-26343b47cdaff0420e6405295a0788b334be4eb6.zip
Provide dev and devname in vfs.read and vfs.write. Use them in disktop.stp.
Diffstat (limited to 'testsuite/systemtap.examples/io/disktop.stp')
-rwxr-xr-xtestsuite/systemtap.examples/io/disktop.stp21
1 files changed, 10 insertions, 11 deletions
diff --git a/testsuite/systemtap.examples/io/disktop.stp b/testsuite/systemtap.examples/io/disktop.stp
index e2c4fc3b..20462f0a 100755
--- a/testsuite/systemtap.examples/io/disktop.stp
+++ b/testsuite/systemtap.examples/io/disktop.stp
@@ -16,9 +16,6 @@ global read_bytes,write_bytes
probe vfs.read.return {
if ($return>0) {
- dev = __file_dev($file)
- devname = __find_bdevname(dev,__file_bdev($file))
-
if (devname!="N/A") {/*skip read from cache*/
io_stat[pid(),execname(),uid(),ppid(),"R"] += $return
device[pid(),execname(),uid(),ppid(),"R"] = devname
@@ -29,9 +26,6 @@ probe vfs.read.return {
probe vfs.write.return {
if ($return>0) {
- dev = __file_dev($file)
- devname = __find_bdevname(dev,__file_bdev($file))
-
if (devname!="N/A") { /*skip update cache*/
io_stat[pid(),execname(),uid(),ppid(),"W"] += $return
device[pid(),execname(),uid(),ppid(),"W"] = devname
@@ -43,16 +37,21 @@ probe vfs.write.return {
probe timer.ms(5000) {
/* skip non-read/write disk */
if (read_bytes+write_bytes) {
-
- printf("\n%-25s, %-8s%4dKb/sec, %-7s%6dKb, %-7s%6dKb\n\n",ctime(gettimeofday_s()),"Average:",
- ((read_bytes+write_bytes)/1024)/5,"Read:",read_bytes/1024,"Write:",write_bytes/1024)
+ printf("\n%-25s, %-8s%4dKb/sec, %-7s%6dKb, %-7s%6dKb\n\n",
+ ctime(gettimeofday_s()),"Average:",
+ ((read_bytes+write_bytes)/1024)/5,"Read:",
+ read_bytes/1024,"Write:",write_bytes/1024)
/* print header */
- printf("%8s %8s %8s %25s %8s %4s %12s\n","UID","PID","PPID","CMD","DEVICE","T","BYTES")
+ printf("%8s %8s %8s %25s %8s %4s %12s\n",
+ "UID","PID","PPID","CMD","DEVICE","T","BYTES")
}
/* print top ten I/O */
foreach ([process,cmd,userid,parent,action] in io_stat- limit 10)
- printf("%8d %8d %8d %25s %8s %4s %12d\n",userid,process,parent,cmd,device[process,cmd,userid,parent,action],action,io_stat[process,cmd,userid,parent,action])
+ printf("%8d %8d %8d %25s %8s %4s %12d\n",
+ userid,process,parent,cmd,
+ device[process,cmd,userid,parent,action],
+ action,io_stat[process,cmd,userid,parent,action])
/* clear data */
delete io_stat