|
From: Petr L. <lu...@us...> - 2001-08-24 17:54:09
|
Update of /cvsroot/javaprofiler/library/src/shared
In directory usw-pr-cvs1:/tmp/cvs-serv4667/shared
Modified Files:
method.cpp method.h thread.cpp thread.h
Log Message:
Monitor profiling
Index: method.cpp
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/shared/method.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** method.cpp 2001/07/28 04:38:45 1.10
--- method.cpp 2001/08/24 17:54:04 1.11
***************
*** 29,32 ****
--- 29,38 ----
ctm = cpuThreadMethods.next(ctm);
}
+
+ MonThreadMethod* mtm = monThreadMethods.first();
+ while (mtm) {
+ mtm->deactivate();
+ mtm = monThreadMethods.next(mtm);
+ }
AllocTrace* at = allocTraces.first();
***************
*** 40,43 ****
--- 46,55 ----
ct->deactivate();
ct = cpuTraces.next(ct);
+ }
+
+ MonTrace* mt = monTraces.first();
+ while (mt) {
+ mt->deactivate();
+ mt = monTraces.next(mt);
}
}
Index: method.h
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/shared/method.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** method.h 2001/08/05 01:37:10 1.18
--- method.h 2001/08/24 17:54:04 1.19
***************
*** 6,10 ****
** a JVMPI_EVENT_CLASS_LOAD event).
**
! ** @see Class, AllocObjectMethod, AllocTrace
**
** @author Marek Przeczek, Petr Luner */
--- 6,10 ----
** a JVMPI_EVENT_CLASS_LOAD event).
**
! ** @see Class
**
** @author Marek Przeczek, Petr Luner */
***************
*** 12,16 ****
class Method: public IdObject,
public LI1, public LI2,
! public AllocStatData, public CpuStatData,
public InfoBinaryFormat {
public:
--- 12,18 ----
class Method: public IdObject,
public LI1, public LI2,
! public AllocStatData,
! public CpuStatData,
! public MonStatData,
public InfoBinaryFormat {
public:
***************
*** 49,52 ****
--- 51,60 ----
List<CpuThreadMethod,LI3> cpuThreadMethods;
+ /// associated MonTraces
+ List<MonTrace,LI2> monTraces;
+
+ /// associated MonThreadMethods
+ List<MonThreadMethod,LI3> monThreadMethods;
+
public:
***************
*** 148,152 ****
virtual int isChanged() { return (activeChanged() ||
AllocStatData::dataChanged() ||
! CpuStatData::dataChanged());} // order dependent !
/** Set the structure is unchanged although it may not be. */
--- 156,161 ----
virtual int isChanged() { return (activeChanged() ||
AllocStatData::dataChanged() ||
! CpuStatData::dataChanged() ||
! MonStatData::dataChanged());} // order dependent !
/** Set the structure is unchanged although it may not be. */
***************
*** 157,160 ****
--- 166,170 ----
AllocStatData::clearDataChanged();
CpuStatData::clearDataChanged();
+ MonStatData::clearDataChanged();
}
};
Index: thread.cpp
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/shared/thread.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** thread.cpp 2001/07/30 15:41:26 1.6
--- thread.cpp 2001/08/24 17:54:04 1.7
***************
*** 37,39 ****
--- 37,45 ----
ctm = cpuThreadMethods.next(ctm);
}
+
+ MonThreadMethod* mtm = monThreadMethods.first();
+ while (mtm) {
+ mtm->deactivate();
+ mtm = monThreadMethods.next(mtm);
+ }
}
Index: thread.h
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/shared/thread.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** thread.h 2001/08/05 01:37:10 1.20
--- thread.h 2001/08/24 17:54:04 1.21
***************
*** 8,12 ****
** so 'active' field will equal zero.
**
! ** @see GroupThread, AllocThreadObject, AllocThreadMethod
**
** @author Marek Przeczek, Petr Luner */
--- 8,12 ----
** so 'active' field will equal zero.
**
! ** @see GroupThread
**
** @author Marek Przeczek, Petr Luner */
***************
*** 47,50 ****
--- 47,53 ----
List<CpuThreadMethod,LI2> cpuThreadMethods;
+ /// associated MonThreadMethods
+ List<MonThreadMethod,LI2> monThreadMethods;
+
/// CPU stack
CpuStack stack;
***************
*** 60,63 ****
--- 63,82 ----
int hasRun;
+ /** For monitor profiling purposes.
+ ** Indicates whether JVMPI_EVENT_MONITOR_CONTENDED_ENTER
+ ** event occured for this thread. The flag is cleared
+ ** in JVMPI_EVENT_MONITOR_CONTENDED_ENTERED event. */
+ int monitorEnter;
+
+ /** For monitor profiling purposes.
+ ** Holds the object id of the last
+ ** JVMPI_EVENT_MONITOR_CONTENDED_ENTER event. */
+ jobjectID monitorEnterObject;
+
+ /** For monitor profiling purposes.
+ ** Holds the time of the last
+ ** JVMPI_EVENT_MONITOR_CONTENDED_ENTER event. */
+ unsigned long monitorEnterTime;
+
private:
***************
*** 74,78 ****
threadId( 0),
threadEnvId( NULL),
! active( 1)
{
--- 93,100 ----
threadId( 0),
threadEnvId( NULL),
! active( 1),
! monitorEnter(0),
! monitorEnterObject(0),
! monitorEnterTime(0)
{
|