Note that you'll need a pre-release build of JDK7 to use these static probes - they are no available in JDK6 or earlier.

--
- Keith

krishnan parthasarathi - Sun Microsystems - Bangalore India wrote:
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]

_______________________________________________
dtrace-discuss mailing list
[email protected]
  • [dtrace-discus... Ajit Bansode
    • Re: [dtra... krishnan parthasarathi - Sun Microsystems - Bangalore India
      • Re: [... Ajit Bansode
        • R... krishnan parthasarathi - Sun Microsystems - Bangalore India
      • Re: [... Keith McGuigan
        • R... Ajit Bansode
          • ... Ajit Bansode
            • ... krishnan parthasarathi - Sun Microsystems - Bangalore India
              • ... krishnan parthasarathi - Sun Microsystems - Bangalore India
            • ... Pramod Batni
              • ... Ajit Bansode
                • ... Ajit Bansode
                • ... krishnan parthasarathi - Sun Microsystems - Bangalore India
                • ... Pramod Batni

Reply via email to