DEV Community

loading...

Sample Dtrace in Linux

Santhosh Balasa
Passionate Senior Full Stack Developer around 10+ yrs of IT experience.
・1 min read
#!/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

Discussion (0)