I have a simple script, adapted from something I found online, to report file
read and writes, along with FD and a timestamp. dtrace runs the script and uses
very little CPU ~2%. If I change the bufpolicy to ring and run the script dtrace
CPU usage jumps to near 50% on a 2 CPU system (as reported by prstat). Is there
something in my script that causes this problem, and hints? - Chris
-------------
#!/usr/sbin/dtrace -s
#pragma D option bufpolicy=switch
#pragma D option bufsize=10M
#pragma D option bufresize=manual
#pragma D option quiet
syscall::read:entry
/execname != "dtrace"/
{
self->event = "READ";
}
syscall::write:entry
/execname != "dtrace"/
{
self->event = "WRITE";
}
syscall::read:entry, syscall::write:entry
/execname != "dtrace"/
{
printf("%s\",\"FS\",\"%s\",\"%d\",\"-\",\"%d\",\"\n",
execname, self->event, arg0, timestamp);
self->event = 0;
}
This message posted from opensolaris.org