[dtrace-discuss] help with listing called functions

Enda o'Connor - Sun Microsystems Ireland - Software Engineer Enda.Oconnor at Sun.COM
Tue Aug 15 09:55:06 PDT 2006


Hi
I am trying to grab a flow controlled list of the functions under main 
that patchadd calls when it is run


# which  patchadd
/usr/sbin/patchadd
# ls -l /usr/sbin/patchadd
lrwxrwxrwx   1 root     root          16 Aug 15 11:14 /usr/sbin/patchadd 
-> ../lib/patch/pdo
# file /usr/lib/patch/pdo
/usr/lib/patch/pdo:    ELF 32-bit MSB executable SPARC Version 1, 
dynamically linked, stripped
#

So I have the following:


# cat /export/pdo.d
#pragma D option flowindent

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

pid$target::main:return
/self->trace/
{
  self->trace = 0;
}

pid$target:pdo::entry,
pid$target:pdo::return
/self->trace/
{
 }
pid$target:a.out::entry,
pid$target:a.out::return
/self->trace/
{
 }
#


I would have though that this would then generate a listing of the 
functions called from main in 'pdo', but it does not,

# dtrace -s /export/pdo.d -c "/usr/sbin/patchadd /export/119117-21"

which gives
....
Checking installed patches...
CPU FUNCTION
  0  -> main
  0   | main:entry
  0    -> xcalloc
  0     | xcalloc:entry
  0     | xcalloc:return
  0    <- xcalloc
  0    -> xcalloc
  .......

but main calls patchadd() pretty much at the start of main


What is wrong with my approach to this?


Enda






More information about the dtrace-discuss mailing list