Created
February 17, 2017 14:12
-
-
Save genisd/72db1d98b64d9d7127570fff7d4b89f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -qs | |
#pragma D option aggsize=8m | |
#pragma D option bufsize=8m | |
#pragma D option dynvarsize=8m | |
inline int BIO_READ=0x01; | |
inline int BIO_WRITE=0x02; | |
inline int BIO_DONE=0x02; | |
fbt::zfs_freebsd_read:entry | |
{ | |
@zr["ZFS READ"] = quantize(args[0]->a_uio->uio_resid); | |
} | |
fbt::zfs_freebsd_write:entry | |
{ | |
@zw["ZFS WRITE"] = quantize(args[0]->a_uio->uio_resid); | |
} | |
io:::start | |
/arg0 && args[0]->bio_cmd & BIO_READ/ | |
{ | |
@vr["DSK READ"] = quantize(args[0]->bio_bcount); | |
} | |
io:::start | |
/arg0 && args[0]->bio_cmd & BIO_WRITE/ | |
{ | |
@vw["DSK WRITE"] = quantize(args[0]->bio_bcount); | |
} | |
tick-5s | |
{ | |
printf("\nTIME %d %Y\n", walltimestamp / 1000000000, walltimestamp); | |
printa(@zr); | |
printa(@zw); | |
printa(@vr); | |
printa(@vw); | |
trunc(@zr); | |
trunc(@zw); | |
trunc(@vr); | |
trunc(@vw); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment