Skip to content

Instantly share code, notes, and snippets.

@jjelinek
Last active August 29, 2015 13:57
Show Gist options
  • Save jjelinek/9516440 to your computer and use it in GitHub Desktop.
Save jjelinek/9516440 to your computer and use it in GitHub Desktop.
dtrace destroy
#pragma D option quiet
fbt::zfs_domount:entry
{
printf("%s 0x%p %s\n", probefunc, arg0, stringof(arg1));
vfs = (vfs_t *)arg0;
self->vfs = vfs;
}
fbt::zfsvfs_create:entry
{
self->zvfs = (zfsvfs_t **)arg1;
}
fbt::zfsvfs_create:return
{
/* self->list = (list_t *)&(*self->zvfs)->z_all_znodes; */
printf("%s 0x%p\n", probefunc, *self->zvfs);
}
fbt::zfs_umount:entry
{
printf("%s -> 0x%p %d %s\n", probefunc, arg0, ((vfs_t *)arg0)->vfs_count,
stringof(((vfs_t *)arg0)->vfs_vnodecovered->v_path));
self->umvfs = (vfs_t *)arg0;
}
fbt::zfs_umount:return
{
printf("%s <- 0x%p %d %d\n", probefunc, self->umvfs,
self->umvfs->vfs_count, arg1);
}
fbt::zfsctl_umount_snapshots:entry
{
self->umsvfs = arg0;
}
fbt::zfsctl_umount_snapshots:return
{
printf("%s 0x%p %d\n", probefunc, self->umsvfs, arg1);
self->umsvfs = 0;
}
fbt::dsl_destroy_head:entry
{
printf("%s %s\n", probefunc, stringof(arg0));
}
fbt::zfs_znode_alloc:return
/arg1/
{
printf("0x%p %s 0x%p %s", arg1, probefunc,
((znode_t *)arg1)->z_zfsvfs->z_vfs, execname);
stack();
}
fbt::zfs_znode_free:entry
{
printf("0x%p %s 0x%p %s", arg0, probefunc,
((znode_t *)arg0)->z_zfsvfs->z_vfs, execname);
stack();
}
/* vfssw slot 8 is zfs */
fbt::closef:entry
/((file_t *)arg0)->f_vnode->v_vfsp->vfs_fstype == 8/
{
printf("%s 0x%p %d 0x%p\n", probefunc, ((file_t *)arg0)->f_vnode->v_data,
((file_t *)arg0)->f_vnode->v_count,
((file_t *)arg0)->f_vnode->v_vfsp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment