diff options
-rw-r--r-- | ChangeLog-98b | 11 | ||||
-rw-r--r-- | ace/Timeprobe.h | 2 | ||||
-rw-r--r-- | ace/Timeprobe_T.cpp | 33 | ||||
-rw-r--r-- | ace/Timeprobe_T.h | 3 |
4 files changed, 49 insertions, 0 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b index e234a0b1d5a..3451f05861c 100644 --- a/ChangeLog-98b +++ b/ChangeLog-98b @@ -1,3 +1,14 @@ +Thu Jun 18 18:46:00 1998 Carlos O'Ryan <coryan@cs.wustl.edu> + + * ace/Timeprobe.h: + * ace/Timeprobe_T.h: + * ace/Timeprobe_T.cpp: + Added methods to print the absolute values, this can be used to + mix the results of several processes: por example on Sparcs the + high-res timer is a CPU register so the value is consistent + across processes, there are some potential problems with + multiple CPUs, but that's not our case. + Thu Jun 18 16:25:28 1998 Nanbor Wang <nanbor@cs.wustl.edu> * examples/Threads/task_five.cpp (main): Extracted out the body of diff --git a/ace/Timeprobe.h b/ace/Timeprobe.h index 146dbedc771..1c96ccd109d 100644 --- a/ace/Timeprobe.h +++ b/ace/Timeprobe.h @@ -96,6 +96,7 @@ typedef ACE_Singleton<ACE_TIMEPROBE_WITH_LOCKING, ACE_SYNCH_MUTEX> # define ACE_TIMEPROBE_RESET ACE_TIMEPROBE_SINGLETON::instance ()->reset () # define ACE_TIMEPROBE(id) ACE_TIMEPROBE_SINGLETON::instance ()->timeprobe (id) # define ACE_TIMEPROBE_PRINT ACE_TIMEPROBE_SINGLETON::instance ()->print_times () +# define ACE_TIMEPROBE_PRINT_ABSOLUTE ACE_TIMEPROBE_SINGLETON::instance ()->print_absolute_times () # define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) static int ace_timeprobe_##descriptions##_return = ACE_TIMEPROBE_SINGLETON::instance ()->event_descriptions (descriptions, minimum_id) # define ACE_FUNCTION_TIMEPROBE(X) ACE_Function_Timeprobe<ACE_TIMEPROBE_WITH_LOCKING> function_timeprobe (*ACE_TIMEPROBE_SINGLETON::instance (), X) @@ -104,6 +105,7 @@ typedef ACE_Singleton<ACE_TIMEPROBE_WITH_LOCKING, ACE_SYNCH_MUTEX> # define ACE_TIMEPROBE_RESET # define ACE_TIMEPROBE(id) # define ACE_TIMEPROBE_PRINT +# define ACE_TIMEPROBE_PRINT_ABSOLUTE # define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) # define ACE_FUNCTION_TIMEPROBE(X) diff --git a/ace/Timeprobe_T.cpp b/ace/Timeprobe_T.cpp index 0aa6e92fb02..58357174598 100644 --- a/ace/Timeprobe_T.cpp +++ b/ace/Timeprobe_T.cpp @@ -134,6 +134,39 @@ ACE_Timeprobe<ACE_LOCK>::print_times (void) } } +template <class ACE_LOCK> void +ACE_Timeprobe<ACE_LOCK>::print_absolute_times (void) +{ + ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); + + // Sort the event descriptions + this->sort_event_descriptions_i (); + + ACE_DEBUG ((LM_DEBUG, + "\nACE_Timeprobe; %d timestamps were recorded:\n", + this->current_size_)); + + if (this->current_size_ == 0) + return; + + ACE_DEBUG ((LM_DEBUG, + "\n%-50.50s %8.8s %13.13s\n\n", + "Event", + "thread", + "stamp")); + + for (u_long i = 0; i < this->current_size_; i++) + { + char buf[64]; + ACE_OS::sprintf (buf, "%llu", this->timeprobes_[i].time_); + ACE_DEBUG ((LM_DEBUG, + "%-50.50s %8.8x %13.13s\n", + this->find_description_i (i), + this->timeprobes_[i].thread_, + buf)); + } +} + template <class ACE_LOCK> const char * ACE_Timeprobe<ACE_LOCK>::find_description_i (u_long i) { diff --git a/ace/Timeprobe_T.h b/ace/Timeprobe_T.h index 59a343de833..4031e8921d1 100644 --- a/ace/Timeprobe_T.h +++ b/ace/Timeprobe_T.h @@ -64,6 +64,9 @@ public: 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. |