From: Petr L. <lu...@us...> - 2002-03-22 21:23:26
|
Update of /cvsroot/javaprofiler/library/src/prof In directory usw-pr-cvs1:/tmp/cvs-serv19839 Modified Files: prof_object.cpp prof_monitor.cpp prof_method.cpp Log Message: no message Index: prof_object.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/prof/prof_object.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** prof_object.cpp 10 Feb 2002 18:36:13 -0000 1.17 --- prof_object.cpp 22 Mar 2002 21:23:23 -0000 1.18 *************** *** 126,129 **** --- 126,133 ---- int numFrames = trace.num_frames; + if (!setup.alloc.linenoEnabled) + for (int i = 0; i < numFrames; i++) + frames[i].lineno = 0; + if (setup.alloc.threadsEnabled) { Index: prof_monitor.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/prof/prof_monitor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** prof_monitor.cpp 21 Nov 2001 22:31:44 -0000 1.4 --- prof_monitor.cpp 22 Mar 2002 21:23:23 -0000 1.5 *************** *** 101,104 **** --- 101,108 ---- } + if (!setup.mon.linenoEnabled) + for (int i = 0; i < numFrames; i++) + callFrames[i].lineno = 0; + MonStatData* stat; Index: prof_method.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/prof/prof_method.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** prof_method.cpp 28 Feb 2002 11:47:19 -0000 1.9 --- prof_method.cpp 22 Mar 2002 21:23:23 -0000 1.10 *************** *** 43,65 **** Synchronized sync( dataLock); ! JVMPI_CallFrame callFrame; ! JVMPI_CallTrace callTrace; ! callTrace.env_id = event->env_id; ! callTrace.num_frames = 1; ! callTrace.frames = &callFrame; ! jvmpiInterface->GetCallTrace( &callTrace, 1); ! if( callTrace.num_frames != 1) { ! PROF_ERROR( "METHOD ENTRY", "GetCallTrace failed"); ! return; ! } ! if( callFrame.method_id != event->u.method.method_id) { ! PROF_ERROR( "METHOD ENTRY", "callFrame.method_id != event->method.method_id"); ! return; } --- 43,73 ---- Synchronized sync( dataLock); ! jmethodID methodID = event->u.method.method_id; ! jint lineno = 0; ! if (setup.cpu.linenoEnabled || setup.cpu.callTreeLinenoEnabled) ! { ! JVMPI_CallFrame callFrame; ! JVMPI_CallTrace callTrace; ! callTrace.env_id = event->env_id; ! callTrace.num_frames = 1; ! callTrace.frames = &callFrame; ! jvmpiInterface->GetCallTrace( &callTrace, 1); ! if( callTrace.num_frames != 1) { ! ! PROF_ERROR( "METHOD ENTRY", "GetCallTrace failed"); ! return; ! } ! if( callFrame.method_id != methodID) { ! PROF_ERROR( "METHOD ENTRY", "callFrame.method_id != event->method.method_id"); ! return; ! } ! ! lineno = callFrame.lineno; } *************** *** 72,80 **** } jlong entryTime = jvmpiInterface->GetCurrentThreadCpuTime(); ! thread->stack.push( callFrame, entryTime); if( setup.cpu.callTreeEnabled) { CallTreeItem* current = thread->callTree.current; CallTreeItem* p = current; --- 80,102 ---- } + JVMPI_CallFrame tempFrame; + + tempFrame.method_id = methodID; + + if (setup.cpu.linenoEnabled) + tempFrame.lineno = lineno; + else + tempFrame.lineno = 0; + jlong entryTime = jvmpiInterface->GetCurrentThreadCpuTime(); ! thread->stack.push( tempFrame, entryTime); if( setup.cpu.callTreeEnabled) { + jint ctLineno = 0; + + if (setup.cpu.callTreeLinenoEnabled) + ctLineno = lineno; + CallTreeItem* current = thread->callTree.current; CallTreeItem* p = current; *************** *** 85,89 **** while( q) { ! if( q->method && q->method->isActive() && *q->method == event->u.method.method_id) break; q = p->children.next( q); } --- 107,111 ---- while( q) { ! if( q->method && q->method->isActive() && *q->method == methodID && q->lineno == ctLineno) break; q = p->children.next( q); } *************** *** 96,100 **** if( !p) { ! Method* m = getMethod( event->u.method.method_id); if( m) { --- 118,122 ---- if( !p) { ! Method* m = getMethod( methodID); if( m) { *************** *** 102,105 **** --- 124,128 ---- p->method = m; + p->lineno = ctLineno; p->parent = current; *************** *** 142,145 **** --- 165,169 ---- Synchronized sync( dataLock); + jmethodID methodID = event->u.method.method_id; Thread* thread = getThread( event->env_id); *************** *** 163,167 **** } ! if( callFrames[0].method_id != event->u.method.method_id) { PROF_ERROR("METHOD EXIT", "top method != event->method.method_id"); --- 187,191 ---- } ! if( callFrames[0].method_id != methodID) { PROF_ERROR("METHOD EXIT", "top method != event->method.method_id"); *************** *** 182,186 **** if( setup.cpu.level == Setup::LEVEL_METHOD) { ! if( !(stat = getCpuThreadMethod( event->env_id, callFrames[0].method_id))) { PROF_ERROR("METHOD EXIT", "Cannot get CpuThreadMethod"); --- 206,210 ---- if( setup.cpu.level == Setup::LEVEL_METHOD) { ! if( !(stat = getCpuThreadMethod( event->env_id, methodID))) { PROF_ERROR("METHOD EXIT", "Cannot get CpuThreadMethod"); *************** *** 201,205 **** if( setup.cpu.level == Setup::LEVEL_METHOD) { ! if( !(stat = getMethod( callFrames[0].method_id))) { PROF_ERROR("METHOD EXIT", "Method not found"); --- 225,229 ---- if( setup.cpu.level == Setup::LEVEL_METHOD) { ! if( !(stat = getMethod( methodID))) { PROF_ERROR("METHOD EXIT", "Method not found"); *************** *** 225,229 **** if( current->method && current->method->isActive() && ! *current->method == callFrames[0].method_id) { jlong t = exitTime-current->startTime; --- 249,253 ---- if( current->method && current->method->isActive() && ! *current->method == methodID) { jlong t = exitTime-current->startTime; |