diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/systemtap.examples/ChangeLog | 4 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/io/disktop.stp | 21 |
2 files changed, 14 insertions, 11 deletions
diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index a43e32a7..3a0afda4 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,7 @@ +2008-10-27 William Cohen <wcohen@redhat.com> + + * io/disktop.stp: Make use of devname added to vfs tapset. + 2008-10-24 William Cohen <wcohen@redhat.com> * io/traceio.stp: 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 |