Hi,
I am new to DTrace and am facing some problem while using the prustat
script.
When I execute the following command I am getting the message displayed
and the dtrace script
is recording data continuously instead of once every 5 seconds as it
should do.
Because of this problem, I am getting a file in GB''s by the end of the
test which takes about 2 hours.
Also it is not recording Disk and Net usage properly.
Thanks in advance for any help.
bash-3.00$ ./prustat 5 > aa
dtrace: invalid probe specifier
/*
** The following is a trimmed version of two seperate DTrace scripts:
**
** socketsnoop.d - snoop TCP network socket traffic by process.
** This is intended to identify the process responsible
** for network traffic. Written in DTrace (Solaris 10 build 63).
**
** iosnoop.d - A program to print I/O events as they happen, with useful
** details such as UID, PID, inode, command, etc.
** Written in DTrace (Solaris 10 build 63).
**
*/
#pragma D option quiet
/*
** --- TIMESTAMPS ---
*/
dtrace:::BEGIN {
printf("B %d\n",timestamp);
/* last is used as a timestamp to the disk request, OR,
to the last disk completion. This is needed to avoid
over counting disk times due to disk buffers (queues),
however remains a minor simplification. */
last = timestamp;
}
profile:::tick-1sec {
/* heartbeat */
printf("T %d\n",timestamp);
}
/*
** --- DISK ----
*/
/*
** Store entry details
*/
io:::start
{
this->dev = args[0]->b_edev;
this->blk = args[0]->b_blkno;
start_uid[this->dev,this->blk] = curpsinfo->pr_euid;
start_pid[this->dev,this->blk] = pid;
start_comm[this->dev,this->blk] = (char *)curpsinfo->pr_fname;
last = timestamp;
}
/*
** Process completion
*/
io:::done
{
/* fetch entry values */
this->dev = args[0]->b_edev;
this->blk = args[0]->b_blkno;
this->delta = timestamp - last;
this->suid = start_uid[this->dev,this->blk];
this->spid = start_pid[this->dev,this->blk];
this->scomm = start_comm[this->dev,this->blk];
/* memory cleanup */
start_uid[this->dev,this->blk] = 0;
start_pid[this->dev,this->blk] = 0;
start_comm[this->dev,this->blk] = 0;
last = timestamp;
}
/*
** Print event details
*/
io:::done
{
printf("D %d %d %d %d %s\n",
this->suid,this->spid,this->delta,args[0]->b_bcount,
this->scomm == 0 ? "." : stringof(this->scomm));
}
/*
** --- NETWORK ----
*/
/*
** Store Write Values
*/
fbt:ip:tcp_output:entry
{
self->uid = curpsinfo->pr_euid;
self->pid = pid;
self->comm = (char *)curpsinfo->pr_fname;
self->size = msgdsize(args[1]);
self->ok = 1;
}
/*
** Store Read Values
*/
fbt:sockfs:sotpi_recvmsg:entry
{
self->uid = curpsinfo->pr_euid;
self->pid = pid;
self->comm = (char *)curpsinfo->pr_fname;
/* We track the read request (man uio), */
self->uiop = (struct uio *) arg2;
self->residual = self->uiop->uio_resid;
/* The following ensures the type is AF_INET (sys/socket.h), */
this->sonode = (struct sonode *)arg0;
self->ok = (int)this->sonode->so_type == 2 ? 1 : 0;
}
fbt:sockfs:sotpi_recvmsg:return
/arg0 != 0 && self->ok/
{
/* calculate successful read size */
self->size = self->residual - self->uiop->uio_resid;
}
/*
** Print output
*/
fbt:ip:tcp_output:entry, fbt:sockfs:sotpi_recvmsg:return
/self->ok/
{
printf("N %d %d %d %s\n",self->uid,self->pid,
self->size,stringof(self->comm));
self->ok = 0;
self->uid = 0;
self->pid = 0;
self->comm = 0;
self->size = 0;
self->residual = 0;
self->uiop = 0;
}
: probe description io:::start does not match any probes
Regards,
Ramesh P S
Ramesh Polepalli
mFormation Technologies Inc.
Direct Line: +91 80 6620 5939
Switchboard: +91 80 6620 5900
http://www.mformation.com
Visit us at CTIA in Orlando, Hall A3, booth 1683, from March 27-29, Orange
County Convention Center, Orlando, FL, to find out how MFORMATION can help you
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070323/5e365807/attachment.html>