DEV Community

Santhosh Balasa
Santhosh Balasa

Posted on

Sample Dtrace in Linux

#!/usr/sbin/dtrace -s
#pragma D option quiet

BEGIN
{
        printf("Starting vxdisk resize analysis at %lu", timestamp);
        printf("\n");
}

END
{
        printf("Ending vxdisk resize analysis at %lu", timestamp);
        printf("\n");
}


#!/usr/sbin/dtrace -s
#pragma D option quiet

fbt:vxio:volsp_strategy:entry
{
        printf("%Y vm issued IO buf %p\n", walltimestamp, arg0);
        self->buf=arg0;
}

fbt::ldi_strategy:entry
/self->buf == arg0/
{
        printf(" %Y ldi_strategy received vm buf %p\n", walltimestamp, arg0);
}

fbt::ldi_strategy:return
/self->buf == arg1/
{
        printf(" %Y ldi_strategy returned vm buf %p\n", walltimestamp, arg1);
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)