Skip to content

Instantly share code, notes, and snippets.

@szaydel
Last active March 22, 2022 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szaydel/38f560e9b200d7364218e8d90da845ad to your computer and use it in GitHub Desktop.
Save szaydel/38f560e9b200d7364218e8d90da845ad to your computer and use it in GitHub Desktop.
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;
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment