From 9ce3b1e9970a545998a215b6cb702131d8c15494 Mon Sep 17 00:00:00 2001 From: storri Date: Tue, 27 Jan 2004 15:59:39 +0000 Subject: EC Gateway debugging changes --- TAO/orbsvcs/examples/RtEC/Kokyu/Makefile | 2 +- .../examples/RtEC/test_driver/Config_Factory.cpp | 16 +++ TAO/orbsvcs/examples/RtEC/test_driver/Consumer.cpp | 26 +++-- TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp | 118 +++++++++++---------- TAO/orbsvcs/examples/RtEC/test_driver/Makefile | 1 + .../RtEC/test_driver/Makefile.test_driver_app | 4 +- .../RtEC/test_driver/Makefile.test_driver_lib | 8 +- TAO/orbsvcs/examples/RtEC/test_driver/Supplier.cpp | 17 ++- TAO/orbsvcs/examples/RtEC/test_driver/Test.cpp | 10 +- .../examples/RtEC/test_driver/TimeoutConsumer.cpp | 14 ++- 10 files changed, 133 insertions(+), 83 deletions(-) diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/Makefile b/TAO/orbsvcs/examples/RtEC/Kokyu/Makefile index 207f045e829..b6905c14bc2 100644 --- a/TAO/orbsvcs/examples/RtEC/Kokyu/Makefile +++ b/TAO/orbsvcs/examples/RtEC/Kokyu/Makefile @@ -15,7 +15,7 @@ endif # ! TAO_ROOT BIN = Service PSRC= Service.cpp Supplier.cpp Consumer.cpp -LDLIBS = -lTAO_RTKokyuEvent -lKokyu -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_Messaging $(TAO_SRVR_LIBS) +LDLIBS = -lTAO_RTKokyuEvent -lKokyu -lTAO_RTEvent -lTAO_RTSched -lTAO_CosNaming -lTAO_Svc_Utils -lTAO_IORTable -lTAO_Messaging $(TAO_SRVR_LIBS) -L$(DATASTREAM_ROOT)/lib -ldsui # The complete path to orbsvcs/orbsvcs/Sched is required for DU/CXX # automatic template instantiation magic. diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Config_Factory.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/Config_Factory.cpp index 35499f5cc96..10aa29d2945 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Config_Factory.cpp +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Config_Factory.cpp @@ -55,20 +55,26 @@ Default_Config_Factory::init (int argc, ACE_TCHAR* argv[]) || (ACE_OS::strcasecmp (opt, ACE_LIB_TEXT("rms")) == 0)) { this->sched_type_ = RMS; //default +/* ACE_DEBUG ((LM_DEBUG, "Default_Config_Factory: Scheduling type is RMS\n")); +*/ } else if (ACE_OS::strcasecmp (opt, ACE_LIB_TEXT("muf")) == 0) { this->sched_type_ = MUF; +/* ACE_DEBUG ((LM_DEBUG, "Default_Config_Factory: Scheduling type is MUF\n")); +*/ } else if (ACE_OS::strcasecmp (opt, ACE_LIB_TEXT("edf")) == 0) { this->sched_type_ = EDF; +/* ACE_DEBUG ((LM_DEBUG, "Default_Config_Factory: Scheduling type is EDF\n")); +*/ } else { @@ -83,10 +89,12 @@ Default_Config_Factory::init (int argc, ACE_TCHAR* argv[]) else { arg_shifter.consume_arg (); +/* ACE_DEBUG ((LM_DEBUG, "Default_Config_Factory - " "ignoring option <%s>\n", arg)); +*/ } } return 0; @@ -105,25 +113,33 @@ Default_Config_Factory::create_testconfig () { switch (this->sched_type_) { case EDF: +/* ACE_DEBUG ((LM_DEBUG, "Default_Config_Factory: Returning EDF Test_Config\n")); +*/ return new TestConfig::ECConfig(); break; case MUF: +/* ACE_DEBUG ((LM_DEBUG, "Default_Config_Factory: Returning MUF Test_Config\n")); +*/ return new TestConfig::ECConfig(); break; case RMS: +/* ACE_DEBUG ((LM_DEBUG, "Default_Config_Factory: Returning RMS Test_Config\n")); +*/ return new TestConfig::ECConfig(); break; default: +/* ACE_ERROR ((LM_ERROR, "Default_Config_Factory - " "unknown scheduling type <%d>\n", this->sched_type_)); +*/ return 0; }; } //else... diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Consumer.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/Consumer.cpp index e5087d85037..8787d2b2bbe 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Consumer.cpp +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Consumer.cpp @@ -82,8 +82,10 @@ Consumer::connect_impl (bool set_rtinfo, //true if should set RT_Info //create consumer RT_Info std::ostringstream cons_entry_pt; cons_entry_pt << entry_prefix; //unique RT_Info entry point - ACE_DEBUG((LM_DEBUG,"Creating %s\n",cons_entry_pt.str().c_str())); - ACE_DEBUG((LM_DEBUG,"\timportance: %d\tcriticality: %d\n",importance,criticality)); + /* + ACE_DEBUG((LM_DEBUG,"Creating %s\n",cons_entry_pt.str().c_str())); + ACE_DEBUG((LM_DEBUG,"\timportance: %d\tcriticality: %d\n",importance,criticality)); + */ RtecScheduler::handle_t rt_info = scheduler->create (cons_entry_pt.str().c_str() ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -112,12 +114,14 @@ Consumer::connect_impl (bool set_rtinfo, //true if should set RT_Info RtecScheduler::OPERATION ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,"Set Consumer %d RT_Info\n",this->_consumer_id)); - ACE_DEBUG((LM_DEBUG,"\tcriticality: %d\n",criticality)); - ACE_DEBUG((LM_DEBUG,"\tTimes (worst,typical,cached): %d, %d, %d\n",tmp,tmp,tmp)); - ACE_DEBUG((LM_DEBUG,"\tperiod: %d\n",p)); - ACE_DEBUG((LM_DEBUG,"\timportance: %d\n",importance)); - ACE_DEBUG((LM_DEBUG,"\tquantum: %d\n",tmp)); + /* + ACE_DEBUG((LM_DEBUG,"Set Consumer %d RT_Info\n",this->_consumer_id)); + ACE_DEBUG((LM_DEBUG,"\tcriticality: %d\n",criticality)); + ACE_DEBUG((LM_DEBUG,"\tTimes (worst,typical,cached): %d, %d, %d\n",tmp,tmp,tmp)); + ACE_DEBUG((LM_DEBUG,"\tperiod: %d\n",p)); + ACE_DEBUG((LM_DEBUG,"\timportance: %d\n",importance)); + ACE_DEBUG((LM_DEBUG,"\tquantum: %d\n",tmp)); + */ } else { ACE_DEBUG((LM_DEBUG,"NOT Set Consumer %d RT_Info\n",this->_consumer_id)); @@ -143,6 +147,12 @@ Consumer::connect_impl (bool set_rtinfo, //true if should set RT_Info this->_supplier_proxy->connect_push_consumer (consumerv.in (), consQoS.get_ConsumerQOS () ACE_ENV_ARG_PARAMETER); + ACE_DEBUG((LM_DEBUG, "Consumer (%t) ")); + printf("object pointer (%p) ---> push_supplier (%p)\n", + this, + this->_supplier_proxy.in()); + + ACE_CHECK; ACE_DEBUG((LM_DEBUG,"Consumer %d connected\n",this->_consumer_id)); diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp index 2093e7535dd..814f89487c4 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp +++ b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp @@ -25,6 +25,7 @@ #include "orbsvcs/Event/EC_Kokyu_Factory.h" #include "orbsvcs/RtecSchedulerC.h" #include "orbsvcs/RtecEventCommC.h" +#include "orbsvcs/Event/EC_Gateway_Sched.h" //REACTOR CHANGE #include "tao/ORB_Core.h" @@ -104,7 +105,7 @@ ECConfig::reset (ACE_ENV_SINGLE_ARG_DECL) poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG ((LM_DEBUG, "EC deactivated\n")); + //ACE_DEBUG ((LM_DEBUG, "EC deactivated\n")); } { @@ -118,7 +119,7 @@ ECConfig::reset (ACE_ENV_SINGLE_ARG_DECL) poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG ((LM_DEBUG, "scheduler deactivated\n")); + //ACE_DEBUG ((LM_DEBUG, "scheduler deactivated\n")); } if (this->use_federated && !CORBA::is_nil(this->gateway_obs.in())) @@ -133,7 +134,7 @@ ECConfig::reset (ACE_ENV_SINGLE_ARG_DECL) poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG ((LM_DEBUG, "gateway deactivated\n")); + //ACE_DEBUG ((LM_DEBUG, "gateway deactivated\n")); } delete this->ec_impl; @@ -157,7 +158,7 @@ template int ECConfig::configure (TCFG_SET_WPTR testconfigs) { if (this->configured) { - ACE_DEBUG((LM_DEBUG,ACE_TEXT("Resetting EC\n"))); + //ACE_DEBUG((LM_DEBUG,ACE_TEXT("Resetting EC\n"))); this->reset(); //delete memory used by previous configuration } @@ -166,7 +167,7 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) { this->initEC(); - ACE_DEBUG((LM_DEBUG,ACE_TEXT("EC Initialized\n"))); + //ACE_DEBUG((LM_DEBUG,ACE_TEXT("EC Initialized\n"))); ////////////////// EC ready; do config //////////////////// size_t tsize = testconfigs->size(); @@ -242,7 +243,7 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) orb->object_to_string (this->event_channel.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,"Writing supplier EC IOR\n")); + //ACE_DEBUG((LM_DEBUG,"Writing supplier EC IOR\n")); // Output the EC's ior to the supplierEC iorfile FILE *output_file = ACE_OS::fopen (supplierEC_iorfile, "w"); if (output_file == 0) @@ -254,7 +255,7 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) ior = orb->object_to_string (this->scheduler.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,"Writing supplier Sched IOR\n")); + //ACE_DEBUG((LM_DEBUG,"Writing supplier Sched IOR\n")); // Output the scheduler's ior to the supplierSched iorfile output_file = ACE_OS::fopen (supplierSched_iorfile, "w"); if (output_file == 0) @@ -280,7 +281,7 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) orb->object_to_string (this->event_channel.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,"Writing consumer EC IOR\n")); + //ACE_DEBUG((LM_DEBUG,"Writing consumer EC IOR\n")); // Output the EC's ior to the consumerEC iorfile FILE *output_file = ACE_OS::fopen (consumerEC_iorfile, "w"); if (output_file == 0) @@ -290,7 +291,7 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) ACE_OS::fprintf (output_file, "%s", ior.in ()); ACE_OS::fclose (output_file); - ACE_DEBUG((LM_DEBUG,"Writing consumer Sched IOR\n")); + //ACE_DEBUG((LM_DEBUG,"Writing consumer Sched IOR\n")); ior = orb->object_to_string (this->scheduler.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; // Output the scheduler's ior to the consumerSched iorfile @@ -325,7 +326,7 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) } ////////////////// Configured; compute schedule /////////// - ACE_DEBUG ((LM_DEBUG, "Computing schedule\n")); + //ACE_DEBUG ((LM_DEBUG, "Computing schedule\n")); RtecScheduler::RT_Info_Set_var infos; RtecScheduler::Config_Info_Set_var configs; RtecScheduler::Scheduling_Anomaly_Set_var anomalies; @@ -370,10 +371,10 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) } ///////////// Activate the EC ///////////////// - ACE_DEBUG ((LM_DEBUG, "activating EC\n")); + //ACE_DEBUG ((LM_DEBUG, "activating EC\n")); this->ec_impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - ACE_DEBUG ((LM_DEBUG, "EC activated\n")); + //ACE_DEBUG ((LM_DEBUG, "EC activated\n")); if (this->suppliers.size() > 0) { @@ -394,9 +395,9 @@ ECConfig::configure (TCFG_SET_WPTR testconfigs) template int ECConfig::run (void) { - ACE_DEBUG ((LM_DEBUG, "Running ECConfig\n")); + //ACE_DEBUG ((LM_DEBUG, "Running ECConfig\n")); if (!this->configured) { - ACE_DEBUG ((LM_DEBUG, "Tried to run before configured\n")); + //ACE_DEBUG ((LM_DEBUG, "Tried to run before configured\n")); return 1; } @@ -408,28 +409,29 @@ ECConfig::run (void) //ACE_Reactor *reactor = ACE_Reactor::instance(); // Spawn orb thread (which calls orb.run(), then terminates on return) - ACE_DEBUG((LM_DEBUG,"SPAWNING ORB thread\n")); + //ACE_DEBUG((LM_DEBUG,"SPAWNING ORB thread\n")); //int ret = inst->spawn(ECConfig::run_orb,&(this->orb)); spawn_data_t *data = new spawn_data_t; - printf("data points to %p\n",(void*)(data)); - printf("setting data->lock to %p\n",(void*)(this->test_done)); + //printf("data points to %p\n",(void*)(data)); + //printf("setting data->lock to %p\n",(void*)(this->test_done)); data->lock = this->test_done; - printf("data->lock = %p\n",(void*)(data->lock)); + //printf("data->lock = %p\n",(void*)(data->lock)); data->orb = &(this->orb); - printf("data->orb = %p\n",(void*)(data->orb)); + //printf("data->orb = %p\n",(void*)(data->orb)); data->ready = &(this->ready); data->use_federated = this->use_federated; data->is_server = this->suppliers.size()>0; //assume client if no suppliers - int ret = inst->spawn(ECConfig::run_orb,data); + //int ret = inst->spawn(ECConfig::run_orb,data); //int ret = inst->spawn(ECConfig::run_orb,reactor); //no need for getting tid? - if (ret == -1) + /* + if (ret == -1) { ACE_DEBUG ((LM_DEBUG, "ERROR: Couldn't spawn ORB->run() thread: %s\n", ACE_OS::strerror(errno))); return 1; } - + */ orb->run(); //this method returns when orb->shutdown() is called; then thread exits @@ -447,7 +449,7 @@ ECConfig::run (void) */ //REACTOR CHANGE END - ACE_DEBUG((LM_DEBUG, "ORB thread: Shutdown\n")); + //ACE_DEBUG((LM_DEBUG, "ORB thread: Shutdown\n")); if (inst->wait() == -1) //wait for ORB thread to terminate { @@ -462,7 +464,7 @@ ECConfig::run (void) //Shutdown EC //this->reset(); - ACE_DEBUG ((LM_DEBUG, "suppliers finished\n")); + //ACE_DEBUG ((LM_DEBUG, "suppliers finished\n")); } ACE_CATCHANY @@ -480,7 +482,7 @@ ECConfig::initEC(ACE_ENV_SINGLE_ARG_DECL) { TAO_EC_Kokyu_Factory::init_svcs (); - ACE_DEBUG ((LM_DEBUG,ACE_TEXT("Initializing event channel\n"))); + //ACE_DEBUG ((LM_DEBUG,ACE_TEXT("Initializing event channel\n"))); // ORB initialization boiler plate... int argc = 0; @@ -489,7 +491,7 @@ ECConfig::initEC(ACE_ENV_SINGLE_ARG_DECL) CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,ACE_TEXT("Resolving initial references\n"))); + //ACE_DEBUG((LM_DEBUG,ACE_TEXT("Resolving initial references\n"))); CORBA::Object_var object = orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); @@ -504,7 +506,7 @@ ECConfig::initEC(ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; //TODO: do these need to remain in scope beyond this function? - ACE_DEBUG((LM_DEBUG,ACE_TEXT("Creating sched service\n"))); + //ACE_DEBUG((LM_DEBUG,ACE_TEXT("Creating sched service\n"))); // Create a scheduling service ACE_NEW (this->sched_impl,SCHED_STRAT); @@ -519,7 +521,7 @@ ECConfig::initEC(ACE_ENV_SINGLE_ARG_DECL) ACE_NEW (this->ec_impl,TAO_EC_Event_Channel (attributes)); - ACE_DEBUG((LM_DEBUG,ACE_TEXT("Created ec_impl\n"))); + //ACE_DEBUG((LM_DEBUG,ACE_TEXT("Created ec_impl\n"))); this->event_channel = this->ec_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -540,7 +542,7 @@ ECConfig::make_federated (ACE_ENV_SINGLE_ARG_DECL) remoteEC_ior += supplierEC_iorfile; remoteSched_ior += supplierSched_iorfile; - ACE_DEBUG((LM_DEBUG,"Reading EC IOR: %s\n",remoteEC_ior.c_str())); + //ACE_DEBUG((LM_DEBUG,"Reading EC IOR: %s\n",remoteEC_ior.c_str())); CORBA::Object_var ec_obj = orb->string_to_object (remoteEC_ior.c_str() ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -550,17 +552,17 @@ ECConfig::make_federated (ACE_ENV_SINGLE_ARG_DECL) ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,"Reading Sched IOR: %s\n",remoteSched_ior.c_str())); + //ACE_DEBUG((LM_DEBUG,"Reading Sched IOR: %s\n",remoteSched_ior.c_str())); CORBA::Object_var sched_obj = orb->string_to_object(remoteSched_ior.c_str() ACE_ENV_ARG_PARAMETER); RtecScheduler::Scheduler_var remote_sch = RtecScheduler::Scheduler::_narrow (sched_obj.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,"Creating gateway\n")); + //ACE_DEBUG((LM_DEBUG,"Creating gateway\n")); //TAO_EC_Gateway_Sched *gateway = new TAO_EC_Gateway_Sched(); ECConfig_Gateway *gateway = new ECConfig_Gateway(); - ACE_DEBUG((LM_DEBUG,"Gateway init\n")); + //ACE_DEBUG((LM_DEBUG,"Gateway init\n")); //for consumer, remote is supplier EC gateway->init (remote_ec.in (), this->event_channel.in (), @@ -570,9 +572,9 @@ ECConfig::make_federated (ACE_ENV_SINGLE_ARG_DECL) consumerEC_iorfile ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG((LM_DEBUG,"Gateway init returned; assigning\n")); + //ACE_DEBUG((LM_DEBUG,"Gateway init returned; assigning\n")); this->gateway_impl = gateway; - ACE_DEBUG((LM_DEBUG,"Gateway init completed\n")); + //ACE_DEBUG((LM_DEBUG,"Gateway init completed\n")); this->gateway_obs = this->gateway_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -581,7 +583,7 @@ ECConfig::make_federated (ACE_ENV_SINGLE_ARG_DECL) { //Might throw a CANT_APPEND_OBSERVER exception //But I think we can ignore it if that happens - ACE_DEBUG((LM_DEBUG,"Appending gateway observer\n")); + //ACE_DEBUG((LM_DEBUG,"Appending gateway observer\n")); //append to consumer EC so that connecting consumers update the gateway! RtecEventChannelAdmin::Observer_Handle h = this->event_channel->append_observer (this->gateway_obs.in () @@ -590,16 +592,16 @@ ECConfig::make_federated (ACE_ENV_SINGLE_ARG_DECL) this->gateway_impl->observer_handle (h); - ACE_DEBUG((LM_DEBUG,"Gateway observer appended\n")); + //ACE_DEBUG((LM_DEBUG,"Gateway observer appended\n")); } ACE_CATCH(RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER,exc) { //ignore - ACE_DEBUG((LM_DEBUG,"Caught CANT_APPEND_OBSERVER\n")); + //ACE_DEBUG((LM_DEBUG,"Caught CANT_APPEND_OBSERVER\n")); } ACE_ENDTRY; - ACE_DEBUG((LM_DEBUG,"Gateway created\n")); + // ACE_DEBUG((LM_DEBUG,"Gateway created\n")); } template void @@ -625,7 +627,7 @@ ECConfig::connect_suppliers (ACE_ENV_SINGLE_ARG_DECL) std::ostringstream entry_prefix; entry_prefix << "Supplier " << supp_idx; - ACE_DEBUG((LM_DEBUG,"Supplier.connect() for %s\n",entry_prefix.str().c_str())); + //ACE_DEBUG((LM_DEBUG,"Supplier.connect() for %s\n",entry_prefix.str().c_str())); this->suppliers[supp_idx]->connect (&(this->ready), this->test_done, this->scheduler.in(), @@ -647,7 +649,7 @@ ECConfig::connect_suppliers (ACE_ENV_SINGLE_ARG_DECL) template void ECConfig::connect_consumers (ACE_ENV_SINGLE_ARG_DECL) { - ACE_DEBUG((LM_DEBUG,"Consumers to connect: %d\n",this->consumers.size())); + //ACE_DEBUG((LM_DEBUG,"Consumers to connect: %d\n",this->consumers.size())); //this->consumers already has correct size size_t cons_idx = 0; for (size_t i=0; itestcfgs.size(); ++i) @@ -660,7 +662,7 @@ ECConfig::connect_consumers (ACE_ENV_SINGLE_ARG_DECL) std::ostringstream entry_prefix; entry_prefix << "Consumer " << cons_idx; - ACE_DEBUG((LM_DEBUG,"Consumer.connect() for %s\n",entry_prefix.str().c_str())); + //ACE_DEBUG((LM_DEBUG,"Consumer.connect() for %s\n",entry_prefix.str().c_str())); //don't set the RT_Info values this->consumers[cons_idx]->connect (this->scheduler.in(), entry_prefix.str().c_str(), @@ -684,7 +686,7 @@ ECConfig::disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL) { for (size_t i = 0; i < this->suppliers.size(); ++i) { - ACE_DEBUG((LM_DEBUG,"Disconnecting supplier %d\n",i)); + //ACE_DEBUG((LM_DEBUG,"Disconnecting supplier %d\n",i)); this->suppliers[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -731,9 +733,10 @@ ECConfig::print_RT_Infos (ACE_Array cfg_se if (i!=0) { //finish previous line - ACE_DEBUG ((LM_DEBUG, "\n")); + //ACE_DEBUG ((LM_DEBUG, "\n")); } - ACE_DEBUG ((LM_DEBUG, rt_info_format, +/* + ACE_DEBUG ((LM_DEBUG, rt_info_format, (const char *) info.entry_point, info.handle, ACE_CU64_TO_CU32 (info.worst_case_execution_time), @@ -748,9 +751,10 @@ ECConfig::print_RT_Infos (ACE_Array cfg_se info.preemption_subpriority, info.preemption_priority, info.info_type)); +*/ } //finish last line - ACE_DEBUG ((LM_DEBUG, "\n")); + //ACE_DEBUG ((LM_DEBUG, "\n")); } ACE_CATCHANY { @@ -780,7 +784,7 @@ ECConfig::barrier(bool is_supplier) //now we block on a socket connect until a consumer opens it //this way, we don't start running until the consumer is ready ACE_SOCK_Stream accstrm; - ACE_DEBUG((LM_DEBUG,"Opening supplier socket %s\n",addr_str.c_str())); + //ACE_DEBUG((LM_DEBUG,"Opening supplier socket %s\n",addr_str.c_str())); ACE_INET_Addr addr(addr_str.c_str()); ACE_SOCK_Acceptor acc(addr); if (acc.accept(accstrm,&addr) != 0) //blocks until consumer opens @@ -789,17 +793,17 @@ ECConfig::barrier(bool is_supplier) "Cannot accept socket: %s\n", ACE_OS::strerror(errno))); } - ACE_DEBUG((LM_DEBUG,"Supplier: unblocked on socket\n")); + //ACE_DEBUG((LM_DEBUG,"Supplier: unblocked on socket\n")); //once opened, no need for socket any more acc.close(); accstrm.close(); - ACE_DEBUG((LM_DEBUG, "Supplier: closed socket\n")); + //ACE_DEBUG((LM_DEBUG, "Supplier: closed socket\n")); } else { //now we open a socket to start up the supplier - ACE_DEBUG((LM_DEBUG,"Connecting consumer socket %s\n",addr_str.c_str())); + //ACE_DEBUG((LM_DEBUG,"Connecting consumer socket %s\n",addr_str.c_str())); ACE_SOCK_Stream connstrm; ACE_INET_Addr addr(addr_str.c_str()); ACE_SOCK_Connector conn; @@ -809,11 +813,11 @@ ECConfig::barrier(bool is_supplier) "Consumer cannot connect socket: %s\n", ACE_OS::strerror(errno))); } - ACE_DEBUG((LM_DEBUG,"Consumer: connected socket\n")); + //ACE_DEBUG((LM_DEBUG,"Consumer: connected socket\n")); //once opened, no need for socket any more connstrm.close(); - ACE_DEBUG((LM_DEBUG, "Consumer: closed socket\n")); + //ACE_DEBUG((LM_DEBUG, "Consumer: closed socket\n")); } } @@ -843,7 +847,7 @@ ECConfig::run_orb(void *data) } else { - ACE_DEBUG((LM_DEBUG,"No barrier after configured&orbrun because not federated\n")); + //ACE_DEBUG((LM_DEBUG,"No barrier after configured and orb started because application is not federated\n")); } // Block waiting for consumers to finish @@ -851,8 +855,8 @@ ECConfig::run_orb(void *data) int ret = data_ptr->lock->acquire_write(); if (ret == -1) { - ACE_DEBUG((LM_DEBUG, "ERROR: could not acquire write lock for ECConfig: %s\n", - ACE_OS::strerror(errno))); + //ACE_DEBUG((LM_DEBUG, "ERROR: could not acquire write lock for ECConfig: %s\n", + // ACE_OS::strerror(errno))); return 0; } //release the lock, since it has served its purpose @@ -866,16 +870,16 @@ ECConfig::run_orb(void *data) if (data_ptr->is_server) { //HACK: client doesn't shutdown! - ACE_DEBUG((LM_DEBUG,"Supplier shutting down ORB\n")); + //ACE_DEBUG((LM_DEBUG,"Supplier shutting down ORB\n")); (*(data_ptr->orb))->shutdown(1); //argument is TRUE so orb waits until work //done before shutting down } /* //orb->orb_core()->reactor()->end_reactor_event_loop(); - ACE_DEBUG((LM_DEBUG,"DONE; stopping reactor event loop\n")); + //ACE_DEBUG((LM_DEBUG,"DONE; stopping reactor event loop\n")); ACE_Reactor::instance()->end_reactor_event_loop(); */ - ACE_DEBUG((LM_DEBUG,"ORB Thread exiting\n")); + //ACE_DEBUG((LM_DEBUG,"ORB Thread exiting\n")); return 0; } diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile index bc705e4d108..9dcc19adbe5 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile @@ -57,3 +57,4 @@ rcs_info: rcs_info.tgt0 rcs_info.tgt1 idl_stubs: idl_stubs.tgt0 idl_stubs.tgt1 reverseclean: realclean.tgt1 realclean.tgt0 + diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_app b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_app index 7263a2a4d89..99387d4c505 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_app +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_app @@ -84,7 +84,7 @@ include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU include $(ACE_ROOT)/include/makeinclude/rules.local.GNU include $(TAO_ROOT)/taoconfig.mk -CPPFLAGS += -I$(ACE_ROOT)/ACEXML/common -I$(ACE_ROOT)/Kokyu -I$(DATASTREAM_ROOT)/include -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao -I$(ACE_ROOT) +CPPFLAGS += -I../../../../../ACEXML/common -I../../../../../Kokyu -I$(DATASTREAM_ROOT)/include -I../../../../orbsvcs -I../../../.. -I../../../../tao -I../../../../.. ifeq ($(static_libs),1) ifneq ($(LIB),) CPPFLAGS += -DTAO_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS -DACE_AS_STATIC_LIBS @@ -92,7 +92,7 @@ ifeq ($(static_libs),1) endif -LDFLAGS += -L. -L$(DATASTREAM_ROOT)/lib -L$(ACE_ROOT)/lib +LDFLAGS += -L. -L$(DATASTREAM_ROOT)/lib -L../../../../../lib #---------------------------------------------------------------------------- # Local targets diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib index d1cd7f55814..b101ef577b6 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib @@ -53,7 +53,7 @@ $(TEMPINCDIR): @-test -d $(TEMPINCDIR) || mkdir -p $(TEMPINCDIR) $(ACE_NUL_STDERR) endif -OUTPUT_DIRECTORY = $(ACE_ROOT)/lib +OUTPUT_DIRECTORY = ../../../../../lib all: $(OUTPUT_DIRECTORY) $(OUTPUT_DIRECTORY): @@ -108,7 +108,7 @@ include $(ACE_ROOT)/include/makeinclude/macros.GNU include $(ACE_ROOT)/include/makeinclude/rules.common.GNU include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -INSTALL_CHECK = $(ACE_ROOT)/lib +INSTALL_CHECK = ../../../../../lib ifeq ($(INSTALL_CHECK),.) INSLIB = $(PWD) else @@ -119,7 +119,7 @@ include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU include $(ACE_ROOT)/include/makeinclude/rules.local.GNU include $(TAO_ROOT)/taoconfig.mk -CPPFLAGS += -I$(ACE_ROOT)/ACEXML/common -I$(ACE_ROOT)/Kokyu -I$(DATASTREAM_ROOT)/include -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao -I$(ACE_ROOT) +CPPFLAGS += -I../../../../../ACEXML/common -I../../../../../Kokyu -I$(DATASTREAM_ROOT)/include -I../../../../orbsvcs -I../../../.. -I../../../../tao -I../../../../.. ifeq ($(static_libs),1) ifneq ($(LIB),) CPPFLAGS += -DTAO_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS -DACE_AS_STATIC_LIBS @@ -127,7 +127,7 @@ ifeq ($(static_libs),1) endif -LDFLAGS += -L$(DATASTREAM_ROOT)/lib -L$(ACE_ROOT)/lib +LDFLAGS += -L$(DATASTREAM_ROOT)/lib -L../../../../../lib #---------------------------------------------------------------------------- # Local targets diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Supplier.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/Supplier.cpp index 660e31e428a..16468e1846e 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Supplier.cpp +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Supplier.cpp @@ -20,7 +20,9 @@ Supplier::~Supplier() void Supplier::update(ACE_ENV_SINGLE_ARG_DECL) { + /* ACE_DEBUG((LM_DEBUG,"Supplier %d (%P|%t) received update\n",this->_supplier_id)); + */ //only react to update if ready=1 if (*this->_ready == 1 && this->_num_sent < this->_to_send) @@ -32,12 +34,16 @@ Supplier::update(ACE_ENV_SINGLE_ARG_DECL) this->_consumer_proxy->push(this->_events ACE_ENV_ARG_PARAMETER); ++this->_num_sent; + /* ACE_DEBUG((LM_DEBUG,"Sent events; %d sent\t%d total\n",this->_num_sent,this->_to_send)); + */ if (this->_num_sent >= this->_to_send) { //just finished; only want to do this once! + /* ACE_DEBUG((LM_DEBUG,"RELEASE read lock from Supplier %d\n", this->_supplier_id)); + */ this->_done->release(); this->_hold_mtx = 0; } @@ -95,8 +101,10 @@ Supplier::connect (int *ready, //create supplier RT_Info std::ostringstream supp_entry_pt; supp_entry_pt << entry_prefix << " Supplier " << this->_supplier_id; //unique RT_Info entry point + /* ACE_DEBUG((LM_DEBUG,"Creating %s\n",supp_entry_pt.str().c_str())); ACE_DEBUG((LM_DEBUG,"\timportance: %d\tcriticality: %d\n",importance,criticality)); + */ RtecScheduler::handle_t rt_info = scheduler->create (supp_entry_pt.str().c_str() ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -115,6 +123,7 @@ Supplier::connect (int *ready, ACE_CHECK; // Register as supplier of events + ACE_DEBUG((LM_DEBUG,"Supplier %d inserting %d events into SupplierQOS_Factory\n",this->_supplier_id,events.length())); ACE_SupplierQOS_Factory supplierQOS; for (size_t i=0; i_consumer_proxy->connect_push_supplier (supplierv.in (), supplierQOS.get_SupplierQOS () ACE_ENV_ARG_PARAMETER); + ACE_DEBUG((LM_DEBUG, "Supplier (%t) ")); + printf("object pointer (%p) ---> push_consumer (%p)\n", + this, + this->_consumer_proxy.in()); + ACE_CHECK; + /* ACE_DEBUG((LM_DEBUG,"Supplier %d connected\n",this->_supplier_id)); for (size_t i=0; itimeoutconsumer.connect(scheduler,supp_entry_pt.str().c_str(),period, importance,criticality,ec ACE_ENV_ARG_PARAMETER); diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Test.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/Test.cpp index 8497e32c96c..ca561c3c32f 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Test.cpp +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Test.cpp @@ -49,7 +49,7 @@ main (int argc, char *argv[]) ACEXML_FileCharStream *fcs = new ACEXML_FileCharStream(); if ((retval = fcs->open(args.filename_.c_str())) != 0) { - ACE_DEBUG ((LM_DEBUG, "Could not open file %s\n",args.filename_.c_str())); + //ACE_DEBUG ((LM_DEBUG, "Could not open file %s\n",args.filename_.c_str())); return retval; } @@ -67,11 +67,11 @@ main (int argc, char *argv[]) ACEXML_TRY_CHECK; if ((retval = fcs->close()) != 0) { - ACE_DEBUG ((LM_DEBUG, "Could not close file %s\n",args.filename_.c_str())); + //ACE_DEBUG ((LM_DEBUG, "Could not close file %s\n",args.filename_.c_str())); return retval; } - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished parsing\n"))); + //ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished parsing\n"))); // configure according to parsed XML ConfigFactory::Default_Config_Factory fact; @@ -109,7 +109,7 @@ main (int argc, char *argv[]) } ACEXML_ENDTRY; - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished successfully\n"))); + //ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished successfully\n"))); return retval; } @@ -124,7 +124,7 @@ int parse_args (int argc, char *argv[], Arguments &args) { case 'f': args.filename_.set(get_opts.opt_arg()); - ACE_DEBUG((LM_DEBUG,ACE_TEXT("Filename argument: %s\n"),args.filename_.c_str())); + //ACE_DEBUG((LM_DEBUG,ACE_TEXT("Filename argument: %s\n"),args.filename_.c_str())); break; case '?': default: diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/TimeoutConsumer.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/TimeoutConsumer.cpp index 06f1db4714e..37e5af7ccd9 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/TimeoutConsumer.cpp +++ b/TAO/orbsvcs/examples/RtEC/test_driver/TimeoutConsumer.cpp @@ -101,7 +101,9 @@ TimeoutConsumer::connect (RtecScheduler::Scheduler_ptr scheduler, ACE_UNUSED_ARG(ec); this->entry_pt << entry_prefix << " TimeoutConsumer"; //unique RT_Info entry point +/* ACE_DEBUG((LM_DEBUG,"Creating %s\n",this->entry_pt.str().c_str())); +*/ this->_handler = new Timer_Event_Handler(this); ACE_Time_Value interval; @@ -167,16 +169,18 @@ TimeoutConsumer::push (const RtecEventComm::EventSet& events } +/* ACE_DEBUG((LM_DEBUG,"TimeoutConsumer %s (%P|%t) received %d events:\n",this->entry_pt.str().c_str(), - events.length())); + events.length())); +*/ for (size_t i=0; ientry_pt.str().c_str())); + // ACE_DEBUG((LM_DEBUG,"TimeoutConsumer %s (%P|%t) received timeout event\n",this->entry_pt.str().c_str())); if (this->_observer != 0) { - ACE_DEBUG((LM_DEBUG,"TimeoutConsumer %s (%P|%t) updating observer\n",this->entry_pt.str().c_str())); + // ACE_DEBUG((LM_DEBUG,"TimeoutConsumer %s (%P|%t) updating observer\n",this->entry_pt.str().c_str())); this->_observer->update(); } } @@ -187,8 +191,8 @@ TimeoutConsumer::push (const RtecEventComm::EventSet& events ACE_Thread::self(handle); ACE_Thread::getprio(handle,prio); //ACE_thread_t tid = ACE_Thread::self(); - ACE_DEBUG ((LM_DEBUG, "TimeoutConsumer %s @%d (%P|%t) we received event type %d\n", - this->entry_pt.str().c_str(),prio,events[0].header.type)); +// ACE_DEBUG ((LM_DEBUG, "TimeoutConsumer %s @%d (%P|%t) we received event type %d\n", +// this->entry_pt.str().c_str(),prio,events[0].header.type)); } } } -- cgit v1.2.1