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

Sampling Class Reference

CPU Sampling. More...

#include <sampling.h>

List of all members.

Public Methods

 Sampling (JVMPI_Interface *jvmpi)
 Constructor. More...

 ~Sampling ()
 Destructor.

int startThread (int turnedOn)
 Starts sampling thread. More...

void terminateThread ()
 Terminates sampling thread. More...

int isTerminated ()
 Returns true/false in dependance on sampling thread has been terminated or not yet. More...


Private Types

enum  CMD
 thread commands.


Private Methods

void main ()
 Main thread function.

void doOneSample ()
 Performs one sample.


Static Private Methods

void samplingMain (void *)
 Start routine for sampling thread. More...


Private Attributes

CMD _cmd
 current command.

Lock _lock
 critical section.

int _terminated
 thread termination flag.


Detailed Description

CPU Sampling.

This class implements sampling method for CPU profiling. The sampling is done by a separate thread that is created during profiler start-up.

Author:
Petr Luner, Marek Przeczek

Definition at line 48 of file sampling.h.


Constructor & Destructor Documentation

Sampling::Sampling JVMPI_Interface *    jvmpi
 

Constructor.

It initializes locks needed while sampling.

Parameters:
jvmpi  pointer to JVMPI interface

Definition at line 43 of file sampling.cpp.


Member Function Documentation

int Sampling::isTerminated  
 

Returns true/false in dependance on sampling thread has been terminated or not yet.

Returns:
1 (thread stopped); 0 (still runnning)

Definition at line 379 of file sampling.cpp.

Referenced by Prof::event_jvmShutDown().

void Sampling::samplingMain void *    [static, private]
 

Start routine for sampling thread.

Parameters:
not  used

Definition at line 374 of file sampling.cpp.

int Sampling::startThread int    turnedOn
 

Starts sampling thread.

This method is expected to be called only once during profiler start-up.

Parameters:
turnedOn  whether sampling is turned on or off
Returns:
0 (ok) -1 (error)

Definition at line 163 of file sampling.cpp.

void Sampling::terminateThread  
 

Terminates sampling thread.

The operation is asynchronous to prevent deadlocks.

Definition at line 194 of file sampling.cpp.

Referenced by Prof::event_jvmShutDown().


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