Last active
August 29, 2015 14:14
-
-
Save evansus/c7c7c5f3b0f6f9ff18cf to your computer and use it in GitHub Desktop.
zvol_io_size_histograms.d
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 -s | |
#pragma D option quiet | |
/* | |
* Sizes of all zvol I/O functions: | |
* net_lundman_zfs_zvol_device::doAsyncReadWrite | |
* net_lundman_zfs_zvol_device::doUnmap | |
* net_lundman_zfs_zvol_device::doDiscard | |
* zvol_read_iokit | |
* zvol_write_iokit | |
* zvol_unmap | |
* | |
* (Note: The upstream functions zvol_read() and zvol_write() | |
* are not used by the IOKit implementation) | |
*/ | |
dtrace:::BEGIN | |
{ | |
printf("Tracing for 10 seconds... Hit Ctrl-C to end.\n"); | |
} | |
tick-10000msec { | |
exit(0); | |
} | |
fbt::_ZN27net_lundman_zfs_zvol_device16doAsyncReadWriteEP18IOMemoryDescriptoryyP19IOStorageAttributesP19IOStorageCompletion:entry | |
{ | |
/* Get read/write byte count */ | |
@rw_sizes = quantize(arg3); | |
} | |
fbt::zvol_read_iokit:entry | |
{ | |
/* Get read byte count */ | |
@read_sizes = quantize(arg2); | |
} | |
fbt::zvol_write_iokit:entry | |
{ | |
/* Get write byte count */ | |
@write_sizes = quantize(arg2); | |
} | |
fbt::_ZN27net_lundman_zfs_zvol_device7doUnmapEP26IOBlockStorageDeviceExtentjj:entry | |
{ | |
/* Get doUnmap block count */ | |
@dounmap_sizes = quantize(arg2); | |
} | |
fbt::_ZN27net_lundman_zfs_zvol_device9doDiscardEyy:entry | |
{ | |
/* Get discard block count */ | |
@discard_sizes = quantize(arg2); | |
} | |
fbt::zvol_unmap:entry | |
{ | |
/* Get unmap block count */ | |
@unmap_sizes = quantize(arg2); | |
} | |
dtrace:::END | |
{ | |
printf("==============================================================\n"); | |
printf("\n%s\n", "zvol::doAsyncReadWrite block count"); | |
printa("%@d\n", @rw_sizes); | |
printf("==============================================================\n"); | |
printf("\n%s\n", "zvol_read_iokit size"); | |
printa("%@d\n", @read_sizes); | |
printf("==============================================================\n"); | |
printf("\n%s\n", "zvol_write_iokit size"); | |
printa("%@d\n", @write_sizes); | |
printf("==============================================================\n"); | |
printf("\n%s\n", "zvol::doUnmap block count"); | |
printa("%@d\n", @dounmap_sizes); | |
printf("==============================================================\n"); | |
printf("\n%s\n", "zvol::doDiscard block count"); | |
printa("%@d\n", @discard_sizes); | |
printf("==============================================================\n"); | |
printf("\n%s\n", "zvol_unmap size"); | |
printa("%@d\n", @unmap_sizes); | |
printf("==============================================================\n"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment