summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-27 19:25:17 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-27 19:25:17 +0000
commit325f2dcc70237bd21f63724f7dc9bd41eedeaa94 (patch)
tree8360f9af9298653dcf3195716fc7e5c618f89007
parentac9f7e4e89f6d2785fc96bb377717ae94cb04ec7 (diff)
downloadATCD-325f2dcc70237bd21f63724f7dc9bd41eedeaa94.tar.gz
*** empty log message ***
-rw-r--r--ace/Timeprobe.cpp16
-rw-r--r--ace/Timeprobe.h114
2 files changed, 65 insertions, 65 deletions
diff --git a/ace/Timeprobe.cpp b/ace/Timeprobe.cpp
index ab872c4eea6..2f894fe1cd9 100644
--- a/ace/Timeprobe.cpp
+++ b/ace/Timeprobe.cpp
@@ -22,8 +22,8 @@ ACE_Timeprobe<ACE_LOCK>::ACE_Timeprobe (u_long size,
max_size_ (size),
current_size_ (0)
{
- void *space = this->allocator_->malloc ((sizeof(timeprobe_t)) * this->max_size_);
- this->timeprobes_ = new ((timeprobe_t *) space) timeprobe_t[this->max_size_];
+ void *space = this->allocator_->malloc ((sizeof (ACE_timeprobe_t)) * this->max_size_);
+ this->timeprobes_ = new ((ACE_timeprobe_t *) space) ACE_timeprobe_t[this->max_size_];
#ifdef VXWORKS
if (sysProcNumGet () == 0)
@@ -41,7 +41,7 @@ template <class ACE_LOCK>
ACE_Timeprobe<ACE_LOCK>::~ACE_Timeprobe (void)
{
for (u_long i = 0; i < this->max_size_; i++)
- this->timeprobes_[i].timeprobe_t::~timeprobe_t ();
+ this->timeprobes_[i].ACE_timeprobe_t::~ACE_timeprobe_t ();
this->allocator_->free (this->timeprobes_);
}
@@ -54,7 +54,7 @@ ACE_Timeprobe<ACE_LOCK>::timeprobe (u_long event)
ACE_ASSERT (this->current_size_ < this->max_size_);
this->timeprobes_[this->current_size_].event_.event_number_ = event;
- this->timeprobes_[this->current_size_].event_type_ = timeprobe_t::NUMBER;
+ this->timeprobes_[this->current_size_].event_type_ = ACE_timeprobe_t::NUMBER;
this->timeprobes_[this->current_size_].time_ = ACE_OS::gethrtime ();
this->timeprobes_[this->current_size_].thread_ = ACE_OS::thr_self ();
@@ -77,7 +77,7 @@ ACE_Timeprobe<ACE_LOCK>::timeprobe (const char *event)
ACE_ASSERT (this->current_size_ < this->max_size_);
this->timeprobes_[this->current_size_].event_.event_description_ = event;
- this->timeprobes_[this->current_size_].event_type_ = timeprobe_t::STRING;
+ this->timeprobes_[this->current_size_].event_type_ = ACE_timeprobe_t::STRING;
this->timeprobes_[this->current_size_].time_ = ACE_OS::gethrtime ();
this->timeprobes_[this->current_size_].thread_ = ACE_OS::thr_self ();
@@ -98,7 +98,7 @@ ACE_Timeprobe<ACE_LOCK>::event_descriptions (const char **descriptions,
{
ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
- Event_Descriptions events;
+ ACE_Event_Descriptions events;
events.descriptions_ = descriptions;
events.minimum_id_ = minimum_id;
@@ -153,7 +153,7 @@ ACE_Timeprobe<ACE_LOCK>::print_times (void)
template <class ACE_LOCK> const char *
ACE_Timeprobe<ACE_LOCK>::find_description_i (u_long i)
{
- if (this->timeprobes_[i].event_type_ == timeprobe_t::STRING)
+ if (this->timeprobes_[i].event_type_ == ACE_timeprobe_t::STRING)
return this->timeprobes_[i].event_.event_description_;
else
{
@@ -182,7 +182,7 @@ ACE_Timeprobe<ACE_LOCK>::sort_event_descriptions_i (void)
i++)
{
EVENT_DESCRIPTIONS::iterator iterator = this->event_descriptions_.begin ();
- Event_Descriptions min_entry = *iterator;
+ ACE_Event_Descriptions min_entry = *iterator;
for (;
iterator != this->event_descriptions_.end ();
diff --git a/ace/Timeprobe.h b/ace/Timeprobe.h
index 6e8af138d3a..114d3d38c78 100644
--- a/ace/Timeprobe.h
+++ b/ace/Timeprobe.h
@@ -8,6 +8,54 @@
#include "ace/Malloc.h"
+// = Event Descriptions
+struct ACE_Event_Descriptions
+{
+ const char **descriptions_;
+ // Event descriptions
+
+ u_long minimum_id_;
+ // Minimum id of this description set
+
+ int operator== (const ACE_Event_Descriptions &rhs) const
+ {
+ return
+ this->minimum_id_ == rhs.minimum_id_ &&
+ this->descriptions_ == rhs.descriptions_;
+ }
+ // Comparison
+};
+
+// = Time probe record
+struct ACE_timeprobe_t
+{
+ union event
+ {
+ u_long event_number_;
+ const char *event_description_;
+ };
+ // Events are record as strings or numbers
+
+ enum event_type
+ {
+ NUMBER,
+ STRING
+ };
+ // Type of event
+
+ event event_;
+ // Event
+
+ event_type event_type_;
+ // Event type
+
+ ACE_hrtime_t time_;
+ // Timestamp
+
+ ACE_thread_t thread_;
+ // Id of thread posting the time probe
+};
+
template <class ACE_LOCK>
class ACE_Timeprobe
{
@@ -80,25 +128,7 @@ protected:
typedef ACE_Timeprobe<ACE_LOCK> SELF;
// Self
- // = Event Descriptions
- struct Event_Descriptions
- {
- const char **descriptions_;
- // Event descriptions
-
- u_long minimum_id_;
- // Minimum id of this description set
-
- int operator== (const Event_Descriptions &rhs) const
- {
- return
- this->minimum_id_ == rhs.minimum_id_ &&
- this->descriptions_ == rhs.descriptions_;
- }
- // Comparison
- };
-
- typedef ACE_Unbounded_Set<Event_Descriptions> EVENT_DESCRIPTIONS;
+ typedef ACE_Unbounded_Set<ACE_Event_Descriptions> EVENT_DESCRIPTIONS;
// We can hold multiple event description tables
EVENT_DESCRIPTIONS event_descriptions_;
@@ -120,37 +150,7 @@ protected:
void sort_event_descriptions_i (void);
// Sort event descriptions
- // = Time probe record
- struct timeprobe_t
- {
- union event
- {
- u_long event_number_;
- const char *event_description_;
- };
- // Events are record as strings or numbers
-
- enum event_type
- {
- NUMBER,
- STRING
- };
- // Type of event
-
- event event_;
- // Event
-
- event_type event_type_;
- // Event type
-
- ACE_hrtime_t time_;
- // Timestamp
-
- ACE_thread_t thread_;
- // Id of thread posting the time probe
- };
-
- timeprobe_t *timeprobes_;
+ ACE_timeprobe_t *timeprobes_;
// Time probe slots
ACE_Allocator *allocator_;
@@ -216,15 +216,15 @@ typedef ACE_Timeprobe<ACE_TIMEPROBE_MUTEX> ACE_TIMEPROBE_WITH_LOCKING;
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>;
template class ACE_Function_Timeprobe<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX> >;
-template class ACE_Unbounded_Set_Iterator<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>::Event_Descriptions>;
-template class ACE_Unbounded_Set<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>::Event_Descriptions>;
-template class ACE_Node<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>::Event_Descriptions>;
+template class ACE_Unbounded_Set_Iterator<ACE_Event_Descriptions>;
+template class ACE_Unbounded_Set<ACE_Event_Descriptions>;
+template class ACE_Node<ACE_Event_Descriptions>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>
#pragma instantiate ACE_Function_Timeprobe<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX> >
-#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>::Event_Descriptions>
-#pragma instantiate ACE_Unbounded_Set<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>::Event_Descriptions>
-#pragma instantiate ACE_Node<ACE_Timeprobe<ACE_TIMEPROBE_MUTEX>::Event_Descriptions>
+#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_Event_Descriptions>
+#pragma instantiate ACE_Unbounded_Set<ACE_Event_Descriptions>
+#pragma instantiate ACE_Node<ACE_Event_Descriptions>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
// If ACE_TSS_TIMEPROBES is defined, store the ACE_Timeprobe singleton
@@ -271,7 +271,7 @@ template class ACE_Singleton<ACE_TIMEPROBE_WITH_LOCKING, ACE_SYNCH_MUTEX>;
# define ACE_TIMEPROBE_RESET
# define ACE_TIMEPROBE(id)
# define ACE_TIMEPROBE_PRINT
-# define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) ACE_UNUSED_ARG (descriptions)
+# define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) static const char **ace_timeprobe_##descriptions##_dummy = descriptions
# define ACE_FUNCTION_TIMEPROBE(X)
#endif /* ACE_ENABLE_TIMEPROBES */