Robert Milkowski
2007-Jan-29 14:14 UTC
[dtrace-discuss] proc:::create fires too many times
Hi. I''m missing something really obvious or... # dtrace -n proc:::create''/zonename == "test"/{@[execname,pid,ppid]=count();}'' -n tick-5s''{printa(@);}'' [...] wp-ldapreplika-t 16332 16326 279 It looks like probe proc:::create fired 279 times for pid 16332 being created from ppid 16326. System is Generic_118833-33 sun4v This message posted from opensolaris.org
Robert Milkowski
2007-Jan-29 14:41 UTC
[dtrace-discuss] Re: proc:::create fires too many times
Looks like pid and ppid are set differently in a contex of proc:::create # dtrace -n proc:::create''/zonename == "test"/{@[execname,args[0]->pr_pid,pid,args[0]->pr_ppid,ppid]=count();}'' -n tick-5s''{printa(@);}'' [...] wp-ldapreplika-t 4815 4417 4417 4400 1 wp-ldapreplika-t 4935 4417 4417 4400 1 wp-ldapreplika-t 4938 4417 4417 4400 1 wp-ldapreplika-t 4806 4417 4417 4400 1 wp-ldapreplika-t 4801 4417 4417 4400 1 so (psinfo_t *)->pr_pid is not the same as pid variable, and actually pid variable is equal to (psinfo_t *)->pr_pprid and I guess ppid is actualy (psinfo_t *)->pr_ppid of ppid. So it would explain a little bit why I saw proc::create firing so many time for the same pid - it wasn''t pid of created process. This message posted from opensolaris.org
Adam Leventhal
2007-Jan-29 16:25 UTC
[dtrace-discuss] Re: proc:::create fires too many times
Hey Robert, The proc:::create probe fires in the context of the parent of the newly created process so the pid and ppid you''ll see are those of the parent. If you think thhe documentation could be clearer on this point, feel free to file a bug in doc/dtrace. Adam On Mon, Jan 29, 2007 at 06:41:13AM -0800, Robert Milkowski wrote:> Looks like pid and ppid are set differently in a contex of proc:::create > > # dtrace -n proc:::create''/zonename == "test"/{@[execname,args[0]->pr_pid,pid,args[0]->pr_ppid,ppid]=count();}'' -n tick-5s''{printa(@);}'' > [...] > wp-ldapreplika-t 4815 4417 4417 4400 1 > wp-ldapreplika-t 4935 4417 4417 4400 1 > wp-ldapreplika-t 4938 4417 4417 4400 1 > wp-ldapreplika-t 4806 4417 4417 4400 1 > wp-ldapreplika-t 4801 4417 4417 4400 1 > > > so (psinfo_t *)->pr_pid is not the same as pid variable, and actually pid variable is equal to (psinfo_t *)->pr_pprid and I guess ppid is actualy (psinfo_t *)->pr_ppid of ppid. > > So it would explain a little bit why I saw proc::create firing so many time for the same pid - it wasn''t pid of created process. > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl