ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR > 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>

Inheritance diagram for ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ACE_Timeprobe_Ex
< ACE_LOCK, ALLOCATOR > 
SELF
 Self.
typedef ACE_Timeprobe_Ex
< ACE_LOCK, ACE_Allocator
ACE_Timeprobe
typedef ACE_Unbounded_Set
< ACE_Event_Descriptions
EVENT_DESCRIPTIONS
 We can hold multiple event description tables.

Public Member Functions

 ACE_Timeprobe_Ex (u_long size=ACE_DEFAULT_TIMEPROBE_TABLE_SIZE)
 Create Timeprobes with size slots.
 ACE_Timeprobe_Ex (ALLOCATOR *allocator, u_long size=ACE_DEFAULT_TIMEPROBE_TABLE_SIZE)
 Create Timeprobes with size slots.
 ~ACE_Timeprobe_Ex (void)
 Destructor.
void timeprobe (u_long event)
 Record a time. event is used to describe this time probe.
void timeprobe (const char *id)
 Record a time. id is used to describe this time probe.
int event_descriptions (const char **descriptions, u_long minimum_id)
 Record event descriptions.
void print_times (void)
 Print the time probes.
void print_absolute_times (void)
 Print the time probes.
void reset (void)
 Reset the slots. All old time probes will be lost.
void increase_size (u_long size)
 ACE_Timeprobe_Ex (const ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR > &)
 Not implemented (stupid MSVC won't let it be protected).
ACE_Unbounded_Set
< ACE_Event_Descriptions > & 
event_descriptions (void)
 Event Descriptions.
ACE_Unbounded_Set
< ACE_Event_Descriptions > & 
sorted_event_descriptions (void)
 Sorted Event Descriptions.
const char * find_description_i (u_long i)
 Find description of event i.
void sort_event_descriptions_i (void)
 Sort event descriptions.
ACE_timeprobe_ttimeprobes (void)
 Time probe slots.
ACE_LOCK & lock (void)
 Synchronization variable.
u_long max_size (void)
 Max size of timestamp table.
u_long current_size (void)
 Current size of timestamp table.

Protected Member Functions

ALLOCATOR * allocator (void)

Protected Attributes

EVENT_DESCRIPTIONS event_descriptions_
 Event Descriptions.
EVENT_DESCRIPTIONS sorted_event_descriptions_
 Sorted Event Descriptions.
ACE_timeprobe_ttimeprobes_
 Time probe slots.
ACE_LOCK lock_
 Synchronization variable.
u_long max_size_
 Max size of timestamp table.
u_long current_size_
 Current size of timestamp table.
u_short report_buffer_full_

Private Attributes

ALLOCATOR * allocator_

Detailed Description

template<class ACE_LOCK, class ALLOCATOR>
class ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >

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 , class ALLOCATOR >
typedef ACE_Timeprobe_Ex<ACE_LOCK, ACE_Allocator> ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::ACE_Timeprobe

ACE_Timeprobe

template<class ACE_LOCK , class ALLOCATOR >
typedef ACE_Unbounded_Set<ACE_Event_Descriptions> ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::EVENT_DESCRIPTIONS

We can hold multiple event description tables.

template<class ACE_LOCK , class ALLOCATOR >
typedef ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::SELF

Self.


Constructor & Destructor Documentation

template<class ACE_LOCK , class ALLOCATOR >
ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::ACE_Timeprobe_Ex ( u_long  size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE  )  [inline]

Create Timeprobes with size slots.

template<class ACE_LOCK , class ALLOCATOR >
ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::ACE_Timeprobe_Ex ( ALLOCATOR *  allocator,
u_long  size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE 
) [inline]

Create Timeprobes with size slots.

template<class ACE_LOCK , class ALLOCATOR >
ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::~ACE_Timeprobe_Ex ( void   )  [inline]

Destructor.

template<class ACE_LOCK , class ALLOCATOR >
ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::ACE_Timeprobe_Ex ( const ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR > &   )  [inline]

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


Member Function Documentation

template<class ACE_LOCK , class ALLOCATOR >
ALLOCATOR * ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::allocator ( void   )  [inline, protected]

Obtain an allocator pointer. If there is no allocator stored in the instance, the singleton allocator in the current process is used.

template<class ACE_LOCK , class ALLOCATOR >
u_long ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::current_size ( void   )  [inline]

Current size of timestamp table.

template<class ACE_LOCK , class ALLOCATOR >
ACE_Unbounded_Set< ACE_Event_Descriptions > & ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::event_descriptions ( void   )  [inline]

Event Descriptions.

template<class ACE_LOCK , class ALLOCATOR >
int ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::event_descriptions ( const char **  descriptions,
u_long  minimum_id 
) [inline]

Record event descriptions.

template<class ACE_LOCK , class ALLOCATOR >
const char * ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::find_description_i ( u_long  i  )  [inline]

Find description of event i.

template<class ACE_LOCK , class ALLOCATOR >
void ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::increase_size ( u_long  size  )  [inline]
template<class ACE_LOCK , class ALLOCATOR >
ACE_LOCK & ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::lock ( void   )  [inline]

Synchronization variable.

template<class ACE_LOCK , class ALLOCATOR >
u_long ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::max_size ( void   )  [inline]

Max size of timestamp table.

template<class ACE_LOCK , class ALLOCATOR >
void ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::print_absolute_times ( void   )  [inline]

Print the time probes.

template<class ACE_LOCK , class ALLOCATOR >
void ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::print_times ( void   )  [inline]

Print the time probes.

template<class ACE_LOCK , class ALLOCATOR >
void ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::reset ( void   )  [inline]

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

template<class ACE_LOCK , class ALLOCATOR >
void ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::sort_event_descriptions_i ( void   )  [inline]

Sort event descriptions.

template<class ACE_LOCK , class ALLOCATOR >
ACE_Unbounded_Set< ACE_Event_Descriptions > & ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::sorted_event_descriptions ( void   )  [inline]

Sorted Event Descriptions.

template<class ACE_LOCK , class ALLOCATOR >
void ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::timeprobe ( const char *  id  )  [inline]

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

template<class ACE_LOCK , class ALLOCATOR >
void ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::timeprobe ( u_long  event  )  [inline]

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

template<class ACE_LOCK , class ALLOCATOR >
ACE_timeprobe_t * ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::timeprobes ( void   )  [inline]

Time probe slots.


Member Data Documentation

template<class ACE_LOCK , class ALLOCATOR >
ALLOCATOR* ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::allocator_ [private]
template<class ACE_LOCK , class ALLOCATOR >
u_long ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::current_size_ [protected]

Current size of timestamp table.

template<class ACE_LOCK , class ALLOCATOR >
EVENT_DESCRIPTIONS ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::event_descriptions_ [protected]

Event Descriptions.

template<class ACE_LOCK , class ALLOCATOR >
ACE_LOCK ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::lock_ [protected]

Synchronization variable.

template<class ACE_LOCK , class ALLOCATOR >
u_long ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::max_size_ [protected]

Max size of timestamp table.

template<class ACE_LOCK , class ALLOCATOR >
u_short ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::report_buffer_full_ [protected]

Flag indicating the report buffer has filled up, and is now acting as a ring-buffer using modulus arithmetic: this saves the max_size_ most recent time stamps and loses earlier ones until drained.

template<class ACE_LOCK , class ALLOCATOR >
EVENT_DESCRIPTIONS ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::sorted_event_descriptions_ [protected]

Sorted Event Descriptions.

template<class ACE_LOCK , class ALLOCATOR >
ACE_timeprobe_t* ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::timeprobes_ [protected]

Time probe slots.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2