Ralph Böhme
2010-07-13 11:10:45 UTC
Dtracers,
I'm investigating some performance issues using a simple dtrace script which collects read,write,stat,... syscall data. This works fine and gives me some good data.
Unfortunately the app I'm tracing is concurrently doing file IO and IO on a UNIX domain socket. As I'm only interested in data for file IO, I'm investigating how I can modify my syscall probes. I'm currenty doing stuff like this:
/*
* Save syscall entry info
*/
syscall::*stat*:entry,
syscall::*open*:entry,
syscall::*read*:entry,
syscall::*write*:entry,
syscall::getdents*:entry,
syscall::*sync*:entry
/((OPT_command || OPT_pid) && pid == $target) || (OPT_name && execname == NAME)/
{
/* set start details */
self->start = timestamp;
self->vstart = vtimestamp;
}
/*
* Print return data
*/
syscall::*stat*:return,
syscall::*open*:return,
syscall::*read*:return,
syscall::*write*:return,
syscall::getdents*:return,
syscall::*sync*:return
/self->start/
{
/* calculate elapsed time */
this->elapsed = (timestamp - self->start) / 1000;
self->start = 0;
this->cpu = (vtimestamp - self->vstart) / 1000;
self->vstart = 0;
@count[probefunc] = count();
@sum[probefunc] = sum(this->elapsed);
@elapsed[probefunc] = quantize(this->elapsed);
@oncpu[probefunc] = quantize(this->cpu);
@avg[probefunc] = avg(this->elapsed);
}
Any hint for me? Thanks!
-Ralph
I'm investigating some performance issues using a simple dtrace script which collects read,write,stat,... syscall data. This works fine and gives me some good data.
Unfortunately the app I'm tracing is concurrently doing file IO and IO on a UNIX domain socket. As I'm only interested in data for file IO, I'm investigating how I can modify my syscall probes. I'm currenty doing stuff like this:
/*
* Save syscall entry info
*/
syscall::*stat*:entry,
syscall::*open*:entry,
syscall::*read*:entry,
syscall::*write*:entry,
syscall::getdents*:entry,
syscall::*sync*:entry
/((OPT_command || OPT_pid) && pid == $target) || (OPT_name && execname == NAME)/
{
/* set start details */
self->start = timestamp;
self->vstart = vtimestamp;
}
/*
* Print return data
*/
syscall::*stat*:return,
syscall::*open*:return,
syscall::*read*:return,
syscall::*write*:return,
syscall::getdents*:return,
syscall::*sync*:return
/self->start/
{
/* calculate elapsed time */
this->elapsed = (timestamp - self->start) / 1000;
self->start = 0;
this->cpu = (vtimestamp - self->vstart) / 1000;
self->vstart = 0;
@count[probefunc] = count();
@sum[probefunc] = sum(this->elapsed);
@elapsed[probefunc] = quantize(this->elapsed);
@oncpu[probefunc] = quantize(this->cpu);
@avg[probefunc] = avg(this->elapsed);
}
Any hint for me? Thanks!
-Ralph
--
This message posted from opensolaris.org
This message posted from opensolaris.org