If there is a better place to report this please let me know.

When adding the inclusive method execution time it is required to use the 
complete method signature. The problem is likely to be present in other scripts 
but I've verified it in the Java related scripts that calculate inclusive and 
exclusive execution times. The problem is caused by tracing overloaded methods, 
a fairly common occurrence in Java.

Given the following Java program:

public class Problem {

public static void main(String[] args) {
  action(42);
  try{ Thread.sleep(2000); } catch(Exception e) {}
}

public static void action(int x) {
  action("duke");
  try{ Thread.sleep(2000); } catch(Exception e) {}
}

public static void action(String s) {
  try{ Thread.sleep(6000); } catch(Exception e) {}
}

}

The relevant output of j_calltime.d would be:
Top 10 inclusive method elapsed times (us),
      PID TYPE       NAME                                                TOTAL
     1346 method     sun/misc/Launcher.<init>                          1526459
     1346 method     sun/misc/Launcher.<clinit>                        1527443
     1346 method     java/lang/ClassLoader.initSystemClassLoader       1530208
     1346 method     java/lang/ClassLoader.getSystemClassLoader        1530537
     1346 method     java/net/URL.<init>                               1558066
     1346 method     java/lang/ClassLoader.loadClass                   3195875
     1346 method     java/security/AccessController.doPrivileged       3578758
     1346 method     java/lang/Thread.sleep                            9942087
     1346 method     Problem.main                                      9955080
     1346 method     Problem.action                                   14025628

Notice how action is listed as having a longer execution time than it's caller.


--
This message posted from opensolaris.org
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to