diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-18 23:45:08 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-18 23:45:08 +0000 |
commit | b1e0b40de3ca14a4bbb2fa5b7843125e645cf09e (patch) | |
tree | f70efa2b9f02eb42dfe0412c930aa434f079ca98 | |
parent | c1c18fe28d8bada325ad066258a40d2ffe82e1a7 (diff) | |
download | ATCD-b1e0b40de3ca14a4bbb2fa5b7843125e645cf09e.tar.gz |
ChangeLogTag:Thu Jun 18 18:33:34 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-98c | 27 | ||||
-rw-r--r-- | TAO/tao/GIOP.cpp | 28 | ||||
-rw-r--r-- | TAO/tao/IIOP_Object.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 7 | ||||
-rw-r--r-- | TAO/tests/POA/Explicit_Activation/server.cpp | 17 | ||||
-rw-r--r-- | TAO/tests/POA/Generic_Servant/Foo.idl | 11 | ||||
-rw-r--r-- | TAO/tests/POA/Generic_Servant/MyFooServant.cpp | 18 | ||||
-rw-r--r-- | TAO/tests/POA/Generic_Servant/MyFooServant.h | 13 | ||||
-rw-r--r-- | TAO/tests/POA/Generic_Servant/client.cpp | 29 |
9 files changed, 132 insertions, 32 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 615e68aef7f..a730e03d78d 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,30 @@ +Thu Jun 18 18:33:34 1998 Carlos O'Ryan <coryan@cs.wustl.edu> + + * tao/GIOP.cpp: + Added a few more Timeprobes to the client side. + Removed another memory allocation by using a buffer on the stack + for the (initial) output CDR stream. + + * tao/ORB.cpp: + No automatic printing of Timeprobes in the ORB anymore. The + application is responsible of invoking the ACE_TIMEPROBE_PRINT + macro as needed. + + * tao/IIOP_Object.cpp: + Added more Timeprobes. + + * tests/POA/Generic_Servant/Foo.idl: + * tests/POA/Generic_Servant/MyFooServant.h: + * tests/POA/Generic_Servant/MyFooServant.cpp: + Added methods to request a shutdown of the server. + + * tests/POA/Generic_Servant/client.cpp: + Added an option (-x) to shutdown the server. Also added support + for Timeprobe. + + * tests/POA/Explicit_Activation/server.cpp: + Print the timeprobes at exit. + Thu Jun 18 14:17:35 1998 Seth Benjamin Widoff <sbw1@waltz.cs.wustl.edu> * orbsvcs/orbsvcs/Trader/Attributes_T.cpp: diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp index 75fdf24f7cf..1bdc053d863 100644 --- a/TAO/tao/GIOP.cpp +++ b/TAO/tao/GIOP.cpp @@ -64,6 +64,12 @@ static const char *TAO_GIOP_Timeprobe_Description[] = "GIOP::LocateRequestHeader_init - start", "GIOP::LocateRequestHeader_init - end", + + "GIOP_Invocation::start - enter", + "GIOP_Invocation::start - leave", + "GIOP_Invocation::start - connect", + "GIOP_Invocation::start - start_msg", + "GIOP_Invocation::start - request_hdr", }; enum @@ -78,7 +84,13 @@ enum TAO_GIOP_READ_BUFFER_END, TAO_GIOP_LOCATE_REQUEST_HEADER_INIT_START, - TAO_GIOP_LOCATE_REQUEST_HEADER_INIT_END + TAO_GIOP_LOCATE_REQUEST_HEADER_INIT_END, + + TAO_GIOP_INVOCATION_START_ENTER, + TAO_GIOP_INVOCATION_START_LEAVE, + TAO_GIOP_INVOCATION_START_CONNECT, + TAO_GIOP_INVOCATION_START_START_MSG, + TAO_GIOP_INVOCATION_START_REQUEST_HDR }; #endif /* ACE_ENABLE_TIMEPROBES */ @@ -572,7 +584,7 @@ TAO_GIOP_Invocation::TAO_GIOP_Invocation (IIOP_Object *data, opname_ (operation), do_rsvp_ (is_roundtrip), my_request_id_ (0), - out_stream_ (CDR::DEFAULT_BUFSIZE), /* (buffer, sizeof buffer), */ + out_stream_ (buffer, sizeof buffer), /* CDR::DEFAULT_BUFSIZE */ inp_stream_ (CDR::DEFAULT_BUFSIZE), handler_ (0) { @@ -608,6 +620,8 @@ TAO_GIOP_Invocation::~TAO_GIOP_Invocation (void) void TAO_GIOP_Invocation::start (CORBA::Environment &env) { + ACE_FUNCTION_TIMEPROBE (TAO_GIOP_INVOCATION_START_ENTER); + const TAO_opaque *key; // First try to bind to the appropriate address. We do that here @@ -668,6 +682,8 @@ TAO_GIOP_Invocation::start (CORBA::Environment &env) return; } + ACE_TIMEPROBE (TAO_GIOP_INVOCATION_START_CONNECT); + // Use the TAO_SOCK_Stream from the Client_Connection_Handler for // communication inplace of the endpoint used below. @@ -700,6 +716,8 @@ TAO_GIOP_Invocation::start (CORBA::Environment &env) return; } + ACE_TIMEPROBE (TAO_GIOP_INVOCATION_START_START_MSG); + // Then fill in the rest of the RequestHeader // // The first element of header is service context list; @@ -740,9 +758,9 @@ TAO_GIOP_Invocation::start (CORBA::Environment &env) &anybody, 0, env) != CORBA::TypeCode::TRAVERSE_CONTINUE) - return; // right after fault - else - return; // no fault reported + return; // pass the exception through.... + + ACE_TIMEPROBE (TAO_GIOP_INVOCATION_START_REQUEST_HDR); } const char * diff --git a/TAO/tao/IIOP_Object.cpp b/TAO/tao/IIOP_Object.cpp index a1f14996ea6..bde18872652 100644 --- a/TAO/tao/IIOP_Object.cpp +++ b/TAO/tao/IIOP_Object.cpp @@ -25,12 +25,18 @@ static const char *TAO_IIOP_Object_Timeprobe_Description[] = { "IIOP_Object::do_static_call - start", "IIOP_Object::do_static_call - end", + "IIOP_Object::do_static_call - invocation_ctor", + "IIOP_Object::do_static_call - invocation_start", + "IIOP_Object::do_static_call - put_params" }; enum { TAO_IIOP_OBJECT_DO_STATIC_CALL_START = 500, - TAO_IIOP_OBJECT_DO_STATIC_CALL_END + TAO_IIOP_OBJECT_DO_STATIC_CALL_END, + TAO_IIOP_OBJECT_DO_STATIC_CALL_INVOCATION_CTOR, + TAO_IIOP_OBJECT_DO_STATIC_CALL_INVOCATION_START, + TAO_IIOP_OBJECT_DO_STATIC_CALL_PUT_PARAMS }; #endif /* ACE_ENABLE_TIMEPROBES */ @@ -458,6 +464,8 @@ IIOP_Object::do_static_call (CORBA::Environment &env, // exception reporting info->opname, info->is_roundtrip); + ACE_TIMEPROBE (TAO_IIOP_OBJECT_DO_STATIC_CALL_INVOCATION_CTOR); + // We may need to loop through here more than once if we're // forwarded to some other object reference. // @@ -477,6 +485,8 @@ IIOP_Object::do_static_call (CORBA::Environment &env, // exception reporting env.clear (); call.start (env); + ACE_TIMEPROBE (TAO_IIOP_OBJECT_DO_STATIC_CALL_INVOCATION_START); + if (env.exception ()) { dexc (env, "do_static_call, start request message"); @@ -533,6 +543,8 @@ IIOP_Object::do_static_call (CORBA::Environment &env, // exception reporting status = call.invoke (exceptions, env); #endif + ACE_TIMEPROBE (TAO_IIOP_OBJECT_DO_STATIC_CALL_PUT_PARAMS); + status = call.invoke (info->excepts, info->except_count, env); if (env.exception ()) diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 8bfe2a70b64..26d62c23cd0 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -216,6 +216,8 @@ CORBA_ORB::perform_work (ACE_Time_Value *tv) int CORBA_ORB::run (ACE_Time_Value *tv) { + ACE_FUNCTION_TIMEPROBE (TAO_CORBA_ORB_RUN_START); + if (this->shutdown_lock_ == 0) this->shutdown_lock_ = TAO_ORB_Core_instance ()->server_factory ()->create_event_loop_lock (); @@ -246,6 +248,7 @@ CORBA_ORB::run (ACE_Time_Value *tv) if (monitor.release () == -1) return -1; +#if 0 counter++; if (counter == max_iterations) { @@ -256,6 +259,8 @@ CORBA_ORB::run (ACE_Time_Value *tv) ACE_FUNCTION_TIMEPROBE (TAO_CORBA_ORB_RUN_START); +#endif + switch (r->handle_events (tv)) { case 0: // Timed out, so we return to caller. @@ -273,7 +278,7 @@ CORBA_ORB::run (ACE_Time_Value *tv) if (monitor.acquire () == -1) return -1; } - /* NOTREACHED */ + return 0; } diff --git a/TAO/tests/POA/Explicit_Activation/server.cpp b/TAO/tests/POA/Explicit_Activation/server.cpp index 1bb7c8be715..7ad5462a00f 100644 --- a/TAO/tests/POA/Explicit_Activation/server.cpp +++ b/TAO/tests/POA/Explicit_Activation/server.cpp @@ -1,6 +1,7 @@ // $Id$ -// =========================================================================================== +// ================================================================ +// // = LIBRARY // TAO/tests/POA/Explicit_Activation // @@ -12,13 +13,15 @@ // - A new POA ( firstPOA) is created, and the different functions // for the explicit activation of objects are demonstrated. // - The Foo application class objects (defined in -// ./../Generic_Servant/MyFooSerVant) are used as sample objects. +// ./../Generic_Servant/MyFooServant) are used as sample objects. // // = AUTHOR // Irfan Pyarali -// =========================================================================================== +// +// ================================================================ #include "ace/streams.h" +#include "ace/Timeprobe.h" #include "MyFooServant.h" int @@ -123,8 +126,8 @@ main (int argc, char **argv) // Create two Objects of Class MyFooServant (defined in // ./../GenericServant/MyFooServant.h) Create one object at RootPOA // and the other at firstPOA. - MyFooServant first_foo_impl (root_poa.in (), 27); - MyFooServant second_foo_impl (first_poa.in (), 28); + MyFooServant first_foo_impl (orb.in (), root_poa.in (), 27); + MyFooServant second_foo_impl (orb.in (), first_poa.in (), 28); // Do "activate_object" to activate the first_foo_impl object. It // returns ObjectId for that object. Operation Used : @@ -234,7 +237,7 @@ main (int argc, char **argv) third_ior.in ())); // Activate thirdPOA using its ObjectID. - MyFooServant third_foo_impl (second_poa.in (), 29); + MyFooServant third_foo_impl (orb.in (), second_poa.in (), 29); second_poa->activate_object_with_id (third_oid.in (), &third_foo_impl, env); @@ -264,5 +267,7 @@ main (int argc, char **argv) return -1; } + ACE_TIMEPROBE_PRINT; + return 0; } diff --git a/TAO/tests/POA/Generic_Servant/Foo.idl b/TAO/tests/POA/Generic_Servant/Foo.idl index d0167dc377c..7010d9c2133 100644 --- a/TAO/tests/POA/Generic_Servant/Foo.idl +++ b/TAO/tests/POA/Generic_Servant/Foo.idl @@ -1,16 +1,23 @@ // $Id$ -//=============================================================================== +// ================================================================ // // = FILENAME // Foo.idl // -//================================================================================== +// ================================================================ // IDL interface Foo { long doit (); + // A simple twoway operation, the idea is to verify that the server + // can be located. oneway void simply_doit (); + // A simple oneway operation, the idea is to measure any differences + // to the previous one. + + void shutdown (); + // Shutdown the server. }; diff --git a/TAO/tests/POA/Generic_Servant/MyFooServant.cpp b/TAO/tests/POA/Generic_Servant/MyFooServant.cpp index 21d008c818b..587fe162e6c 100644 --- a/TAO/tests/POA/Generic_Servant/MyFooServant.cpp +++ b/TAO/tests/POA/Generic_Servant/MyFooServant.cpp @@ -1,6 +1,6 @@ // $Id$ -//=============================================================================== +// ================================================================ // // // = FILENAME @@ -12,14 +12,16 @@ // = AUTHOR // Irfan Pyarali // -//================================================================================== +// ================================================================ #include "MyFooServant.h" // Constructor -MyFooServant::MyFooServant (PortableServer::POA_ptr poa, +MyFooServant::MyFooServant (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, CORBA::Long value) - : poa_ (PortableServer::POA::_duplicate (poa)), + : orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), value_ (value) { } @@ -36,15 +38,19 @@ MyFooServant::_default_POA (CORBA::Environment &/*env*/) return PortableServer::POA::_duplicate (this->poa_.in ()); } -// Return this->value CORBA::Long MyFooServant::doit (CORBA::Environment &/*env*/) { return this->value_; } -// do nothing void MyFooServant::simply_doit (CORBA::Environment &/*env*/) { } + +void +MyFooServant::shutdown (CORBA::Environment &env) +{ + this->orb_->shutdown (); +} diff --git a/TAO/tests/POA/Generic_Servant/MyFooServant.h b/TAO/tests/POA/Generic_Servant/MyFooServant.h index d481cae496e..6ab5e0b5ddf 100644 --- a/TAO/tests/POA/Generic_Servant/MyFooServant.h +++ b/TAO/tests/POA/Generic_Servant/MyFooServant.h @@ -22,7 +22,8 @@ class GENERIC_SERVANT_Export MyFooServant : public POA_Foo { public: // constructor - takes a POA and a value parameter - MyFooServant (PortableServer::POA_ptr poa, + MyFooServant (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, CORBA::Long value); // Destructor @@ -37,10 +38,18 @@ public: // Even simpler doit method virtual void simply_doit (CORBA::Environment &env); + // Shutdown the ORB + virtual void shutdown (CORBA::Environment &env); + protected: - // Default poa associated with this servant + CORBA::ORB_var orb_; + // Keep a pointer to the ORB so we can shut it down. + PortableServer::POA_var poa_; + // Implement a different _default_POA() + CORBA::Long value_; + // The current value. }; #endif /* MYFOOSERVANT_H */ diff --git a/TAO/tests/POA/Generic_Servant/client.cpp b/TAO/tests/POA/Generic_Servant/client.cpp index 6ce3e33673f..90e40350b54 100644 --- a/TAO/tests/POA/Generic_Servant/client.cpp +++ b/TAO/tests/POA/Generic_Servant/client.cpp @@ -1,6 +1,6 @@ // $Id$ -//=============================================================================== +// ================================================================ // // // = FILENAME @@ -12,21 +12,23 @@ // = AUTHOR // Irfan Pyarali // -//================================================================================== +// ================================================================ #include "ace/streams.h" #include "ace/Get_Opt.h" #include "ace/Profile_Timer.h" +#include "tao/Timeprobe.h" #include "FooC.h" static char *IOR = 0; static int iterations = 1; static int oneway = 0; +static int shutdown_server = 0; static int parse_args (int argc, char **argv) { - ACE_Get_Opt get_opts (argc, argv, "k:i:o"); + ACE_Get_Opt get_opts (argc, argv, "k:i:ox"); int c; while ((c = get_opts ()) != -1) @@ -35,12 +37,19 @@ parse_args (int argc, char **argv) case 'k': IOR = get_opts.optarg; break; + case 'o': oneway = 1; break; + case 'i': iterations = ::atoi (get_opts.optarg); break; + + case 'x': + shutdown_server = 1; + break; + case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -161,7 +170,6 @@ main (int argc, char **argv) // Invoke the doit() method of the foo reference. result = foo->doit (env); } - // stop the timer. timer.stop (); timer.elapsed_time (elapsed_time); @@ -169,16 +177,19 @@ main (int argc, char **argv) // compute average time. print_stats (elapsed_time, i); + if (shutdown_server && env.exception () == 0) + foo->shutdown (env); + if (env.exception () != 0) { env.print_exception ("Foo::doit"); - return -1; + return 1; } // Print the result of doit () method of the foo reference. - ACE_DEBUG ((LM_DEBUG, - "%d\n", - result)); - + ACE_DEBUG ((LM_DEBUG, "The result of doit is %d\n", result)); + + ACE_TIMEPROBE_PRINT; + return 0; } |