[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-mdb-discuss
Subject:    [mdb-discuss] Re: [osol-code] Tracing arbitrary functions
From:       sean.mcgrath () sun ! com (Sean McGrath - Sun Microsystems Ireland)
Date:       2005-11-04 8:24:20
Message-ID: 20051104162543.GD22051 () greyarea
[Download RAW message or body]



DTrace.


/begin script
#!/usr/sbin/dtrace -s

#pragma D option flowindent

pid$target::main:entry
{
	self->follow = 1;
}

pid$target:::entry,
pid$target:::return
/self->follow/
{
}

pid$target::main:return
{
	self->follow = 0;
}
/end script

# dtrace -o echo.d.out -s d1.d -c /bin/echo
dtrace: script 'd1.d' matched 5814 probes

dtrace: pid 27062 has exited
# 
# head -10 echo.d.out
CPU FUNCTION                                 
  1  -> main                                  
  1    -> elf_rtbndr                          
  1      -> elf_bndr                          
  1        -> enter                           
  1          -> rt_bind_guard                 
  1            -> _ti_bind_guard              
  1            <- _ti_bind_guard              
  1          <- rt_bind_guard                 
  1          -> rt_mutex_lock                 
...
.
.


Matty stated:
< 
< Howdy,
< 
< Does anyone happen to know if there is a utility that will build a call 
< tree for an application? I am debugging a large client-server application 
< written in C, and would like to see the complete call path from main() to 
< exit(). I have been able to determine shared library calls with truss -u,
< but the server core contains numerous functions that I would like to
< dump as well. While I can always add lots of printf()/write() calls to the 
< code, I thought I would check to see if a better method exists.
< 
< Thanks for any insight,
< - Ryan
< 
< --
< UNIX Administrator
< http://daemons.net/~matty
< _______________________________________________
< opensolaris-code mailing list
< opensolaris-code@opensolaris.org
< https://opensolaris.org:444/mailman/listinfo/opensolaris-code

-- 
Sean.
.
sean DoT mcgrath At sun.com http://blogs.sun.com/smg
http://www.sun.com/software/solaris

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic