On Dec 23, 2011, at 13:29, Anne Adema <aron.ad...@gmail.com> wrote:

> Hi James,
> 
> What I'm looking for in a while true loop to see amount fopen calls for a 
> certain pid
> 
> while true
> do
> cmd for amount fopen call for certain pid dtrace script
> sleep 60
> done
> 
> or dtrace script with same loop
> 
> Gr Anne

If you want to monitor one or more processes to see what files they open and 
close over a given period (while being monitored), then that sort of thing is 
doable.  But just sampling at intervals to get a count won't work, unless you 
can find something in the program to read that gives you what you wanted.

You can use the pid provider to catch calls inside the application, and the 
profile provider to sample them.  Maybe that's what you're getting at.

Truss might be easier -- it can count calls into a library (fopen(3C) is in 
libc) and give statistics.

Can you explain why those other mechanisms don't work for you?  They look well 
suited to the task. I really do think that a higher level description of what 
you're trying to accomplish will be needed in order to get useful suggestions.


_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to