I've just recently started working with DTrace and one of the first  
issues I've run across is the difficulty in following child processes  
when instrumenting user space. I've seen some scraps here and there  
about how to use the pid provider together with the proc or syscall  
provider to pstop, instrument, and pstart child processes, but there  
are some additional cautionary notes indicating that this is slightly  
more complex than it might appear at first blush. (Namely: the rtld  
has to complete some degree of initial linking to enable library- 
qualified probes properly, and the mechanics haven't been explained  
adequately that I feel this is something I can work out for myself.  
Has anyone been able to do this back-to-front such that they can  
provide something of a recipe for how to do this? I realise that this  
is somewhat un-DTrace like at some basic level, at least with this  
kind of implementation. If the approach is misconceived and another  
alternative available, I'm happy to be pointed in the right direction.)

Second: I'm a bit confused about how to grab userland data into dtrace  
buffers, with or without pointers. There's a rather jumbled example on  
the "Gotcha: misuse of copyin" slide from the "Advanced DTrace"  
presentation 
(http://kr.sun.com/developers/solaris/techdocs/dtrace_tips_public.pdf 
  -- there's some basic syntax errors here, minimally at the level of  
some missing grouping symbols, that I've tried unsuccessfully to clean  
up), and the other examples of dereferencing from the docs (the  
chapter from the manual on documenting user apps that references  
write(), the example for uname() from 
http://learningsolaris.com/docs/dtrace_course.2005.8.18.pdf) 
. I tried something very much like Adam's uname() example to try to  
instrument calls to getservyname_r() and getservbyport_r(), but  
something of it has eluded me and a far more skilled colleague. I have  
a sinking suspicion that this is far simpler than I've flattered  
myself into thinking it's not.

Cheers,
Bayard
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to