On Mon, Nov 24, 2008 at 06:03:44AM -0800, debabrata das wrote:
> Hi all,
> 
> I am new in dtrace. But I have urgent requirement. I would like to know a 
> name of program which is responsible for updating a file. I have written the 
> small following program :
> 
> #!/usr/sbin/dtrace -s
> 
> syscall::open*:entry
> /pid == $1/
> {
>        printf("%s %s %d", execname, copyinstr(arg0), pid);
> }
> 
> Now if I ruun this then I get following output :
> 
> -bash-3.00$ ./text.d | grep deba
> dtrace: script './text.d' matched 2 probes
>   8    402                     open64:entry bash /tmp/deba.txt 18786
> 
> Now I want to know which script is updating this file. I would like to the 
> see the output of "ptree 18786". I am not sure how to this structure of ptree 
> or the name of the script.

you want curpsinfo->pr_psargs;  it's a string which contains the string that
"ptree" outputs, which is the "argv" array, separated by spaces, truncated
to 80 characters.

Cheers,
- jonathan

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

Reply via email to