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?
Can't you use the proc provider?

http://wikis.sun.com/display/DTrace/proc+Provider

There's an example there that stashes the parent's execname (in your case dtlogin) to find out what each parent calls and how often. It's not what you want but demonstrates tracing across the fork/exec boundary. I think you could adapt that for your purpose?

As for tracing libpkcs11 can you not construct a predicate based upon the dynamic library being loaded and that in turn enable the probes you want?

I'm probably very helpfully suggesting things here you've tried - apologies if that's the case.
Cheers
PT.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to