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

ACE_Timeprobe Class Template Reference

This class is used to instrument code. This is accomplished by inserting time probes at different location in the code. ACE_Timeprobe then measures the time difference between two time probes. More...

#include <Timeprobe_T.h>

Collaboration diagram for ACE_Timeprobe:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Timeprobe< ACE_LOCK > SELF
 Self. More...

typedef ACE_Unbounded_Set<
ACE_Event_Descriptions
EVENT_DESCRIPTIONS
 We can hold multiple event description tables. More...


Public Methods

 ACE_Timeprobe (u_long size=ACE_DEFAULT_TIMEPROBE_TABLE_SIZE)
 Create Timeprobes with <size> slots. More...

 ~ACE_Timeprobe (void)
 Destructor. More...

void timeprobe (u_long event)
 Record a time. <event> is used to describe this time probe. More...

void timeprobe (const char *id)
 Record a time. <id> is used to describe this time probe. More...

int event_descriptions (const char **descriptions, u_long minimum_id)
 Record event descriptions. More...

void print_times (void)
 Print the time probes. More...

void print_absolute_times (void)
 Print the time probes. More...

void reset (void)
 Reset the slots. All old time probes will be lost. More...

 ACE_Timeprobe (const ACE_Timeprobe< ACE_LOCK > &)
 Not implemented (stupid MSVC won't let it be protected). More...

ACE_Unbounded_Set< ACE_Event_Descriptions > & event_descriptions (void)
 Event Descriptions. More...

ACE_Unbounded_Set< ACE_Event_Descriptions > & sorted_event_descriptions (void)
 Sorted Event Descriptions. More...

u_int * current_slot_vme_address (void)
 VME slot address. More...

const char * find_description_i (u_long i)
 Find description of event <i>. More...

void sort_event_descriptions_i (void)
 Sort event descriptions. More...

ACE_timeprobe_ttimeprobes (void)
 Time probe slots. More...

ACE_LOCK & lock (void)
 Synchronization variable. More...

u_long max_size (void)
 Max size of timestamp table. More...

u_long current_size (void)
 Current size of timestamp table. More...


Protected Attributes

EVENT_DESCRIPTIONS event_descriptions_
 Event Descriptions. More...

EVENT_DESCRIPTIONS sorted_event_descriptions_
 Sorted Event Descriptions. More...

u_int * current_slot_vme_address_
 Added sections below here to make compatible with the VMETRO board test. More...

ACE_timeprobe_ttimeprobes_
 Time probe slots. More...

ACE_LOCK lock_
 Synchronization variable. More...

u_long max_size_
 Max size of timestamp table. More...

u_long current_size_
 Current size of timestamp table. More...


Detailed Description

template<class ACE_LOCK>
class ACE_Timeprobe< ACE_LOCK >

This class is used to instrument code. This is accomplished by inserting time probes at different location in the code. ACE_Timeprobe then measures the time difference between two time probes.

This class provides a lightweight implementation for measuring the time required to execute code between two time probes. When a time probe executes, it records the time, the id of the calling thread, and an event description. The event description can either be an unsigned long or a string (char *). If string are used, care must be taken cause only pointer copies are done and the string data is *not* copied. The recorded time probes can then be printed by calling <print_times>. If you have used unsigned longs as event descriptions in any of your time probes, you must have provided an event description table that maps the unsigned longs to readable strings. This map is a simple array of strings, and the event number is used as the index into the array when looking for the event description. If you have only used strings for the event description, this map is not necessary. Multiple maps can also be used to chunk up the time probes. Each one can be added by calling <event_descriptions>. Different tables are used internally by consulting the minimum_id for each table. It is up to the user to make sure that multiple tables do not share the same event id range.


Member Typedef Documentation

template<class ACE_LOCK>
typedef ACE_Unbounded_Set<ACE_Event_Descriptions> ACE_Timeprobe::EVENT_DESCRIPTIONS
 

We can hold multiple event description tables.

template<class ACE_LOCK>
typedef ACE_Timeprobe<ACE_LOCK> ACE_Timeprobe::SELF
 

Self.


Constructor & Destructor Documentation

template<class ACE_LOCK>
ACE_Timeprobe< ACE_LOCK >::ACE_Timeprobe u_long    size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE
 

Create Timeprobes with <size> slots.

template<class ACE_LOCK>
ACE_Timeprobe< ACE_LOCK >::~ACE_Timeprobe void   
 

Destructor.

template<class ACE_LOCK>
ACE_Timeprobe< ACE_LOCK >::ACE_Timeprobe const ACE_Timeprobe< ACE_LOCK > &   
 

Not implemented (stupid MSVC won't let it be protected).


Member Function Documentation

template<class ACE_LOCK>
u_long ACE_Timeprobe< ACE_LOCK >::current_size void   
 

Current size of timestamp table.

template<class ACE_LOCK>
u_int * ACE_Timeprobe< ACE_LOCK >::current_slot_vme_address void   
 

VME slot address.

template<class ACE_LOCK>
ACE_Unbounded_Set< ACE_Event_Descriptions > & ACE_Timeprobe< ACE_LOCK >::event_descriptions void   
 

Event Descriptions.

template<class ACE_LOCK>
int ACE_Timeprobe< ACE_LOCK >::event_descriptions const char **    descriptions,
u_long    minimum_id
 

Record event descriptions.

template<class ACE_LOCK>
const char * ACE_Timeprobe< ACE_LOCK >::find_description_i u_long    i
 

Find description of event <i>.

template<class ACE_LOCK>
ACE_LOCK & ACE_Timeprobe< ACE_LOCK >::lock void   
 

Synchronization variable.

template<class ACE_LOCK>
u_long ACE_Timeprobe< ACE_LOCK >::max_size void   
 

Max size of timestamp table.

template<class ACE_LOCK>
void ACE_Timeprobe< ACE_LOCK >::print_absolute_times void   
 

Print the time probes.

template<class ACE_LOCK>
void ACE_Timeprobe< ACE_LOCK >::print_times void   
 

Print the time probes.

template<class ACE_LOCK>
void ACE_Timeprobe< ACE_LOCK >::reset void   
 

Reset the slots. All old time probes will be lost.

template<class ACE_LOCK>
void ACE_Timeprobe< ACE_LOCK >::sort_event_descriptions_i void   
 

Sort event descriptions.

template<class ACE_LOCK>
ACE_Unbounded_Set< ACE_Event_Descriptions > & ACE_Timeprobe< ACE_LOCK >::sorted_event_descriptions void   
 

Sorted Event Descriptions.

template<class ACE_LOCK>
void ACE_Timeprobe< ACE_LOCK >::timeprobe const char *    event
 

Record a time. <id> is used to describe this time probe.

template<class ACE_LOCK>
void ACE_Timeprobe< ACE_LOCK >::timeprobe u_long    event
 

Record a time. <event> is used to describe this time probe.

template<class ACE_LOCK>
ACE_timeprobe_t * ACE_Timeprobe< ACE_LOCK >::timeprobes void   
 

Time probe slots.


Member Data Documentation

template<class ACE_LOCK>
u_long ACE_Timeprobe::current_size_ [protected]
 

Current size of timestamp table.

template<class ACE_LOCK>
u_int* ACE_Timeprobe::current_slot_vme_address_ [protected]
 

Added sections below here to make compatible with the VMETRO board test.

template<class ACE_LOCK>
EVENT_DESCRIPTIONS ACE_Timeprobe::event_descriptions_ [protected]
 

Event Descriptions.

template<class ACE_LOCK>
ACE_LOCK ACE_Timeprobe::lock_ [protected]
 

Synchronization variable.

template<class ACE_LOCK>
u_long ACE_Timeprobe::max_size_ [protected]
 

Max size of timestamp table.

template<class ACE_LOCK>
EVENT_DESCRIPTIONS ACE_Timeprobe::sorted_event_descriptions_ [protected]
 

Sorted Event Descriptions.

template<class ACE_LOCK>
ACE_timeprobe_t* ACE_Timeprobe::timeprobes_ [protected]
 

Time probe slots.


The documentation for this class was generated from the following files:
Generated on Wed Jan 15 19:15:06 2003 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001