summaryrefslogtreecommitdiff
path: root/TAO/examples/RTScheduling
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2008-06-20 12:24:23 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2008-06-20 12:24:23 +0000
commitc2d16b019a86545bc597597569b401081da69d39 (patch)
tree9ea7ac7202543aa8cc5226ea7c1c0fa47f01d12d /TAO/examples/RTScheduling
parent7a2d5b1f9ea78254f1ea7829f012d2da21a2b4df (diff)
downloadATCD-c2d16b019a86545bc597597569b401081da69d39.tar.gz
ChangeLogTag: Fri Jun 20 12:23:19 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/examples/RTScheduling')
-rw-r--r--TAO/examples/RTScheduling/DT_Creator.cpp3
-rw-r--r--TAO/examples/RTScheduling/Job_i.cpp6
-rw-r--r--TAO/examples/RTScheduling/Task_Stats.cpp2
-rw-r--r--TAO/examples/RTScheduling/Task_Stats.h4
-rw-r--r--TAO/examples/RTScheduling/Task_Stats.inl4
5 files changed, 9 insertions, 10 deletions
diff --git a/TAO/examples/RTScheduling/DT_Creator.cpp b/TAO/examples/RTScheduling/DT_Creator.cpp
index b42b608c014..76718a9a1fa 100644
--- a/TAO/examples/RTScheduling/DT_Creator.cpp
+++ b/TAO/examples/RTScheduling/DT_Creator.cpp
@@ -215,7 +215,8 @@ DT_Creator::register_synch_obj (void)
ACE_Time_Value timestamp = ACE_OS::gettimeofday ();
char buf [BUFSIZ];
- synch_name += CORBA::string_dup (ACE_OS::itoa (timestamp.sec (), buf, 10));
+ ACE_OS::sprintf(buf, "%lu\n", timestamp.sec ());
+ synch_name += buf;
name [0].id =
CORBA::string_dup (synch_name.c_str ());
diff --git a/TAO/examples/RTScheduling/Job_i.cpp b/TAO/examples/RTScheduling/Job_i.cpp
index 46d812d130d..791035aaad4 100644
--- a/TAO/examples/RTScheduling/Job_i.cpp
+++ b/TAO/examples/RTScheduling/Job_i.cpp
@@ -92,8 +92,7 @@ Job_i::work (CORBA::ULong work,
// ACE_hrtime_t now = ACE_OS::gethrtime ();
ACE_Time_Value run_time = ACE_OS::gettimeofday () - *(dt_creator_->base_time ());
- TASK_STATS::instance ()->sample (
- static_cast<ACE_UINT32> (run_time.sec ()), guid_);
+ TASK_STATS::instance ()->sample (run_time.sec (), guid_);
ACE_Time_Value count_down_time (1);
ACE_Countdown_Time count_down (&count_down_time);
@@ -107,8 +106,7 @@ Job_i::work (CORBA::ULong work,
}
run_time = ACE_OS::gettimeofday () - *(dt_creator_->base_time ());
- TASK_STATS::instance ()->sample (
- static_cast<ACE_UINT32> (run_time.sec ()), guid_);
+ TASK_STATS::instance ()->sample (run_time.sec (), guid_);
CORBA::Policy_var sched_param;
sched_param = CORBA::Policy::_duplicate (dt_creator_->sched_param (importance));
diff --git a/TAO/examples/RTScheduling/Task_Stats.cpp b/TAO/examples/RTScheduling/Task_Stats.cpp
index 52979459d49..f1c8001cc90 100644
--- a/TAO/examples/RTScheduling/Task_Stats.cpp
+++ b/TAO/examples/RTScheduling/Task_Stats.cpp
@@ -39,7 +39,7 @@ int
Task_Stats::init (size_t max_samples)
{
max_samples_ = max_samples;
- ACE_NEW_RETURN (this->thr_run_time_, ACE_UINT32[this->max_samples_], -1);
+ ACE_NEW_RETURN (this->thr_run_time_, time_t[this->max_samples_], -1);
ACE_NEW_RETURN (this->thr_count_, int[this->max_samples_], -1);
return 0;
}
diff --git a/TAO/examples/RTScheduling/Task_Stats.h b/TAO/examples/RTScheduling/Task_Stats.h
index 62f6614cf81..3380e283d87 100644
--- a/TAO/examples/RTScheduling/Task_Stats.h
+++ b/TAO/examples/RTScheduling/Task_Stats.h
@@ -61,7 +61,7 @@ class RTSCHEDTESTLIB_Export Task_Stats
void end_time (ACE_hrtime_t time);
/// Record a sample
- int sample (ACE_UINT32 thr_run_time, int thr_count);
+ int sample (time_t thr_run_time, int thr_count);
void dump_samples (const ACE_TCHAR *file_name, const ACE_TCHAR *msg,
ACE_UINT32 scale_factor);
@@ -79,7 +79,7 @@ class RTSCHEDTESTLIB_Export Task_Stats
ACE_UINT32 samples_count_;
/// The samples : the time of execution. and the recorded exec. time .
- ACE_UINT32 *thr_run_time_;
+ time_t *thr_run_time_;
int *thr_count_;
/// The minimum value
diff --git a/TAO/examples/RTScheduling/Task_Stats.inl b/TAO/examples/RTScheduling/Task_Stats.inl
index 0971502bcc0..582ad61ba85 100644
--- a/TAO/examples/RTScheduling/Task_Stats.inl
+++ b/TAO/examples/RTScheduling/Task_Stats.inl
@@ -3,13 +3,13 @@
#include "ace/Log_Msg.h"
ACE_INLINE int
-Task_Stats::sample (ACE_UINT32 thr_run_time, int thr_count)
+Task_Stats::sample (time_t thr_run_time, int thr_count)
{
if (this->samples_count_ >= this->max_samples_)
{
ACE_DEBUG ((LM_DEBUG, "Task_Stats::sample ret -1\n"));
return -1;
- }
+ }
this->thr_run_time_[this->samples_count_] = thr_run_time;
this->thr_count_[this->samples_count_] = thr_count;