diff options
author | nshankar <nshankar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-03 21:00:06 +0000 |
---|---|---|
committer | nshankar <nshankar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-03 21:00:06 +0000 |
commit | 56a695820b452ab609c5c14005abfdb4e9fbe053 (patch) | |
tree | afe9783481b9d17230bbce21a7258aa1a716837d | |
parent | 2fcdde898660218a71503eaa8914f34c2635f705 (diff) | |
download | ATCD-56a695820b452ab609c5c14005abfdb4e9fbe053.tar.gz |
Mon Mar 3 20:57:36 UTC 2008 Nishanth Shanakran <nshankar@nospam.com>
-rw-r--r-- | ChangeLog | 37 | ||||
-rw-r--r-- | Controller/EUCON/Controller.cpp | 27 | ||||
-rw-r--r-- | descriptors/NodeDetails.dat | 7 | ||||
-rw-r--r-- | examples/E2E_Task/Subtask/Subtask.mpc | 11 | ||||
-rw-r--r-- | examples/E2E_Task/Subtask/Subtask_exec.cpp | 4 | ||||
-rw-r--r-- | examples/E2E_Task/Trigger/Trigger.mpc | 10 | ||||
-rw-r--r-- | examples/E2E_Task/Trigger/Trigger_exec.cpp | 147 | ||||
-rw-r--r-- | examples/E2E_Task/Trigger/Trigger_exec.h | 42 | ||||
-rw-r--r-- | examples/E2E_Task/descriptors/Task1.cdp | 88 | ||||
-rw-r--r-- | examples/E2E_Task/utils/App_utils.mpc | 19 | ||||
-rw-r--r-- | examples/E2E_Task/utils/Logger.cpp | 47 | ||||
-rw-r--r-- | examples/E2E_Task/utils/Logger.h | 37 | ||||
-rw-r--r-- | examples/E2E_Task/utils/Logger_export.h | 58 | ||||
-rw-r--r-- | examples/E2E_Task/utils/RACE_utils.cpp | 25 | ||||
-rw-r--r-- | examples/E2E_Task/utils/RACE_utils.h | 45 | ||||
-rw-r--r-- | examples/E2E_Task/utils/RT.cpp | 2 | ||||
-rw-r--r-- | examples/E2E_Task/utils/RT.h | 7 |
17 files changed, 475 insertions, 138 deletions
diff --git a/ChangeLog b/ChangeLog index 4c86deceac4..bbe62c2dd0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +Mon Mar 3 20:57:36 UTC 2008 Nishanth Shanakran <nshankar@nospam.com> + + * Controller/EUCON/Controller.cpp: + + Updated the debug statements. + + * descriptors/NodeDetails.dat: + + Updated this file. + + * examples/E2E_Task/Subtask/Subtask.mpc: + * examples/E2E_Task/Subtask/Subtask_exec.cpp: + * examples/E2E_Task/Trigger/Trigger.mpc: + * examples/E2E_Task/Trigger/Trigger_exec.h: + * examples/E2E_Task/Trigger/Trigger_exec.cpp: + + Enhanced the trigger and subtask implementation to use the logger. + + + * examples/E2E_Task/descriptors/Task1.cdp: + + * examples/E2E_Task/utils/App_utils.mpc: + * examples/E2E_Task/utils/Logger.h: + * examples/E2E_Task/utils/Logger.cpp: + * examples/E2E_Task/utils/Logger_export.h: + * examples/E2E_Task/utils/RACE_utils.h: + * examples/E2E_Task/utils/RACE_utils.cpp: + + Checking in the initial implementation of the application logger. + + * examples/E2E_Task/utils/RT.h: + * examples/E2E_Task/utils/RT.cpp: + + Updated these files. + + + Mon Mar 3 16:08:18 UTC 2008 Nishanth Shankaran <nshankar@nospam.com> * examples/E2E_Task/utils: diff --git a/Controller/EUCON/Controller.cpp b/Controller/EUCON/Controller.cpp index 22d2c90ad03..bbb97a6ad2c 100644 --- a/Controller/EUCON/Controller.cpp +++ b/Controller/EUCON/Controller.cpp @@ -159,6 +159,8 @@ namespace CIAO { std::stringstream msg; msg << "Entering register_string ()\n"; + this->logger_.log (msg.str()); + msg.str (""); if (this->initialized_) { if (!this->active_) @@ -168,7 +170,7 @@ namespace CIAO this->populate_task (opstring, task); this->tasks_.push_back (task); this->dump_task (task); - msg << "done!\nSuccessfully registered string with ID:" + msg << "\nSuccessfully registered string with ID:" << opstring.ID.in () << "\n"; ID = CORBA::string_dup(opstring.ID.in ()); this->logger_.log (msg.str()); @@ -243,7 +245,7 @@ namespace CIAO this->tasks_[itr].delta_rate; this->opstrings_[itr].rate.currRate = this->tasks_[itr].curr_rate; - rates << this->tasks_[itr].curr_rate + rates << this->tasks_[itr].curr_rate << "\t" << this->tasks_[itr].delta_rate << "\t"; @@ -293,7 +295,6 @@ namespace CIAO for (::CORBA::ULong i = 0; i < nodes.length(); ++i) { - this->populate_node (nodes[i], node); // Now that the node structure has been fully populated, we add // it to the doamin. @@ -301,7 +302,9 @@ namespace CIAO msg << "Added node: " << nodes [i].name.in() << " to the doamin structure.\n"; } - this->logger_.log (msg.str()); + + // std::string util (std::endl); + this->util_logger_.log (std::string ("\n")); this->domain_ = temp_domain; return true; } @@ -353,8 +356,9 @@ namespace CIAO value >>= resource.set_point; msg << "Obtained set point! Value is: " << resource.set_point << "\n"; - ACE_DEBUG ((LM_DEBUG, "\n%f\t", resource.set_point)); - util << resource.set_point; + ACE_DEBUG ((LM_DEBUG, "\n%f\t", + resource.set_point)); + } } else if (ACE_OS::strcmp (props [k].name.in (), @@ -366,16 +370,20 @@ namespace CIAO { value >>= resource.util; - // Temporary hack! We are multiplying by + // Temporary hack! We are multiplying by // the number of physical processors! //resource.util *= 4; msg << "Obtained curr util! Value is: " << resource.util << "\n"; - ACE_DEBUG ((LM_DEBUG, "%f\n", resource.util)); - util << "\t" << resource.util << "\t"; + ACE_DEBUG ((LM_DEBUG, "%f\n", resource.util)); + } } } + + // Dump these values to a file. + util << resource.set_point << "\t"; + util << resource.util << "\t"; // Now that we have populated the resource info, we add it // to the node. r_node.resources.push_back (resource); @@ -384,7 +392,6 @@ namespace CIAO } } msg << "Leaving populate_node ()\n"; - util << "\n"; this->logger_.log (msg.str ()); this->util_logger_.log (util.str()); } diff --git a/descriptors/NodeDetails.dat b/descriptors/NodeDetails.dat index 0d16e261dab..48c2f089be2 100644 --- a/descriptors/NodeDetails.dat +++ b/descriptors/NodeDetails.dat @@ -1,3 +1,6 @@ RACE_Node corbaloc:iiop:localhost:50000/NodeManager -HelloNode corbaloc:iiop:localhost:60000/NodeManager -blade36 corbaloc:iiop:pantera.dre.vanderbilt.edu:30000/NodeManager +one corbaloc:iiop:blade29.isislab.vanderbilt.edu:30000/NodeManager +two corbaloc:iiop:blade30.isislab.vanderbilt.edu:30000/NodeManager +three corbaloc:iiop:blade31.isislab.vanderbilt.edu:30000/NodeManager +four corbaloc:iiop:blade32.isislab.vanderbilt.edu:30000/NodeManager +five corbaloc:iiop:blade33.isislab.vanderbilt.edu:30000/NodeManager diff --git a/examples/E2E_Task/Subtask/Subtask.mpc b/examples/E2E_Task/Subtask/Subtask.mpc index 00f898eba7e..f4b19cb2bde 100644 --- a/examples/E2E_Task/Subtask/Subtask.mpc +++ b/examples/E2E_Task/Subtask/Subtask.mpc @@ -61,10 +61,15 @@ project(Subtask_stub) : ciao_client_dnc { project(Subtask_exec) : ciao_component_dnc { avoids += ace_for_tao - after += Subtask_cidl_gen Subtask_stub + after += Subtask_cidl_gen \ + Subtask_stub \ + App_utils + sharedname = Subtask_exec libs += Subtask_stub \ - Event_Types_stub + Event_Types_stub \ + App_utils + includes += ../Base\ ../utils @@ -76,14 +81,12 @@ project(Subtask_exec) : ciao_component_dnc { Source_Files { SubtaskEC.cpp Subtask_exec.cpp - ../utils/RT.cpp } Header_Files { SubtaskEC.h Subtask_exec.h Subtask_exec_export.h - ../utils/RT.h } Inline_Files { diff --git a/examples/E2E_Task/Subtask/Subtask_exec.cpp b/examples/E2E_Task/Subtask/Subtask_exec.cpp index fa5af4e2f24..3a05c56b237 100644 --- a/examples/E2E_Task/Subtask/Subtask_exec.cpp +++ b/examples/E2E_Task/Subtask/Subtask_exec.cpp @@ -12,8 +12,8 @@ namespace CIAO :iterations_ (1000), ID_ (::CORBA::string_dup ("CIAO::RACE::Subtaks")) { - // Ser RT priority. - set_priority (); + // Set RT priorities for the process. + RT_Utils::set_priority (); } diff --git a/examples/E2E_Task/Trigger/Trigger.mpc b/examples/E2E_Task/Trigger/Trigger.mpc index 53c02ac06ef..3f34b66e00a 100644 --- a/examples/E2E_Task/Trigger/Trigger.mpc +++ b/examples/E2E_Task/Trigger/Trigger.mpc @@ -66,13 +66,17 @@ project(Trigger_stub) : ciao_client_dnc { project(Trigger_exec) : ciao_component_dnc { avoids += ace_for_tao - after += Trigger_cidl_gen Trigger_stub + after += Trigger_cidl_gen \ + Trigger_stub \ + App_utils + sharedname = Trigger_exec includes += ../Base \ ../utils libs += Trigger_stub \ - Event_Types_stub + Event_Types_stub \ + App_utils dynamicflags = TRIGGER_EXEC_BUILD_DLL @@ -82,7 +86,6 @@ project(Trigger_exec) : ciao_component_dnc { Source_Files { TriggerEC.cpp Trigger_exec.cpp - ../utils/RT.cpp } Header_Files { @@ -90,7 +93,6 @@ project(Trigger_exec) : ciao_component_dnc { Trigger_exec.h Trigger_exec_export.h QoS.h - ../utils/RT.h } Inline_Files { diff --git a/examples/E2E_Task/Trigger/Trigger_exec.cpp b/examples/E2E_Task/Trigger/Trigger_exec.cpp index 02debbe3207..ea51c5b3673 100644 --- a/examples/E2E_Task/Trigger/Trigger_exec.cpp +++ b/examples/E2E_Task/Trigger/Trigger_exec.cpp @@ -3,6 +3,7 @@ #include "ace/OS_NS_unistd.h" #include "ace/Time_Value.h" #include "RT.h" +#include <sstream> namespace CIAO { @@ -14,23 +15,25 @@ namespace CIAO : period_ (1000), load_ (1.0), ID_ (::CORBA::string_dup ("CIAO::RACE::Task")), - active_ (false), - monitor_ (new PerfMon (*this, 1000000)) + active_ (false) { // Set RT priorities for the process. - set_priority (); + RT_Utils::set_priority (); } Trigger_exec_i::~Trigger_exec_i (void) { - delete this->monitor_; + delete this->logger_; } int Trigger_exec_i::svc () { + // Timer to measure the e-2-e latency. + ACE_High_Res_Timer timer; + ACE_hrtime_t elapsed_time; while (this->active_) { // ACE_DEBUG ((LM_DEBUG, "\n%s::Trigger: Pushing test event\n", @@ -42,9 +45,9 @@ namespace CIAO try { - this->timer_.start (); + timer.start (); this->context_->push_test_out (ev); - this->timer_.stop (); + timer.stop (); } catch (CORBA::Exception &ex) { @@ -53,7 +56,7 @@ namespace CIAO } // Measure the time taken to execute the invocation. - this->timer_.elapsed_microseconds (this->elapsed_time_); + timer.elapsed_microseconds (elapsed_time); ACE_Time_Value interval (0, 0); ACE_hrtime_t period; @@ -61,29 +64,36 @@ namespace CIAO period = this->period_; this->mutex_.release (); - ACE_DEBUG ((LM_DEBUG, "%s::Trigger::Period: %Q msec\t" - "Elapsed time: %Q msec\n", - this->ID_.in (), - period / 1000, - this->elapsed_time_ / 1000)); +// ACE_DEBUG ((LM_DEBUG, "%s::Trigger::Period: %Q msec\t" +// "Elapsed time: %Q msec\n", +// this->ID_.in (), +// period / 1000, +// elapsed_time / 1000)); - // Now update the performance metrics. - this->metrics_.total_count_++; - // Both period and elapsed_time_ are in to usec. - if (period >= this->elapsed_time_) + // Both period and elapsed_time are in to usec. + if (period >= elapsed_time) { + this->metrics_mutex_.acquire (); + // Now update the performance metrics. + this->metrics_.total_count_++; + this->metrics_mutex_.release (); + // Sleep for the remaining time period. interval.set (0, static_cast <suseconds_t> - (period - this->elapsed_time_)); + (period - elapsed_time)); } else { // If the elapsed time is grater than the period, then this // taks has missed its deadline. + this->metrics_mutex_.acquire (); + // Now update the performance metrics. + this->metrics_.total_count_++; this->metrics_.miss_count_++; + this->metrics_mutex_.release (); } // ACE_DEBUG ((LM_DEBUG, "Sleeping for %f seconds.\n", // interval.msec () /1000.0)); @@ -95,7 +105,40 @@ namespace CIAO ::CORBA::Boolean Trigger_exec_i::set_rate (::CORBA::Double rate) { - ACE_DEBUG ((LM_DEBUG, "(%P) Got rate! New rate is %f\n", rate)); + // Obtain the collected performance metrics. + Performance metrics; + ACE_hrtime_t elapsed_time; + + this->metrics_mutex_.acquire (); + this->timer_.stop (); + metrics = this->metrics_; + this->timer_.elapsed_microseconds (elapsed_time); + + // Reset counters. + this->metrics_.miss_count_ = 0; + this->metrics_.total_count_ = 0; + + this->timer_.start (); + + this->metrics_mutex_.release (); + + + ACE_DEBUG ((LM_DEBUG, "DMR = %f\tThroughput = %f\n", + (metrics.miss_count_ * 1.0) / metrics.total_count_, + (metrics.total_count_ * 1000000.0) / elapsed_time)); + + + std::stringstream msg; + msg << (metrics.miss_count_ * 1.0) / metrics.total_count_ + << "\t" + << (metrics.total_count_ * 1000000.0) / elapsed_time + << "\t" + << rate; + this->logger_->log (msg.str ()); + + ACE_DEBUG ((LM_DEBUG, "%s::Trigger: Got rate! New rate is %f\n", + this->ID_.in (), + rate)); this->mutex_.acquire (); // We multiply by 1000000 since the period is specified in usecs. this->period_ = static_cast <ACE_hrtime_t> ((1.0 / rate) * 1000000); @@ -103,18 +146,6 @@ namespace CIAO return true; } - Performance - Trigger_exec_i::metrics () - { - Performance metrics = this->metrics_; - // Reset the current metrics. - this->metrics_.miss_count_ = 0; - this->metrics_.total_count_ = 0; - - // Return the metrics collected during the previous iteration. - return metrics; - } - ::CORBA::Long Trigger_exec_i::period () { @@ -176,7 +207,6 @@ namespace CIAO void Trigger_exec_i::ciao_preactivate () { - // Your code here. } void @@ -188,60 +218,28 @@ namespace CIAO ACE_ERROR ((LM_ERROR, "Trigger_exec: Error will activating the " "periodic task!\n")); } + // Start the timer. + this->timer_.start (); this->active_ = true; - // Now start the performance monitor. - if (this->monitor_->activate () != 0) - { - ACE_ERROR ((LM_ERROR, "Trigger_exec: Error will activating the " - "performance monitor!\n")); - } + + // Create the logger. + this->logger_ = new Logger (this->ID_.in ()); + this->logger_->log (std::string ("#DMR\tThroughput\tRate\n")); } void Trigger_exec_i::ccm_activate () { - // Your code here. } void Trigger_exec_i::ccm_passivate () { - // Your code here. } void Trigger_exec_i::ccm_remove () { - // Your code here. - } - - //================================================================== - // Performance Monitor Implementation Class: PerfMon - //================================================================== - - PerfMon::PerfMon (Trigger_exec_i &trigger, - ACE_hrtime_t period) - : trigger_ (trigger), - period_ (period) - {} - - PerfMon::~PerfMon () - {} - - int - PerfMon::svc () - { - ACE_Time_Value interval (0, 0); - interval.set (0, static_cast <suseconds_t> (this->period_)); - while (true) - { - Performance metrics = this->trigger_.metrics (); - ACE_DEBUG ((LM_DEBUG, "DMR = %f\tThroughput = %f\n", - (metrics.miss_count_ * 1.0) / metrics.total_count_, - (metrics.total_count_ * 1000000.0) / this->period_)); - ACE_OS::sleep (interval); - } - return 0; } //================================================================== @@ -255,17 +253,6 @@ namespace CIAO Trigger_Factory_exec_i::~Trigger_Factory_exec_i (void) { } - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - ::Components::EnterpriseComponent_ptr Trigger_Factory_exec_i::create () { diff --git a/examples/E2E_Task/Trigger/Trigger_exec.h b/examples/E2E_Task/Trigger/Trigger_exec.h index 7102fd01f6e..b99d539b22a 100644 --- a/examples/E2E_Task/Trigger/Trigger_exec.h +++ b/examples/E2E_Task/Trigger/Trigger_exec.h @@ -15,6 +15,7 @@ #include "ace/Mutex.h" #include "ace/High_Res_Timer.h" #include "Metrics.h" +#include "Logger.h" namespace CIAO { @@ -22,9 +23,6 @@ namespace CIAO { namespace CIDL_Trigger { - // Forward decleration. - class PerfMon; - class TRIGGER_EXEC_Export Trigger_exec_i : public virtual Trigger_Exec, public virtual TAO_Local_RefCounted_Object, @@ -52,8 +50,6 @@ namespace CIAO virtual ::CORBA::Boolean set_rate (::CORBA::Double rate); - virtual Performance metrics (); - virtual void set_session_context (::Components::SessionContext_ptr ctx); @@ -82,42 +78,20 @@ namespace CIAO // Indicates whether the active object has been activated or not. bool active_; - /// The high resolution timer. + /// Timer used to calculate the throughput. ACE_High_Res_Timer timer_; - /// Elapsed time. - ACE_hrtime_t elapsed_time_; - - // Mutex for the period_ variable. + // Mutex for the period variable. ACE_Mutex mutex_; + // Mutex for the metrics variable. + ACE_Mutex metrics_mutex_; + // Performance metrics. Performance metrics_; - // Performance monitor. - PerfMon *monitor_; - - }; - - // This class periodically outputs performance metrics. - class PerfMon : public virtual ACE_Task_Base - { - public: - - PerfMon (Trigger_exec_i &trigger, - ACE_hrtime_t period); - - virtual ~PerfMon (); - - int svc (); - - private: - - Trigger_exec_i &trigger_; - - // Monitor period specified in usecs. - ACE_hrtime_t period_; - + // Logger. + Logger *logger_; }; class TRIGGER_EXEC_Export Trigger_Factory_exec_i diff --git a/examples/E2E_Task/descriptors/Task1.cdp b/examples/E2E_Task/descriptors/Task1.cdp index 4cfb83293ea..73114cf66ea 100644 --- a/examples/E2E_Task/descriptors/Task1.cdp +++ b/examples/E2E_Task/descriptors/Task1.cdp @@ -98,6 +98,28 @@ </value> </configProperty> <configProperty> + <name>WCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>8100</long> + </value> + </value> + </configProperty> + <configProperty> + <name>BCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>5400</long> + </value> + </value> + </configProperty> + <configProperty> <name>ID</name> <value> <type> @@ -138,6 +160,28 @@ </value> </configProperty> <configProperty> + <name>WCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>8100</long> + </value> + </value> + </configProperty> + <configProperty> + <name>BCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>5400</long> + </value> + </value> + </configProperty> + <configProperty> <name>iterations</name> <value> <type> @@ -178,6 +222,28 @@ </value> </configProperty> <configProperty> + <name>BCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>1800</long> + </value> + </value> + </configProperty> + <configProperty> + <name>WCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>2700</long> + </value> + </value> + </configProperty> + <configProperty> <name>iterations</name> <value> <type> @@ -218,6 +284,28 @@ </value> </configProperty> <configProperty> + <name>BCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>1800</long> + </value> + </value> + </configProperty> + <configProperty> + <name>WCET</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>2700</long> + </value> + </value> + </configProperty> + <configProperty> <name>iterations</name> <value> <type> diff --git a/examples/E2E_Task/utils/App_utils.mpc b/examples/E2E_Task/utils/App_utils.mpc new file mode 100644 index 00000000000..33863656f6c --- /dev/null +++ b/examples/E2E_Task/utils/App_utils.mpc @@ -0,0 +1,19 @@ +project(App_utils) : acelib { + + sharedname = App_utils + dynamicflags += LOGGER_BUILD_DLL + + Source_Files { + RACE_utils.cpp + Logger.cpp + RT.cpp + } + + Header_Files { + Logger.h + RACE_utils.h + Logger_export.h + RT.h + } + +} diff --git a/examples/E2E_Task/utils/Logger.cpp b/examples/E2E_Task/utils/Logger.cpp new file mode 100644 index 00000000000..545b12dacf8 --- /dev/null +++ b/examples/E2E_Task/utils/Logger.cpp @@ -0,0 +1,47 @@ +#include "Logger.h" +#include "ace/Log_Msg.h" +#include "ace/OS.h" +#include "RACE_utils.h" + +namespace CIAO +{ + + namespace RACE + { + Logger::Logger(const char* filename) + { + this->log_file_ = ACE_OS::fopen (filename, "w"); + if (this->log_file_ == 0) + { + ACE_DEBUG ((LM_ERROR, + "Cannot open output log file for writing: %s\n", + filename)); + } + } + + Logger::~Logger(void) + { + if (this->log_file_ != 0) + { + ACE_OS::fclose (this->log_file_); + } + } + + void + Logger::log (std::string msg) + { + if (this->log_file_ != 0) + { + ACE_OS::fprintf (this->log_file_, "%s", msg.c_str()); + ACE_OS::fflush (this->log_file_); + } + + if (RACE::debug_level() > 10) + { + ACE_DEBUG ((LM_DEBUG, "RACE::Debug: %s", msg.c_str())); + } + } + + + } +}
\ No newline at end of file diff --git a/examples/E2E_Task/utils/Logger.h b/examples/E2E_Task/utils/Logger.h new file mode 100644 index 00000000000..9c749719221 --- /dev/null +++ b/examples/E2E_Task/utils/Logger.h @@ -0,0 +1,37 @@ +// $Id$ + +/** + * @file Logger.h + * + * This file defines RACE logger. + * + * @author Nishanth Shankaran <nshankar@nospam.com> + */ + +#ifndef RACE_LOGGER_H +#define RACE_LOGGER_H + +#include <string> +#include "Logger_export.h" + +namespace CIAO +{ + namespace RACE + { + class LOGGER_Export Logger + { + public: + Logger(const char* filename); + + virtual ~Logger(void); + + virtual void log (::std::string msg); + + + private: + FILE *log_file_; + + }; + } +} +#endif /* RACE_LOGGER_H */ diff --git a/examples/E2E_Task/utils/Logger_export.h b/examples/E2E_Task/utils/Logger_export.h new file mode 100644 index 00000000000..966029dc719 --- /dev/null +++ b/examples/E2E_Task/utils/Logger_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl LOGGER +// ------------------------------ +#ifndef LOGGER_EXPORT_H +#define LOGGER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (LOGGER_HAS_DLL) +# define LOGGER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && LOGGER_HAS_DLL */ + +#if !defined (LOGGER_HAS_DLL) +# define LOGGER_HAS_DLL 1 +#endif /* ! LOGGER_HAS_DLL */ + +#if defined (LOGGER_HAS_DLL) && (LOGGER_HAS_DLL == 1) +# if defined (LOGGER_BUILD_DLL) +# define LOGGER_Export ACE_Proper_Export_Flag +# define LOGGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* LOGGER_BUILD_DLL */ +# define LOGGER_Export ACE_Proper_Import_Flag +# define LOGGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* LOGGER_BUILD_DLL */ +#else /* LOGGER_HAS_DLL == 1 */ +# define LOGGER_Export +# define LOGGER_SINGLETON_DECLARATION(T) +# define LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* LOGGER_HAS_DLL == 1 */ + +// Set LOGGER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (LOGGER_NTRACE) +# if (ACE_NTRACE == 1) +# define LOGGER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define LOGGER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !LOGGER_NTRACE */ + +#if (LOGGER_NTRACE == 1) +# define LOGGER_TRACE(X) +#else /* (LOGGER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define LOGGER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (LOGGER_NTRACE == 1) */ + +#endif /* LOGGER_EXPORT_H */ + +// End of auto generated file. diff --git a/examples/E2E_Task/utils/RACE_utils.cpp b/examples/E2E_Task/utils/RACE_utils.cpp new file mode 100644 index 00000000000..bbb2ea5e938 --- /dev/null +++ b/examples/E2E_Task/utils/RACE_utils.cpp @@ -0,0 +1,25 @@ +// $Id$ + +#include "RACE_utils.h" +#include "ace/Env_Value_T.h" + +/// This should really be an anonymous namespace, but some compilers +/// still don't support this features. Therefore, just use a long +/// namespace name here. +namespace race_anonymous_namespace +{ + int debug_level = -1; +} + +int +CIAO::RACE::debug_level (void) +{ + if (race_anonymous_namespace::debug_level == -1) + { + // Initialize the thing. + ACE_Env_Value<int> envar ("RACE_DEBUG_LEVEL", 1); + race_anonymous_namespace::debug_level = envar; + } + + return race_anonymous_namespace::debug_level; +} diff --git a/examples/E2E_Task/utils/RACE_utils.h b/examples/E2E_Task/utils/RACE_utils.h new file mode 100644 index 00000000000..7a13b5c9148 --- /dev/null +++ b/examples/E2E_Task/utils/RACE_utils.h @@ -0,0 +1,45 @@ +// $Id$ + +/** +* @file RACE_utils.h +* +* This file contains utils RACE macro definitions. +* +* @author Nishanth Shankaran <nshankar@nospam.com> +*/ + +#ifndef RACE_UTILS_H +#define RACE_UTILS_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined ACE_LACKS_PRAGMA_ONCE +# pragma once +#endif /* ! ACE_LACKS_PRAGMA_ONCE */ + +//#include "RACE_utils_export.h" + +namespace CIAO +{ + namespace RACE + { + /** + * Return the debug level. The debug level of RACE is control by + * an environment variable "RACE_DEBUG_LEVEL". It should be an int + * value. If it is not defined, the default debug level is 0. The + * value of debug value is evaluated on its first use and the value + * is then cached. + * + * Some recommendation for using the debug_level + * + * > 10 : Write log file as well as to STDOUT. + */ + /*RACE_UTILS_Export */ + int debug_level (void); + } +} +#include /**/ "ace/post.h" + +#endif /* RACE_UTILS_H */ diff --git a/examples/E2E_Task/utils/RT.cpp b/examples/E2E_Task/utils/RT.cpp index 99d64b06986..1af48099c78 100644 --- a/examples/E2E_Task/utils/RT.cpp +++ b/examples/E2E_Task/utils/RT.cpp @@ -4,7 +4,7 @@ namespace CIAO { namespace RACE { - int set_priority () + int RT_Utils::set_priority () { int priority = (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) diff --git a/examples/E2E_Task/utils/RT.h b/examples/E2E_Task/utils/RT.h index 6d8a5055a43..04630c348c2 100644 --- a/examples/E2E_Task/utils/RT.h +++ b/examples/E2E_Task/utils/RT.h @@ -4,12 +4,17 @@ #include "ace/Sched_Params.h" #include "ace/OS_NS_errno.h" #include "ace/Log_Msg.h" +#include "Logger_export.h" namespace CIAO { namespace RACE { - int set_priority (); + class LOGGER_Export RT_Utils + { + public: + static int set_priority (); + }; } } |