On Thu, Jan 05, 2006 at 09:07:31AM -0800, Brian wrote:> I know I can check the path of a file being opened with arg0 of the
> open function but is there a way to list all open files of a process
> when a read:entry probe is fired from it?
There''s no simple way to perform that sort of iteration with DTrace,
but
you could invoke the pfiles(1) command in user-land like this:
syscall::read:entry
/execname == "foo"/
{
stop();
system("pfiles %d", pid);
system("prun %d", pid);
}
You''ll obviously need destructive actions enabled to get this to work
so
be careful -- you could get into trouble if, for example, you tried to
stop the dtrace command itself.
Adam
--
Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl