diff options
author | storri <storri@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-11 22:52:28 +0000 |
---|---|---|
committer | storri <storri@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-11 22:52:28 +0000 |
commit | fac2ef45b53d012d802492dc91a95c8289050f9b (patch) | |
tree | cf7b33c864ce7174a5472eb66c62a24c279bda2b | |
parent | fe0352183ebd456edf4e390803579e47cde79716 (diff) | |
download | ATCD-fac2ef45b53d012d802492dc91a95c8289050f9b.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Makefile.Metrics | 37 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp | 81 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h | 5 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.i | 196 |
4 files changed, 171 insertions, 148 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Makefile.Metrics b/TAO/orbsvcs/orbsvcs/Makefile.Metrics index 50a120c6e3d..fedfc3ec60a 100644 --- a/TAO/orbsvcs/orbsvcs/Makefile.Metrics +++ b/TAO/orbsvcs/orbsvcs/Makefile.Metrics @@ -50,7 +50,7 @@ endif #---------------------------------------------------------------------------- include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU include $(TAO_ROOT)/rules.tao.GNU -LSRC = $(addsuffix .cpp, $(FILES)) +LSRC = $(addsuffix .cpp, $(FILES)) $(IDL_SRC) ifeq (,$(TAO_ORBSVCS)) BUILD += ORBSVCS_COMPONENTS else @@ -67,7 +67,7 @@ include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU include $(ACE_ROOT)/include/makeinclude/rules.local.GNU include $(TAO_ROOT)/taoconfig.mk -CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao +CPPFLAGS += -I../../orbsvcs -I../.. -I../../tao -I../../.. ifeq ($(shared_libs),1) ifneq ($(SHLIB),) CPPFLAGS += -DTAO_METRICS_BUILD_DLL @@ -80,15 +80,10 @@ endif endif -LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao -TAO_IDLFLAGS += -I$(TAO_ROOT) \ - -Ge 1 \ - -Wb,export_macro=TAO_Metrics_Export \ - -Wb,export_include=Metrics/metrics_export.h \ - -Wb,pre_include=ace/pre.h \ - -Wb,post_include=ace/post.h +LDFLAGS += -L../../orbsvcs/orbsvcs -L../../tao -L../../../ace +TAO_IDLFLAGS += -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -Wb,export_macro=TAO_Naming_Export -Wb,export_include=Naming/naming_export.h -I../.. -I$(TAO_ROOT)/orbsvcs -Ge 1 -Sc -ACE_SHLIBS = -lTAO_PortableServer -lTAO $(ACELIB) +ACE_SHLIBS = -lTAO_RtecScheduler -lTAO_TimeBase -lTAO_PortableServer -lTAO $(ACELIB) #---------------------------------------------------------------------------- # Local targets @@ -107,9 +102,27 @@ ADDITIONAL_IDL_TARGETS = idl_stubs: $(ADDITIONAL_IDL_TARGETS) -all: idl_stubs +all: TimeBaseC.h RtecBaseC.h RtecSchedulerC.h CosNamingC.h RtecEventCommC.h RtecDefaultEventDataC.h + $(foreach ext, $(IDL_EXT), $(foreach file, $(IDL_FILES), $(file)$(ext))) + +RtecSchedulerC.h: RtecScheduler.idl + $(TAO_ROOT)/TAO_IDL/tao_idl $(TAO_IDLFLAGS) RtecScheduler.idl + +TimeBaseC.h: TimeBase.idl + $(TAO_ROOT)/TAO_IDL/tao_idl $(TAO_IDLFLAGS) TimeBase.idl + +RtecBaseC.h: RtecBase.idl + $(TAO_ROOT)/TAO_IDL/tao_idl $(TAO_IDLFLAGS) RtecBase.idl + +RtecEventCommC.h: RtecEventComm.idl + $(TAO_ROOT)/TAO_IDL/tao_idl $(TAO_IDLFLAGS) RtecEventComm.idl + +RtecDefaultEventDataC.h: RtecDefaultEventData.idl + $(TAO_ROOT)/TAO_IDL/tao_idl $(TAO_IDLFLAGS) RtecDefaultEventData.idl + +CosNamingC.h: CosNaming.idl + $(TAO_ROOT)/TAO_IDL/tao_idl $(TAO_IDLFLAGS) CosNaming.idl -.PRECIOUS: $(foreach ext, $(IDL_EXT), $(foreach file, $(IDL_FILES), $(file)$(ext))) realclean: clean compclean -$(RM) $(foreach ext, $(IDL_EXT), $(foreach file, $(IDL_FILES), $(file)$(ext))) diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp index d0ea2bd6f03..4ddd23e1ab9 100644 --- a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp @@ -10,7 +10,7 @@ #endif ////////////////////////////////////// -// Class TAO_Metrics_LocalTimeprobe // +// Class TAO_Metrics_LocalTimeprobe //g ////////////////////////////////////// // Default constructor. @@ -33,15 +33,15 @@ void TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_full_interval_times) { u_long data_set_length = 0; - + // Modified by BRM. This should also work for ACE_Based_Pointer since the conversion // operator should fire. - // Metrics::TimeprobeParameter_Set * data_set = data_set_.addr (); - Metrics::TimeprobeParameter_Set * data_set = data_set_; - + // Metrics::TimeprobeParameter_Set * data_set = data_set_.addr (); + Metrics::TimeprobeParameter_Set * data_set = data_set_; + ACE_Time_Value full_start_time (ACE_Time_Value::zero); ACE_Time_Value full_stop_time (ACE_Time_Value::zero); - + if (!data_set) { #if defined (METRICS_CACHE_ERROR_OUTPUT_ENABLED) @@ -55,10 +55,10 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu { data_set_length = data_set->length (); } - + if (this->current_size_ == 0 && this->report_buffer_full_ == 0) return; - + u_long valid_intervals = 0; int good_interval; @@ -83,7 +83,7 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu { // If we see the start event, then reset the cross thread indicator is_cross_thread_event = 0; - + if (!full_interval_start_ndx_set) { full_interval_start_ndx_set = 1; @@ -93,10 +93,10 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu // Accumulates elapsed time in the measured interval, taking // into account paired suspend and resume markers. ACE_Time_Value elapsed_time (ACE_Time_Value::zero); - + // Stores current start time: either from a start or resume event. ACE_Time_Value start_time (this->timeprobes ()[start_evt_ndx].time_); - + // Check if this start time is less than the full interval for worse // case time. if (full_start_time == ACE_Time_Value::zero || @@ -111,9 +111,9 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu full_stop_time.set (this->timeprobes ()[start_evt_ndx].time_.sec (), this->timeprobes ()[start_evt_ndx].time_.usec ()); } - + good_interval = 1; - + // Increment past the start event and start looking for the stop event u_long stop_or_suspend_evt_ndx = (start_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end. do @@ -123,7 +123,7 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu { break; } - + // This needs to be rethought... Events that occur across threads are a real thing. // So for now, the behavior is to just indicate the events that are cross thread // if (this->timeprobes ()[start_evt_ndx].thread_ != this->timeprobes ()[stop_or_suspend_evt_ndx].thread_) @@ -131,7 +131,7 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu // stop_or_suspend_evt_ndx = (stop_or_suspend_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end. // continue; // } - + // Check for the stop event if (is_event (this->timeprobes ()[stop_or_suspend_evt_ndx], ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_STOP)) @@ -145,11 +145,11 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu is_cross_thread_event = 1; } - + // done this way for efficiency: no temporaries constructed elapsed_time += this->timeprobes ()[stop_or_suspend_evt_ndx].time_; elapsed_time -= start_time; - + // This doesn't make sense. Full start time better be the result of // a start event. // if (full_start_time == ACE_Time_Value::zero || @@ -158,7 +158,7 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu // full_start_time.set (this->timeprobes()[j].time_.sec (), // this->timeprobes()[j].time_.usec()); // } - + if (full_stop_time == ACE_Time_Value::zero || this->timeprobes ()[stop_or_suspend_evt_ndx].time_ > full_stop_time) { @@ -223,11 +223,11 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu // start and the suspend event. elapsed_time += this->timeprobes ()[stop_or_suspend_evt_ndx].time_ - start_time; - + // Update the start time to be that of the // resume event. start_time = this->timeprobes ()[resume_evt_ndx].time_; - + // This code doesn't make sense here. It always has to hit the stop to // adjust the stop time. Anything else is a partial and invalid. // if (full_start_time == ACE_Time_Value::zero || @@ -243,9 +243,9 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu // full_stop_time. // set (this->timeprobes()[resume_evt_ndx].time_.sec (), // this->timeprobes()[resume_evt_ndx].time_.usec ()); -// } - - +// } + + // Keep looking for the end of the interval // after the resume event. stop_or_suspend_evt_ndx = resume_evt_ndx; @@ -263,9 +263,9 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu good_interval = 0; break; } - + resume_evt_ndx = (resume_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end. - + } while (resume_evt_ndx != this->current_size_); } @@ -280,17 +280,17 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_fu // just ignore the previous start time stamp. break; } - + stop_or_suspend_evt_ndx = (stop_or_suspend_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end. - + } while (stop_or_suspend_evt_ndx != this->current_size_ && good_interval); - - // If we found the stop of + + // If we found the stop of start_evt_ndx = stop_or_suspend_evt_ndx; } - + start_evt_ndx = (start_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end. - + } while (start_evt_ndx < this->current_size_); @@ -339,7 +339,7 @@ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::flush_TAO_Metrics_LocalTimeprob template <class ACE_LOCK, class ALLOCATOR> -void +void TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::reset_statistics () { // Call the base class reset method first. @@ -360,8 +360,8 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::reset_statistics () data_base = (*base_iter).int_id_; // Modified by BRM. This should also work for ACE_Based_Pointer since the conversion // operator should fire. -// if (data_base.addr ()) - if (data_base) +// if (data_base.addr ()) + if (data_base) { data_base->probe.reset (); } @@ -381,13 +381,13 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::reset_statistics () // operator should fire. // data = (*data_iter).int_id_.addr (); data = (*data_iter).int_id_; - if (data) - { + if (data) + { data->probe.reset (); data->missed_deadlines = 0; data->made_deadlines = 0; data->cancellations = 0; - } + } } } @@ -415,8 +415,8 @@ flush_TAO_Metrics_LocalCache () // flush the monitor data map hash table // cacheFlush (DATA_CACHE, - // &monitor_maps_ [this->consumer_index_], - // sizeof (METRICS_MONITOR_MAP)); + // &monitor_maps_ [this->consumer_index_], + // sizeof (METRICS_MONITOR_MAP)); // flush the nodes in the monitor data map hash table // and the data stored in the nodes. @@ -459,7 +459,7 @@ flush_TAO_Metrics_LocalCache () // DATA_CACHE, // this->enqueue_probes_ [this->consumer_index_], // this-> - // probe_set_size_ + // probe_set_size_ // * sizeof (ACE_Metrics_Timeprobe<ACE_LOCK,ALLOCATOR> *)); // cacheFlush ( // DATA_CACHE, @@ -487,4 +487,3 @@ flush_TAO_Metrics_LocalCache () #endif /* __ACE_INLINE__ */ #endif /* METRICS_LOCAL_CACHE_T_CPP */ - diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h index b1192e2552e..7930a21375e 100644 --- a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h +++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h @@ -30,7 +30,7 @@ //DCL:Commented out to remove Linux compile error //#include "orbsvcs/Metrics/Metrics_LocalCache.h" -template <class ACE_LOCK, class ALLOCATOR> +template <typename ACE_LOCK, typename ALLOCATOR> class TAO_Metrics_LocalTimeprobe : public ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> { @@ -163,7 +163,7 @@ public: // Type of entry in monitor map. typedef ACE_Hash_Map_Iterator_Ex<RtecScheduler::handle_t, - ACE_METRICS_CACHE_DATA_TYPE, + ACE_METRICS_CACHE_DATA_TYPE, ACE_Hash<RtecScheduler::handle_t>, ACE_Equal_To<RtecScheduler::handle_t>, ACE_Null_Mutex> @@ -326,4 +326,3 @@ public: #endif /* __ACE_INLINE__ */ #endif /* METRICS_LOCAL_CACHE_T_H */ - diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.i b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.i index f35c960698d..02dce4c45e3 100644 --- a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.i +++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.i @@ -56,7 +56,7 @@ TAO_Metrics_LocalCache (u_long table_size, // Ensure that the high res timer global scale factor // is set before any of its static methods are used ACE_High_Res_Timer::global_scale_factor (); - + // Allocate the probe arrays, based on passed count if (init (number_of_probes) != 0) { @@ -77,14 +77,14 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) { #if defined (METRICS_CACHE_ERROR_OUTPUT_ENABLED) ACE_ERROR ((LM_ERROR, - "TAO_Metrics_LocalCache::init " + "TAO_Metrics_LocalCache::init " "number_of_probes out of range")); #endif return -1; } - + // Allocate the probe arrays, based on passed count - + u_long *count_temp = 0; ACE_NEW_MALLOC_ARRAY_RETURN (count_temp, (u_long *) this->allocator ()-> @@ -103,7 +103,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) number_of_probes, -1); enqueue_count_ [1] = count_temp; - + ACE_NEW_MALLOC_ARRAY_RETURN (count_temp, (u_long *) this->allocator ()-> malloc (sizeof (u_long) @@ -112,7 +112,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) number_of_probes, -1); dequeue_count_ [0] = count_temp; - + ACE_NEW_MALLOC_ARRAY_RETURN (count_temp, (u_long *) this->allocator ()-> malloc (sizeof (u_long) @@ -121,9 +121,9 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) number_of_probes, -1); dequeue_count_ [1] = count_temp; - + ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE * probes_temp; - + ACE_NEW_MALLOC_ARRAY_RETURN (probes_temp, (ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE*) this->allocator ()-> @@ -133,7 +133,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) number_of_probes, -1); enqueue_probes_ [0] = probes_temp; - + ACE_NEW_MALLOC_ARRAY_RETURN (probes_temp, (ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE*) this->allocator ()-> @@ -143,8 +143,8 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) number_of_probes, -1); enqueue_probes_ [1] = probes_temp; - - ACE_NEW_MALLOC_ARRAY_RETURN (probes_temp, + + ACE_NEW_MALLOC_ARRAY_RETURN (probes_temp, (ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE*) this->allocator ()-> malloc (sizeof(ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE) @@ -153,7 +153,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) number_of_probes, -1); dequeue_probes_ [0] = probes_temp; - + ACE_NEW_MALLOC_ARRAY_RETURN (probes_temp, (ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE*) this->allocator ()-> @@ -187,8 +187,8 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) // Modified by BRM. Not sure what the equivalent for ACE_Based_Pointers is. // enqueue_probes_ [1].addr () [i] = timeprobe_temp; enqueue_probes_ [1][i] = timeprobe_temp; - - ACE_NEW_MALLOC_RETURN (timeprobe_temp, + + ACE_NEW_MALLOC_RETURN (timeprobe_temp, (TAO_METRICS_TIMEPROBE_TYPE *) this-> allocator ()-> malloc (sizeof (TAO_METRICS_TIMEPROBE_TYPE)), @@ -197,7 +197,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) // Modified by BRM. Not sure what the equivalent for ACE_Based_Pointers is. // dequeue_probes_ [0].addr () [i] = timeprobe_temp; dequeue_probes_ [0][i] = timeprobe_temp; - + ACE_NEW_MALLOC_RETURN (timeprobe_temp, (TAO_METRICS_TIMEPROBE_TYPE *) this-> allocator ()-> @@ -208,10 +208,10 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) // dequeue_probes_ [1].addr () [i] = timeprobe_temp; dequeue_probes_ [1][i] = timeprobe_temp; } - + ACE_METRICS_STRING_TYPE * names_temp; u_int j = 0; - names_temp = + names_temp = (ACE_METRICS_STRING_TYPE*) this->allocator ()-> malloc (sizeof (ACE_METRICS_STRING_TYPE) * number_of_probes); if (names_temp == 0) @@ -229,8 +229,8 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) } } enqueue_names_ = names_temp; - - names_temp = + + names_temp = (ACE_METRICS_STRING_TYPE*) this->allocator ()-> malloc (sizeof (ACE_METRICS_STRING_TYPE) * number_of_probes); if (names_temp == 0) @@ -260,7 +260,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) TAO_Metrics_Utils::METRICS_BUFSIZE * 2 * number_of_probes, -1); - + // Iterate to initialize the arrays for (i = 0; i < number_of_probes; ++i) { @@ -314,7 +314,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) // this->enqueue_probes_ [1].addr () [i].addr ()-> this->enqueue_probes_ [1] [i]-> increase_size (this->table_size_); - + // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // this->dequeue_count_ [0].addr() [i] = 0; this->dequeue_count_ [0][i] = 0; @@ -362,7 +362,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::init (u_long number_of_probes) // If we got here we're pretty much OK. this->probe_set_size_ = number_of_probes; - + return 0; } @@ -384,7 +384,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () this->allocator ()->free (enqueue_names_ [0]); } } - + // Destroy storage allocated to hold counts. // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // if (enqueue_count_ [0].addr ()) @@ -418,7 +418,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () // this->allocator ()->free (dequeue_count_ [1].addr()); this->allocator ()->free (dequeue_count_ [1]); } - + // Destroy the actual probes TAO_METRICS_TIMEPROBE_TYPE *probe_ptr; for (u_int i = 0; i < this->probe_set_size_; ++i) @@ -511,7 +511,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () } TAO_Metrics_Cache_Data_Base * base_data = 0; - + for (METRICS_BASE_MONITOR_MAP_ITERATOR base_iter_0 (this-> base_monitor_maps_ [0]); base_iter_0.done () == 0; @@ -520,7 +520,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // base_data = (*base_iter_0).int_id_.addr (); base_data = (*base_iter_0).int_id_; - if (base_data) + if (base_data) { // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // if (base_data->probe_name.addr ()) @@ -545,7 +545,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // base_data = (*base_iter_1).int_id_.addr (); base_data = (*base_iter_1).int_id_; - if (base_data) + if (base_data) { // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // if (base_data->probe_name.addr ()) @@ -563,7 +563,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () } TAO_Metrics_Cache_Data * data = 0; - + for (METRICS_MONITOR_MAP_ITERATOR data_iter_0 (this->monitor_maps_ [0]); data_iter_0.done () == 0; ++data_iter_0) @@ -571,7 +571,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // data = (*data_iter_0).int_id_.addr (); data = (*data_iter_0).int_id_; - if (data) + if (data) { // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // if (data->probe_name.addr ()) @@ -581,7 +581,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () // this->allocator ()->free (data->probe_name.addr ()); this->allocator ()->free (data->probe_name); } - + ACE_DES_FREE (data, this->allocator ()->free, TAO_Metrics_Cache_Data); @@ -595,7 +595,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // data = (*data_iter_1).int_id_.addr (); data = (*data_iter_1).int_id_; - if (data) + if (data) { // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // if (data->probe_name.addr ()) @@ -605,7 +605,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::fini () // this->allocator ()->free (data->probe_name.addr ()); this->allocator ()->free (data->probe_name); } - + ACE_DES_FREE (data, this->allocator ()->free, TAO_Metrics_Cache_Data); @@ -640,7 +640,7 @@ register_upcall_adapter (RtecScheduler::handle_t handle, malloc (sizeof (TAO_Metrics_Cache_Data)), TAO_Metrics_Cache_Data); data = data_temp; - + char * probe_name_temp; ACE_NEW_MALLOC_ARRAY (probe_name_temp, (char *) this->allocator ()-> @@ -662,19 +662,19 @@ register_upcall_adapter (RtecScheduler::handle_t handle, // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // probe_name.addr ()); probe_name); - + data_temp->probe.mark_as_operation (); data_temp->probe.set_hrt (is_hrt); - + data_temp->is_hrt = is_hrt; - + data_temp->probe.probe_id (this->upcall_adapter_count_ + TAO_Metrics_Utils::METRICS_UPCALL_MONITOR_ADAPTER_ID_BASE); - + data_temp->missed_deadlines = 0; data_temp->made_deadlines = 0; data_temp->cancellations = 0; - + if (monitor_maps_ [i].rebind (handle, data) < 0) { #if defined (METRICS_CACHE_ERROR_OUTPUT_ENABLED) @@ -684,7 +684,7 @@ register_upcall_adapter (RtecScheduler::handle_t handle, #endif return; } - + } } @@ -707,9 +707,9 @@ register_base_metrics (const char *name, { ACE_METRICS_CACHE_DATA_BASE_TYPE base_data = 0; TAO_Metrics_Cache_Data_Base * base_data_temp = 0; - RtecScheduler::handle_t handle = + RtecScheduler::handle_t handle = this->next_base_metrics_handle_++; - + for (u_int i = 0; i < 2; ++i) { // Look for an existing data structure entry in each hash map. @@ -726,7 +726,7 @@ register_base_metrics (const char *name, TAO_Metrics_Cache_Data_Base, RtecScheduler::handle_t (-1)); base_data = base_data_temp; - + char * probe_name_temp; ACE_NEW_MALLOC_ARRAY_RETURN (probe_name_temp, (char *) this->allocator ()->malloc @@ -735,7 +735,7 @@ register_base_metrics (const char *name, TAO_Metrics_Utils::METRICS_BUFSIZE, RtecScheduler::handle_t (-1)); base_data_temp->probe_name = probe_name_temp; - + ACE_OS::memset (base_data_temp-> // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // probe_name.addr (), 0, TAO_Metrics_Utils::METRICS_BUFSIZE); @@ -748,7 +748,7 @@ register_base_metrics (const char *name, // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // probe_name.addr ()); probe_name); - + switch (bmt) { case TAO_Metrics_Utils::SCHED: @@ -787,7 +787,7 @@ register_base_metrics (const char *name, " bind failed.\n")); #endif } - + } } @@ -859,7 +859,7 @@ report_upcall_stop (RtecScheduler::handle_t handle, ACE_Time_Value current_time; ACE_hrtime_t hrtime_now = ACE_OS::gethrtime (); ACE_High_Res_Timer::hrtime_to_tv (current_time, hrtime_now); - + ACE_METRICS_CACHE_DATA_TYPE data = 0; TAO_Metrics_Cache_Data * data_tmp = 0; if (monitor_maps_ [supplier_index_].find (handle, data) < 0) @@ -889,7 +889,7 @@ report_upcall_stop (RtecScheduler::handle_t handle, // Take timeprobe stamp data_tmp->probe.timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>:: WORK_STOP); - + this->interval_end_ = data_tmp->probe.last_recorded_timestamp (); @@ -949,7 +949,7 @@ report_upcall_cancellation (RtecScheduler::handle_t handle) { // Increment the cancellation count for that operation. ++data_tmp->cancellations; - + // Update the metrics interval endpoint(s). if (this->interval_initialized_) { @@ -1009,7 +1009,7 @@ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::report_base_metrics_start (RtecSche this->interval_end_.set (this->interval_start_.sec (), this->interval_start_.usec ()); } - + // Take timeprobe stamp base_data_tmp->probe.timeprobe (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>:: WORK_START); @@ -1217,7 +1217,7 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::register_probes (Metrics:: // Sequence to register probe names and ids with the logger. Metrics::ProbeIdentity_Set probe_identities (this->probe_set_size_ * 2); probe_identities.length (this->probe_set_size_ * 2); - + for (u_int i = 0; i < this->probe_set_size_; ++i) { // Batch up the enqueue ids and enqueue names so we @@ -1228,14 +1228,14 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::register_probes (Metrics:: // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // (const char *) this->enqueue_names_.addr () [i].addr (); (const char *) this->enqueue_names_ [i]; - probe_identities [i + this->probe_set_size_].probe_id = + probe_identities [i + this->probe_set_size_].probe_id = i + TAO_Metrics_Utils::METRICS_DEQUEUE_PROBE_ID_BASE; probe_identities [i + this->probe_set_size_].probe_name = // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // (const char *) this->dequeue_names_.addr () [i].addr (); (const char *) this->dequeue_names_ [i]; } - + logger->set_identities (probe_identities, ACE_TRY_ENV); ACE_TRY_CHECK; } @@ -1248,13 +1248,13 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::register_probes (Metrics:: return -1; } ACE_ENDTRY; - + return 0; } template <class ACE_LOCK, class ALLOCATOR> -ACE_INLINE void +ACE_INLINE void TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::output_statistics (Metrics::QoSLogger_ptr logger) { if (metrics_enabled_) @@ -1268,27 +1268,28 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::output_statistics (Metrics #endif return; } - + Metrics::TimeprobeParameter_Set data_set; Metrics::QoSParameter_Set qos_set; - + // For each probe on the metrics consumer side, install data set, // call probe's report_intervals method, and then uninstall data // set. - + for (u_int j = 0; j < this->probe_set_size_; ++j) { { // The cast is needed to convert the base class pointer - // (which we got from the (outer) based pointer addr () call) to a + // (which we got from the (outer) based pointer addr () call) to a // derived class pointer. - TAO_METRICS_TIMEPROBE_TYPE *probe_ptr = - ACE_dynamic_cast (TAO_METRICS_TIMEPROBE_TYPE *, - this-> - enqueue_probes_ + TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR> *probe_ptr = + ACE_dynamic_cast_2_ptr (TAO_Metrics_LocalTimeprobe, + ACE_LOCK, + ALLOCATOR, + *this->enqueue_probes_[j]); // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // [this->consumer_index_].addr () [j].addr ()); - [this->consumer_index_] [j]); + if (probe_ptr) { probe_ptr->install_data_set (& data_set); @@ -1310,9 +1311,16 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::output_statistics (Metrics } // Iterate over registered base metrics data and harvest those probes. - TAO_Metrics_Cache_Data_Base * base_data = 0; - METRICS_BASE_MONITOR_MAP_ITERATOR - base_iter (this->base_monitor_maps_ [this->consumer_index_]); + ACE_Metrics_Cache<ACE_LOCK,ALLOCATOR>:: + TAO_Metrics_LocalCache<ACE_LOCK,ALLOCATOR>:: + TAO_Metrics_ReportingLocalCache<ACE_LOCK,ALLOCATOR>:: + TAO_Metrics_Cache_Data_Base * base_data = 0; + + ACE_Hash_Map_Iterator_Ex<RtecScheduler::handle_t, + ACE_Based_Pointer<TAO_Metrics_Cache_Data_Base>, + ACE_Hash<RtecScheduler::handle_t>, + ACE_Equal_To<RtecScheduler::handle_t>, + ACE_Null_Mutex> base_iter (this->base_monitor_maps_ [this->consumer_index_]); for (; base_iter.done () == 0; ++base_iter) @@ -1320,7 +1328,7 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::output_statistics (Metrics // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // base_data = (*base_iter).int_id_.addr (); base_data = (*base_iter).int_id_; - if (base_data) + if (base_data) { base_data->probe.install_data_set (& data_set); base_data->probe.report_intervals (); @@ -1331,22 +1339,27 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::output_statistics (Metrics // Iterate over registered upcall data and harvest those probes, and // the aggregate QoS data too. - TAO_Metrics_Cache_Data * data = 0; - METRICS_MONITOR_MAP_ITERATOR - data_iter (this->monitor_maps_ [this->consumer_index_]); + TAO_Metrics_Cache_Data_Base::TAO_Metrics_Cache_Data * data = 0; + + ACE_Hash_Map_Iterator_Ex<RtecScheduler::handle_t, + ACE_Based_Pointer<TAO_Metrics_Cache_Data_Base>, + ACE_Hash<RtecScheduler::handle_t>, + ACE_Equal_To<RtecScheduler::handle_t>, + ACE_Null_Mutex> data_iter (this->monitor_maps_ [this->consumer_index_]); + for (u_long qos_length = 1; - data_iter.done () == 0; - ++data_iter, ++qos_length) - { -// Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers -// data = (*data_iter).int_id_.addr (); + data_iter.done () == 0; + ++data_iter, ++qos_length) + { + // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers + // data = (*data_iter).int_id_.addr (); data = (*data_iter).int_id_; - if (data) + if (data) { data->probe.install_data_set (& data_set); data->probe.report_intervals (); data->probe.install_data_set (0); - + qos_set.length (qos_length); qos_set [qos_length - 1].entry_point // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers @@ -1360,18 +1373,18 @@ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR>::output_statistics (Metrics } // Then, give harvested data sets to the remote logger. - + Metrics::Time interval; ACE_Time_Value interval_tv ((this->interval_initialized_) ? (this->interval_end_ - this->interval_start_) : ACE_Time_Value::zero); ORBSVCS_Time::Time_Value_to_TimeT (interval, interval_tv); - + ACE_TRY_NEW_ENV { logger->log_timeprobe_data (data_set, interval, ACE_TRY_ENV); ACE_TRY_CHECK; - + logger->log_aggregate_QoS (qos_set, interval, ACE_TRY_ENV); ACE_TRY_CHECK; } @@ -1410,7 +1423,7 @@ register_upcall_adapter (RtecScheduler::handle_t handle, TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR> *base_ptr = this; const unsigned short incr_upcall_id = 0; base_ptr->register_upcall_adapter (handle, name, is_hrt, incr_upcall_id); - + // Look for an existing data structure entry in the 0th hash map. ACE_METRICS_CACHE_DATA_TYPE data = 0; if (monitor_maps_ [0].find (handle, data) != 0) @@ -1422,7 +1435,7 @@ register_upcall_adapter (RtecScheduler::handle_t handle, #endif return; } - + // Register upcall monitor adapter's name and id with the logger: // allows registrations of the same adapter under different ids. // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers @@ -1437,7 +1450,7 @@ register_upcall_adapter (RtecScheduler::handle_t handle, // (const char *) data.addr ()->probe_name.addr (); (const char *) data->probe_name; - // Increment the probe id now that we're finished using it. + // Increment the probe id now that we're finished using it. this->increment_upcall_handle(); ACE_TRY_NEW_ENV @@ -1471,13 +1484,13 @@ register_base_metrics (const char *name, TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR> *base_ptr = this; const unsigned short incr_probe_id = 0; RtecScheduler::handle_t handle = base_ptr->register_base_metrics (name, bmt, incr_probe_id); - + // If there was an error, just return. if (handle == 0) { return handle; } - + // Look for an existing data structure entry in each hash map. ACE_METRICS_CACHE_DATA_BASE_TYPE base_data = 0; if (base_monitor_maps_ [0].find (handle, base_data) != 0) @@ -1489,15 +1502,15 @@ register_base_metrics (const char *name, #endif return 0; } - + // Register base metrics segment name and id with the logger. - + // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // if (! CORBA::is_nil (logger) && base_data.addr () != 0) if (! CORBA::is_nil (logger) && base_data != 0) { Metrics::ProbeIdentity_t probe_identity; - + switch (bmt) { case TAO_Metrics_Utils::SCHED: @@ -1525,12 +1538,12 @@ register_base_metrics (const char *name, // Now increment the handle. increment_base_handle(bmt); - + probe_identity.probe_name = // Modified by BRM. Not sure what the equivalent is for ACE_Based_Pointers // (const char *) base_data.addr ()->probe_name.addr (); (const char *) base_data->probe_name; - + ACE_TRY_NEW_ENV { logger->set_identity (probe_identity, ACE_TRY_ENV); @@ -1547,10 +1560,9 @@ register_base_metrics (const char *name, } ACE_ENDTRY; } - + return handle; } #endif /* METRICS_LOCAL_CACHE_T_I */ - |