Last active
September 5, 2022 13:21
-
-
Save szaydel/926fd56ba5b89459b26339c9e7dcf15a to your computer and use it in GitHub Desktop.
This file contains hidden or 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) | |
#define SD_GET_XBUF(bp) ((struct sd_xbuf *)((bp)->b_private)) | |
#define SD_GET_UN(bp) ((SD_GET_XBUF(bp))->xb_un) | |
:sd:sdintr:entry { | |
this->bp = (struct buf *)args[0]->pkt_private; | |
this->un = SD_GET_UN(this->bp); | |
this->un_max_xfer_size = this->un->un_max_xfer_size; | |
this->devname = DEV_NAME(this->un); | |
this->inst = DEV_INST(this->un); | |
@[this->devname, this->inst, this->un_max_xfer_size] \ | |
= count(); | |
} | |
END { | |
printf("instance\txfer sz \tcount\n"); | |
printa("%s%-8d\t%-8d\t%-8@d\n", @); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment