Update of /cvsroot/javaprofiler/library/src/prof
In directory usw-pr-cvs1:/tmp/cvs-serv4699/src/prof
Modified Files:
prof_get.cpp prof_thread.cpp
Log Message:
thread's start/finish time added
Index: prof_get.cpp
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/prof/prof_get.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** prof_get.cpp 16 Apr 2002 12:41:35 -0000 1.12
--- prof_get.cpp 25 May 2002 00:05:05 -0000 1.13
***************
*** 524,528 ****
event.env_id = envId;
! event.u.thread_start.thread_name = "Thread-Unknown";
event.u.thread_start.group_name = "unknown";
event.u.thread_start.parent_name = NULL;
--- 524,537 ----
event.env_id = envId;
! static int num = 0;
! char buf[50];
!
! #ifndef WIN32
! snprintf( buf, sizeof( buf), "Thread-Unknown-%d", num++);
! #else
! _snprintf( buf, sizeof( buf), "Thread-Unknown-%d", num++);
! #endif
!
! event.u.thread_start.thread_name = buf;
event.u.thread_start.group_name = "unknown";
event.u.thread_start.parent_name = NULL;
Index: prof_thread.cpp
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/prof/prof_thread.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** prof_thread.cpp 15 Apr 2002 21:04:18 -0000 1.16
--- prof_thread.cpp 25 May 2002 00:05:06 -0000 1.17
***************
*** 86,89 ****
--- 86,91 ----
t->threadEnvId = envId;
+ t->startTime = time( NULL);
+
threads.add( t);
activeThreads.add( t);
***************
*** 120,123 ****
Thread* t = getThread( event->env_id, 0);
! if( t) t->deactivate();
}
--- 122,129 ----
Thread* t = getThread( event->env_id, 0);
! if( t) {
!
! t->endTime = time( NULL);
! t->deactivate();
! }
}
|