HI, I am new to dtrace. please tell me what is the problem with this choudhav at sx86qa1:/u/choudhav> cat Dtracedemo.java class Dtracedemo { private static long factorial(long i) { if ( i <= 1 ) return 1; return i*factorial(i-1); } public static void main(String args[]) { try { Thread.sleep(10000); } catch (InterruptedException e) { } int max = 1000; long i; long f[] = new long[max]; for ( i = 0; i < max; i++ ) { f[(int)i] = factorial(i); } System.out.println("Completed ok."); choudhav at sx86qa1:/u/choudhav> gnu time java Dtracedemo Completed ok. real 10.1 user 0.0 sys 0.0 choudhav at sx86qa1:/u/choudhav> setenv JAVA_TOOL_OPTIONS -Xrundvmti:all choudhav at sx86qa1:/u/choudhav> gnu time java -Xrundvmti:all Dtracedemo Picked up JAVA_TOOL_OPTIONS: -Xrundvmti:all Error occurred during initialization of VM Could not find agent library on the library path or in the local directory: dvmti real 0.0 user 0.0 sys 0.0 Actually, i am trying to do time analysis of dtrace. Thanks, Vikrant This message posted from opensolaris.org
Vikrant Kumar Choudhary wrote:> HI, > I am new to dtrace. please tell me what is the problem with this > choudhav at sx86qa1:/u/choudhav> cat Dtracedemo.java > class Dtracedemo { > private static long factorial(long i) { > if ( i <= 1 ) return 1; > return i*factorial(i-1); > } > public static void main(String args[]) { > try { > Thread.sleep(10000); > } > catch (InterruptedException e) { } > > int max = 1000; > long i; > long f[] = new long[max]; > > for ( i = 0; i < max; i++ ) { > f[(int)i] = factorial(i); > } > System.out.println("Completed ok."); > choudhav at sx86qa1:/u/choudhav> gnu time java Dtracedemo > Completed ok. > > real 10.1 > user 0.0 > sys 0.0 > choudhav at sx86qa1:/u/choudhav> setenv JAVA_TOOL_OPTIONS -Xrundvmti:all > choudhav at sx86qa1:/u/choudhav> gnu time java -Xrundvmti:all Dtracedemo > Picked up JAVA_TOOL_OPTIONS: -Xrundvmti:all > Error occurred during initialization of VM > Could not find agent library on the library path or in the local directory: dvmti"java -Xrundvmti:all Dtracedemo" failed because you probably forgot to add the path to libdvmti.so into LD_LIBRARY_PATH variable. See more details here: https://solaris10-dtrace-vm-agents.dev.java.net/ -katya> real 0.0 > user 0.0 > sys 0.0 > > Actually, i am trying to do time analysis of dtrace. > > Thanks, > Vikrant > >
thanks katya, for helping me. Actually the problem was LD_LIBRARY_PATH after setting my LD_LIBRARY_PATH , i reran the code and observed the following. choudhav at sx86qa1:/u/choudhav>gnu time java -Xrundvmti:all Dtracedemo Picked up JAVA_TOOL_OPTIONS: -Xrundvmti:all Completed ok. real 10.7 user 0.5 sys 0.0 Do anyone comment on this , why i am getting more time here. Thanks, Vikrant This message posted from opensolaris.org
dvmti agent uses JVMTI interface to request VM events and provide DTrace probes in the callback code for those events. This is why you see performance impact. Don''t use -Xrundvmti:all if you are not interested in all dvm probes. (all=unloads,allocs,stats,methods) -katya Vikrant Kumar Choudhary wrote:> thanks katya, for helping me. > Actually the problem was LD_LIBRARY_PATH > after setting my LD_LIBRARY_PATH , i reran the code and observed the following. > > choudhav at sx86qa1:/u/choudhav>gnu time java -Xrundvmti:all Dtracedemo > Picked up JAVA_TOOL_OPTIONS: -Xrundvmti:all > Completed ok. > > real 10.7 > user 0.5 > sys 0.0 > > Do anyone comment on this , why i am getting more time here. > > Thanks, > Vikrant > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org