Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

IProf Class Reference

Communication interface class. More...

#include <iprof.h>

Inheritance diagram for IProf::

Prof List of all members.

Public Types

typedef jint objectID
 unique object ID.

enum  eFunction {
  F_SHUTDOWN = 0, F_IS_SHUTDOWNED = 1, F_SUSPEND_VM = 2, F_RESUME_VM = 3,
  F_EXIT_VM = 4, F_GET_INFO = 5, F_GET_DATA = 6, F_GET_ALL = 7,
  F_GET_CHANGED = 8, F_ENABLE_GC = 9, F_DISABLE_GC = 10, F_RUN_GC = 11
}
 indexes of methods. More...


Public Methods

 IProf (const Setup &setup, JVMPI_Interface *jvmpi)
 Constructor. More...

virtual ~IProf ()
 Destructor. More...

int run ()
 Main server loop. More...

virtual void shutdown ()=0
 Shutdown JVM. More...

virtual jint isShutdowned ()=0
 JVM shutdowned. More...

virtual void suspendVM ()=0
 Suspend JVM. More...

virtual void resumeVM ()=0
 Resume JVM. More...

virtual void exitVM ()=0
 Exit JVM. More...

virtual jint getInfo (objectID infoId, eInfoType type, InfoBinaryFormat *&info)=0
 Get information. More...

virtual jint getData (objectID objId, eDataType type, sData &data)=0
 Get statistic data. More...

virtual jint getAll (objectID objId, eSeqType what, jint includeInfo, jint optionalArg, seqID &seq)=0
 Get all objects with all statistic data. More...

virtual jint getChanged (objectID objId, eSeqType what, jint includeInfo, jint optionalArg, seqID &seq)=0
 Get all objects with changed statistic data. More...

virtual void enableGC ()=0
 Enable Java garbage collector. More...

virtual void disableGC ()=0
 Disable Java garbage collector. More...

virtual void runGC ()=0
 Run Java garbage collector explicitly. More...


Protected Types

typedef List< sID, LI1seqID
 unbounded sequence of statistic data.

enum  eErrorCode {
  RC_OK = 0, RC_BAD_INFO_ID = -1, RC_BAD_INFO_TYPE = -2, RC_BAD_OBJ_ID = -3,
  RC_BAD_DATA_TYPE = -4, RC_BAD_COMMAND = -5
}
 error codes. More...

enum  eInfoType {
  CLASS_INFO = 0, CLASS_FIELD_INFO = 1, METHOD_INFO = 2, TRACE_INFO = 3,
  OBJECT_INFO = 4, ARENA_INFO = 5, THREAD_INFO = 6, THREAD_GROUP_INFO = 7,
  GC_INFO = 8
}
 type of information. More...

enum  eDataType { ALLOC_DATA = 0, CPU_DATA = 1, MON_DATA = 2 }
 type of statistic data. More...

enum  eSeqType {
  CLASSES = 0, METHODS = 1, ALLOC_TRACES = 2, CPU_TRACES = 3,
  OBJECT_TYPES = 4, THREADS = 5, GROUPS_OF_THREADS = 6, ARENAS = 7,
  GCS = 8, GROUP_THREADS = 9, CLASS_FIELDS_STATICS = 10, CLASS_FIELDS_INSTANCES = 11,
  CLASS_METHODS = 12, ALLOC_METHOD_TRACES = 13, ALLOC_METHOD_OBJECTS = 14, ALLOC_TRACE_OBJECTS = 15,
  ALLOC_OBJECT_METHODS = 16, ALLOC_OBJECT_METHOD_TRACES = 17, ALLOC_OBJECT_THREADS = 18, ALLOC_OBJECT_METHOD_THREADS = 19,
  ALLOC_OBJECT_METHOD_TRACE_THREADS = 20, ALLOC_THREAD_OBJECTS = 21, ALLOC_THREAD_OBJECT_METHODS = 22, ALLOC_THREAD_OBJECT_METHOD_TRACES = 23,
  ALLOC_THREAD_METHODS = 24, ALLOC_THREAD_METHOD_TRACES = 25, ALLOC_THREAD_METHOD_OBJECTS = 26, ALLOC_THREAD_METHOD_TRACE_OBJECTS = 27,
  CPU_METHOD_TRACES = 28, CPU_METHOD_THREADS = 29, CPU_METHOD_TRACE_THREADS = 30, CPU_THREAD_METHODS = 31,
  CPU_THREAD_METHOD_TRACES = 32, MON_METHOD_TRACES = 33, MON_METHOD_THREADS = 34, MON_METHOD_TRACE_THREADS = 35,
  MON_THREAD_METHODS = 36, MON_THREAD_METHOD_TRACES = 37, MON_TRACES = 38, ALLOC_METHOD_THREADS = 40,
  ALLOC_METHOD_TRACE_THREADS = 41
}
 Type of sequence. More...


Protected Methods

int isConnectionEstablished ()
 Connection established or not. More...


Protected Attributes

Lock communLock
 mutex for communication.


Private Types

typedef void(IProf::* Func )(Buffer &)
 relative pointer to class method.

enum  e { FUNC_COUNT = 12 }
 constants. More...


Private Methods

void _shutdown (Buffer &b)
 Shutdown JVM. More...

void _isShutdowned (Buffer &b)
 JVM shutdowned. More...

void _suspendVM (Buffer &b)
 Suspend JVM. More...

void _resumeVM (Buffer &b)
 Resume JVM. More...

void _exitVM (Buffer &b)
 Exit JVM. More...

void _getInfo (Buffer &b)
 Get information. More...

void _getData (Buffer &b)
 Get statistic data. More...

void _getAll (Buffer &b)
 Get all objects with all statistic data. More...

void _getChanged (Buffer &b)
 Get all objects with changed statistic data. More...

void _enableGC (Buffer &b)
 Enable Java garbage collector. More...

void _disableGC (Buffer &b)
 Disable Java garbage collector. More...

void _runGC (Buffer &b)
 Run Java garbage collector explicitly. More...


Static Private Methods

int sToBin (sID *s, void **inout)
 Convert sequence item to binary. More...


Private Attributes

Func _func [FUNC_COUNT]
 an array of relative pointers to methods.

Commun_commun
 communication object.

int conEstabl
 connection established or not.


Detailed Description

Communication interface class.

This class implements the whole communication interface between this profiler dynamic library and java. On the Java-side there is similar class as this one. Main profiler class (Prof) is a descendant of this class, so it has all features of this interface.

See also:
Prof
Author:
Marek Przeczek

Definition at line 60 of file iprof.h.


Member Enumeration Documentation

enum IProf::e [private]
 

constants.

Enumeration values:
FUNC_COUNT  number of methods of the interface.

Reimplemented in Prof.

Definition at line 66 of file iprof.h.

enum IProf::eDataType [protected]
 

type of statistic data.

Enumeration values:
ALLOC_DATA  memory profiling statistics.
CPU_DATA  cpu profiling statistics.
MON_DATA  monitor profiling statistics.

Definition at line 190 of file iprof.h.

enum IProf::eErrorCode [protected]
 

error codes.

Enumeration values:
RC_OK  ok.
RC_BAD_INFO_ID  bad infoId value.
RC_BAD_INFO_TYPE  bad type of information requested.
RC_BAD_OBJ_ID  bad objId value.
RC_BAD_DATA_TYPE  bad type of statistic data requested.
RC_BAD_COMMAND  bad action (unknown or not possible).

Definition at line 93 of file iprof.h.

enum IProf::eFunction
 

indexes of methods.

Enumeration values:
F_SHUTDOWN  shutdown().
F_IS_SHUTDOWNED  isShutdowned().
F_SUSPEND_VM  suspendVM().
F_RESUME_VM  resumeVM().
F_EXIT_VM  exitVM().
F_GET_INFO  getInfo().
F_GET_DATA  getData().
F_GET_ALL  getAll().
F_GET_CHANGED  getChanged().
F_ENABLE_GC  enableGC().
F_DISABLE_GC  disableGC().
F_RUN_GC  runGC().

Definition at line 117 of file iprof.h.

enum IProf::eInfoType [protected]
 

type of information.

Enumeration values:
CLASS_INFO  info about Java class.
CLASS_FIELD_INFO  info about Java class field.
METHOD_INFO  info about Java class method.
TRACE_INFO  info about Java method trace.
OBJECT_INFO  info about Java object.
ARENA_INFO  info about Java arena.
THREAD_INFO  info about Java thread.
THREAD_GROUP_INFO  info about group of Java threads.
GC_INFO  info about Java garbage collector.

Definition at line 159 of file iprof.h.

enum IProf::eSeqType [protected]
 

Type of sequence.

Type of objects in the sequence

Enumeration values:
CLASSES  classes.
METHODS  methods.
ALLOC_TRACES  method traces (memory profiling).
CPU_TRACES  method traces (cpu profiling).
OBJECT_TYPES  object types (objects).
THREADS  threads.
GROUPS_OF_THREADS  groups of threads.
ARENAS  arenas.
GCS  garbage collectors.
GROUP_THREADS  threads of given thread group.
CLASS_FIELDS_STATICS  static fields of given class.
CLASS_FIELDS_INSTANCES  instance fields of given class.
CLASS_METHODS  methods of given class.
ALLOC_METHOD_TRACES  method traces of given method (memory profiling).
ALLOC_METHOD_OBJECTS  objects allocated in given method.
ALLOC_TRACE_OBJECTS  objects allocated in given method trace.
ALLOC_OBJECT_METHODS  methods where an object of given type was allocated.
ALLOC_OBJECT_METHOD_TRACES  method traces where an object of given type was allocated.
ALLOC_OBJECT_THREADS  threads where an object of given type was allocated.
ALLOC_OBJECT_METHOD_THREADS  threads where an object of given type was allocated (by concrete method call).
ALLOC_OBJECT_METHOD_TRACE_THREADS  threads where an object of given type was allocated (in concrete method trace).
ALLOC_THREAD_OBJECTS  objects (types) allocated in given thread.
ALLOC_THREAD_OBJECT_METHODS  methods where an object of given type was allocated (in concrete thread).
ALLOC_THREAD_OBJECT_METHOD_TRACES  method traces where an object of given type was allocated (in concrete thread).
ALLOC_THREAD_METHODS  methods called in given thread.
ALLOC_THREAD_METHOD_TRACES  method traces of methods called in given thread.
ALLOC_THREAD_METHOD_OBJECTS  objects (types) allocated in given method (in concrete thread).
ALLOC_THREAD_METHOD_TRACE_OBJECTS  objects (types) allocated in given method trace (in concrete thread).
CPU_METHOD_TRACES  method traces of given method (cpu profiling).
CPU_METHOD_THREADS  threads where given method was called.
CPU_METHOD_TRACE_THREADS  threads for concrete method trace.
CPU_THREAD_METHODS  methods called in given thread.
CPU_THREAD_METHOD_TRACES  method traces of concrete method called in given thread.
MON_METHOD_TRACES  method traces of given method (monitor profiling).
MON_METHOD_THREADS  threads where given method was called.
MON_METHOD_TRACE_THREADS  threads for concrete method trace.
MON_THREAD_METHODS  methods called in given thread.
MON_THREAD_METHOD_TRACES  method traces of concrete method called in given thread.
MON_TRACES  method traces (monitor profiling).
ALLOC_METHOD_THREADS  threads where concrete method was called (memory profiling).
ALLOC_METHOD_TRACE_THREADS  threads where concrete method in concrete trace was called (memory profiling).

Definition at line 301 of file iprof.h.


Constructor & Destructor Documentation

IProf::IProf const Setup   setup,
JVMPI_Interface *    jvmpi
 

Constructor.

It initializes communication. In this moment, socket (TCP) communication and shared memory communication are supported.

Parameters:
setup  commun setup
jvmpi  pointer to JVMPI interface

Definition at line 46 of file iprof.cpp.

IProf::~IProf   [virtual]
 

Destructor.

It stops communication and closes communication channel.

Definition at line 73 of file iprof.cpp.


Member Function Documentation

void IProf::_disableGC Buffer   b [private]
 

Disable Java garbage collector.

This method processes in/out buffer, gains arguments and calls disableGC() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
enableGC(), runGC()

Definition at line 265 of file iprof.cpp.

void IProf::_enableGC Buffer   b [private]
 

Enable Java garbage collector.

This method processes in/out buffer, gains arguments and calls enableGC() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
disableGC(), runGC()

Definition at line 259 of file iprof.cpp.

void IProf::_exitVM Buffer   b [private]
 

Exit JVM.

This method processes in/out buffer, gains arguments and calls exitVM() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
exitVM()

Definition at line 144 of file iprof.cpp.

void IProf::_getAll Buffer   b [inline, private]
 

Get all objects with all statistic data.

This method processes in/out buffer, gains arguments and calls getAll() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
getAll()

Definition at line 548 of file iprof.h.

void IProf::_getChanged Buffer   b [inline, private]
 

Get all objects with changed statistic data.

This method processes in/out buffer, gains arguments and calls getChanged() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
getChanged()

Definition at line 559 of file iprof.h.

void IProf::_getData Buffer   b [private]
 

Get statistic data.

This method processes in/out buffer, gains arguments and calls getData() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
getData()

Definition at line 169 of file iprof.cpp.

void IProf::_getInfo Buffer   b [private]
 

Get information.

This method processes in/out buffer, gains arguments and calls getInfo() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
getInfo()

Definition at line 150 of file iprof.cpp.

void IProf::_isShutdowned Buffer   b [private]
 

JVM shutdowned.

This method processes in/out buffer, gains arguments and calls isShutdowned() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
isShutdowned()

Definition at line 124 of file iprof.cpp.

void IProf::_resumeVM Buffer   b [private]
 

Resume JVM.

This method processes in/out buffer, gains arguments and calls resumeVM() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
resumeVM()

Definition at line 138 of file iprof.cpp.

void IProf::_runGC Buffer   b [private]
 

Run Java garbage collector explicitly.

This method processes in/out buffer, gains arguments and calls runGC() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
enableGC(), disableGC()

Definition at line 271 of file iprof.cpp.

void IProf::_shutdown Buffer   b [private]
 

Shutdown JVM.

This method processes in/out buffer, gains arguments and calls shutdown() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
shutdown()

Definition at line 118 of file iprof.cpp.

void IProf::_suspendVM Buffer   b [private]
 

Suspend JVM.

This method processes in/out buffer, gains arguments and calls suspendVM() method. When finished, in 'b' there is binary output of called method.

Parameters:
b  in/out buffer
See also:
suspendVM()

Definition at line 132 of file iprof.cpp.

virtual void IProf::disableGC   [pure virtual]
 

Disable Java garbage collector.

An abstract method implemented by Prof class.

See also:
Prof::disableGC(), Prof

Reimplemented in Prof.

Referenced by _disableGC().

virtual void IProf::enableGC   [pure virtual]
 

Enable Java garbage collector.

An abstract method implemented by Prof class.

See also:
Prof::enableGC(), Prof

Reimplemented in Prof.

Referenced by _enableGC().

virtual void IProf::exitVM   [pure virtual]
 

Exit JVM.

An abstract method implemented by Prof class.

See also:
Prof::exitVM(), Prof

Reimplemented in Prof.

Referenced by _exitVM().

virtual jint IProf::getAll objectID    objId,
eSeqType    what,
jint    includeInfo,
jint    optionalArg,
seqID   seq
[pure virtual]
 

Get all objects with all statistic data.

An abstract method implemented by Prof class.

See also:
Prof::getAll(), Prof

Reimplemented in Prof.

virtual jint IProf::getChanged objectID    objId,
eSeqType    what,
jint    includeInfo,
jint    optionalArg,
seqID   seq
[pure virtual]
 

Get all objects with changed statistic data.

An abstract method implemented by Prof class.

See also:
Prof::getChanged(), Prof

Reimplemented in Prof.

virtual jint IProf::getData objectID    objId,
eDataType    type,
sData   data
[pure virtual]
 

Get statistic data.

An abstract method implemented by Prof class.

See also:
Prof::getData(), Prof

Reimplemented in Prof.

Referenced by _getData().

virtual jint IProf::getInfo objectID    infoId,
eInfoType    type,
InfoBinaryFormat *&    info
[pure virtual]
 

Get information.

An abstract method implemented by Prof class.

See also:
Prof::getInfo(), Prof

Reimplemented in Prof.

Referenced by _getInfo().

int IProf::isConnectionEstablished   [inline, protected]
 

Connection established or not.

Returns:
1 (established); 0 (not established)

Definition at line 720 of file iprof.h.

Referenced by Prof::event_jvmShutDown().

virtual jint IProf::isShutdowned   [pure virtual]
 

JVM shutdowned.

An abstract method implemented by Prof class.

See also:
Prof::isShutdowned, Prof

Reimplemented in Prof.

Referenced by _isShutdowned().

virtual void IProf::resumeVM   [pure virtual]
 

Resume JVM.

An abstract method implemented by Prof class.

See also:
Prof::resumeVM(), Prof

Reimplemented in Prof.

Referenced by _resumeVM().

int IProf::run  
 

Main server loop.

This method starts the server and stays in main server (client) loop. To exit the loop client must disconnect itself from the server (must close connection). When connect_mode is set to 'client', it starts the client.

Returns:
0 (failure occurred); 1 (ok, never occurrs)

Definition at line 78 of file iprof.cpp.

Referenced by Prof::communThreadRoutine().

virtual void IProf::runGC   [pure virtual]
 

Run Java garbage collector explicitly.

An abstract method implemented by Prof class.

See also:
Prof::runGC(), Prof

Reimplemented in Prof.

Referenced by _runGC().

int IProf::sToBin sID   s,
void **    inout
[static, private]
 

Convert sequence item to binary.

This method is called indirectly thru forEach() method. It converts sequence item data to binary format and appends it to the end of 'inout' buffer.

Parameters:
s  pointer to sequence item
inout  pointer to Buffer object
Returns:
0 (always zero)

Definition at line 192 of file iprof.cpp.

virtual void IProf::shutdown   [pure virtual]
 

Shutdown JVM.

An abstract method implemented by Prof class.

See also:
Prof::shutdown(), Prof

Reimplemented in Prof.

Referenced by _shutdown().

virtual void IProf::suspendVM   [pure virtual]
 

Suspend JVM.

An abstract method implemented by Prof class.

See also:
Prof::suspendVM(), Prof

Reimplemented in Prof.

Referenced by _suspendVM().


The documentation for this class was generated from the following files:
Generated on Mon Jan 28 14:53:29 2002 for Java Profiler Dynamic Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001