Logo Search packages:      
Sourcecode: visualvm version File versions  Download package

static void org::netbeans::lib::profiler::server::ProfilerRuntimeCPUFullInstr::methodEntry ( char  methodId  )  [inline, static]

Called upon entry into a non-root target application method

Definition at line 153 of file ProfilerRuntimeCPUFullInstr.java.

References org::netbeans::lib::profiler::server::ThreadInfo::inCallGraph, org::netbeans::lib::profiler::server::ThreadInfo::inProfilingRuntimeMethod, org::netbeans::lib::profiler::server::ThreadInfo::isInitialized(), org::netbeans::lib::profiler::server::ThreadInfo::rootMethodStackDepth, and org::netbeans::lib::profiler::server::ThreadInfo::stackDepth.

Referenced by rootMethodEntry().

                                                  {
        if (recursiveInstrumentationDisabled) {
            return; // See the comment at the recursiveInstrumentationDisabled variable declaration
        }

        ThreadInfo ti = ThreadInfo.getThreadInfo();

        if (ti.isInitialized() && ti.inCallGraph && (ti.rootMethodStackDepth > 0)) {
            if (ti.inProfilingRuntimeMethod > 0) {
                return;
            }

            ti.inProfilingRuntimeMethod++;
            //System.out.println("++++++methodEntry, depth = " + ti.stackDepth + ", id = " + (int) methodId);

            // See comment marked with (***)
            int methodIdInt = methodId&0xff;
            methodIdInt |= methodId&0xff00;
            
            // Now check if it's the first invocation of this method, and if so, perform instrumentation of nearest callees
            if (!instrMethodInvoked[methodIdInt]) {
                long absTimeStamp = Timers.getCurrentTimeInCounts();
                long threadTimeStamp = Timers.getThreadCPUTimeInNanos();
                externalActionsHandler.handleFirstTimeMethodInvoke(methodId);
                instrMethodInvoked[methodIdInt] = true; // Mark this method as invoked
                writeAdjustTimeEvent(ti, absTimeStamp, threadTimeStamp);
            }

            ti.stackDepth++;
            writeTimeStampedEvent(METHOD_ENTRY, ti, methodId);

            ti.inProfilingRuntimeMethod--;
        }
    }


Generated by  Doxygen 1.6.0   Back to index