[dtrace-discuss] Dtrace "fork()-o-meter" ...

Roland Mainz roland.mainz at nrubsig.org
Tue Jan 16 03:08:40 PST 2007


Adam Leventhal wrote:
> On Sat, Jan 13, 2007 at 10:51:15PM +0100, Roland Mainz wrote:
> > > syscall::*fork*:entry
> >
> > Note that just catching |fork()| is not enougth since some shells may
> > use newer ways to spawn children (like |posix_spawn()| (if available and
> > correctly working)).
> 
> Care to guess how posix_spawn is implemented?

I know... I know... I was more thinking about putting
breakpoints/trappoints for the |fork()| and |vfork()| symbols won't help
anymore since there are now more calls to watch (BTW/offtopic: Without
looking at the source... was /usr/bin/truss updated to check for
|posix_spawn()| ?) ...

> That said, proc:::create might
> be a more stable choice.
> 
> > Grumpf... ten curses into the direction of the person who designed
> > "dtrace"'s "-c" option like that... xx@@@!!!... ;-(
> 
> I thought that designing the rest of DTrace might have let us off the hook...

... right... maybe the curses were aimed at the wrong persons... sorry
for that.

> > Usual workaround (for shells) is to provide an EOF (or better:
> > end-of-arguments) marker (and treat all arguments after this marker as
> > "normal" ones again). This solution could be used for both the argument
> > list after "-c" and the arguments passed to the Dtrace script. But I
> > guess we can't fix that anymore and now have to live with this
> > xx@@@!!!... ;-(
> 
> On the plus side, at least we don't have to suffer that EOF xx@@@!!!

Ok... do you have any suggetions how "dtrace"'s "-c" option could be
fixed ? A possible option would be to use libshell (e.g. let a shell
interpret the argument followed by "-c") and intercept
|libast::ast_procrun()| to catch the child process creation. Would that
work (the alternatives include "some kind of handcrafted parser which
tries to emulate a shell" and "ignore the problem"... ;-( ) ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)


More information about the dtrace-discuss mailing list