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/bin/env bash | |
runtime=60 | |
interval=10 | |
while getopts i:t: name; do | |
case $name in | |
i) interval="$OPTARG";; | |
t) runtime="$OPTARG";; | |
?) printf "Usage: %s: [-i <value>] [-t <value>]\n" "$0" |
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) | |
#define DEVI_ADDR(un) (SD_TO_DEVINFO(un)->devi_addr_buf) |
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 NSECS_IN_MSEC 1000000 | |
:zfs:dmu_tx_wait:entry { | |
self->in = timestamp; | |
self->spa = (string)((char *)args[0]->tx_pool->dp_spa->spa_name); | |
} | |
:zfs:dmu_tx_wait:return /self->in/ { | |
this->delta = timestamp - self->in; |
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 | |
#include <sys/scsi/scsi_pkt.h> /* command completion defines */ | |
#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) |
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) |
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) | |
::sd_send_scsi_TEST_UNIT_READY:entry { | |
self->un = args[0]->ssc_un; |
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
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
int touch_file(const char *prefix, const char *suffix, size_t index) { | |
char filename[1024] = {0}; |
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 -qCs | |
#define NT_STATUS_WRONG_PASSWORD 0xC000006A | |
#define NT_STATUS_LOGON_FAILURE 0xC000006D | |
BEGIN | |
{ | |
printf("%-32s %s\n", "USER", "IP"); | |
} |
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
#include <assert.h> | |
#include <ctype.h> | |
#include <ifaddrs.h> | |
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <arpa/inet.h> | |
#include <sys/socket.h> |
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
dtrace -qn ' | |
::sdopen:entry { self->in_open = 1; } | |
::ddi_get_soft_state:entry /self->in_open/ { self->inst = args[1]; } | |
::ddi_get_soft_state:return /self->in_open/ { | |
printf("sd%d %d\n", self->inst, ((struct sd_lun *)args[1])->un_detach_count); | |
self->in_open = 0; | |
self->inst = 0; | |
}' |
NewerOlder