Last active
September 5, 2022 13:22
-
-
Save szaydel/4aa0fa6e8f837f636d16df78ba99aa08 to your computer and use it in GitHub Desktop.
Script enables monitoring of the TUR commands, their latency and errors returned from the calls.
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 -Cs | |
#pragma D option quiet | |
#define SD_TO_DEVINFO(un) ((struct dev_info *)((un)->un_sd->sd_dev)) | |
#define DEV_NAME(un) \ | |
stringof(`devnamesp[SD_TO_DEVINFO(un)->devi_major].dn_name) /* ` */ | |
#define DEV_INST(un) (SD_TO_DEVINFO(un)->devi_instance) | |
::sd_send_scsi_TEST_UNIT_READY:entry { | |
self->un = args[0]->ssc_un; | |
self->start = timestamp; | |
} | |
::sd_send_scsi_TEST_UNIT_READY:return /self->un/ { | |
@ts[DEV_INST(self->un)] = quantize(timestamp - self->start); | |
@[DEV_INST(self->un), args[1]] = count(); | |
} | |
tick-5sec { | |
printa("device=sd%d err=%d %@d\n", @); | |
trunc(@); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment