[dtrace-discuss] please help: dvm related

Jon Haslam Jonathan.Haslam at Sun.COM
Mon Sep 24 06:20:52 PDT 2007


Hi Ajit,

> I am using following code to get all method names for an application.
>
> dvm$1:::method-entry
> {
>   printf("%s\t%s\n",copyinstr(arg0),copyinstr(arg1));
> }
> It gives something like.......
> java/lang/String        length
> com/ajit/mySend/MyMsg         send 
> etc....
>
> but I want to know about methods from every class of com/ajit/mySend/ only.
> What predicate should I use for this?

You should be able to do something like:

dvm$target:::method-entry
/dirname(copyinstr(arg0)) == "com/ajit/mySend"/
{
        @foo[strjoin(strjoin(basename(copyinstr(arg0)), "."),
            copyinstr(arg1))] = count();
}

END
{
        printa("%-60s %10 at d\n", @foo);
}

which will give you a string in the form of class.method. Tailor it as
needs be.

> I also want to know about following error.
> dtrace: error on enabled probe ID 1 (ID 47638: dvm12522:libdvmti.so: _method_entry :method-entry): out of scratch space in action #2 at DIF offset 28

You're probably just need to increase the size of your principal buffers.
Try adding '-x bufsize=20m' to your dtrace(1M) command line or you can
add a #pragma into your D script in the form of:

#pragma D option bufsize=20m


Jon.



More information about the dtrace-discuss mailing list