Hi Ajit, You can add static dtrace probes into your code, to get a accurate measure of time spent in the 'real CPU intensive' section of the code. eg., DTRACE_PROBE_START <code snippet to time> DTRACE_PROBE_END
For adding probes in your java application see, http://blogs.sun.com/kamg/entry/announcing_statically_defined_dtrace_probes Regards, Krishnan On Fri, 2009-05-15 at 02:40 -0700, Ajit Bansode wrote: > Hi, > > I need help in calculating Java method time-stamp in following fashion. > Consider following method example. > > long method3(long stop) { > try { > Thread.sleep(1500); > } catch (Exception e) { > > } > //////////////////// real CPU intensive operation /////////////////////////// > for (int i = 1; i < stop; i++) { > stop = stop * stop * i; > }; > return stop; > } > > For above method, I can get time-stamp by using "vtimestamp" and > method-entry/return probes. > But I also want to how much time it is spending as idle ( in above case 1500 > ms) and how much in real CPU intensive operation. > > Is there any way to do this? > Help appreciated. > > Thanks, > Ajit _______________________________________________ dtrace-discuss mailing list [email protected]
