On Thu, Nov 19, 2009 at 02:02:53PM -0500, Peter Shoults wrote:
> I suspect it is to stop the child process before it goes and does
> whatever it is that we might want to capture. 

That's correct.

> I think the system() call
> has something to do with getting it going again, but can't find any info
> about system() yet.

system causes the dtrace userland process to fork and exec a command string.
Typically, you either do:

        stop();
        system("prun %d", pid);

or:

        stop();
        system("/path/to/dtrace/script -p %d", pid);

Both prun and dtrace will set the process running.

Cheers,
- jonathan

> pete
> 
> On 11/19/09 13:55, Max Levine wrote:
> > why the need for a  stop() in that script ?
> >
> > On Thu, Nov 19, 2009 at 12:13 PM, Phil Harman <phil.har...@gmail.com> wrote:
> >   
> >> Check out this blog post from Chris Gerhard ...
> >>
> >> http://blogs.sun.com/chrisg/entry/follow_fork_for_dtrace_pid
> >>
> >> Peter Shoults wrote:
> >>     
> >>> Hi,
> >>>
> >>> I am tracking down a problem and would like to know how I can follow a
> >>> forked process with my dtrace script, or how I can trace a dynamic
> >>> library.
> >>>
> >>> Here is the problem.  I am tracing dtlogin, and specifically I am trying
> >>> to determine what error libpkcs11`<routine> is returning.  It turns out
> >>> dtlogin forks a lot of processes, and I believe the second forked
> >>> process is the one that winds up having a failing call to
> >>> libpkcs11`<routine>.  Of course, when I start dtrace, the forked process
> >>> is not yet created, so I can not specify that.  Also, it appears I can
> >>> not just trace on libpkcs11`<routine> as libpkcs11 is only traceable
> >>> with a process that has it loaded.
> >>>
> >>> So, the questions are:
> >>>
> >>> How can I get dtrace to follow and trace forked processes?
> >>> How can I get dtrace to trace anything with libpkcs11 for any process
> >>> that is running or will be created and running in the future on a system?
> >>>
> >>> Peter
> >>>
> >>>
> >>> _______________________________________________
> >>> dtrace-discuss mailing list
> >>> dtrace-discuss@opensolaris.org
> >>>
> >>>       
> >> _______________________________________________
> >> dtrace-discuss mailing list
> >> dtrace-discuss@opensolaris.org
> >>
> >>     
> 
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss@opensolaris.org
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to