diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-16 11:10:56 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-16 11:10:56 +0000 |
commit | 616c8f351ae8707f95c55349a245f0292c504694 (patch) | |
tree | bc7268ff442e98dfca0f11d5b72d7cdbff2aa41b | |
parent | e554ce13cf6ddaaf1bfff419bcbe4b2264e1c004 (diff) | |
download | ATCD-616c8f351ae8707f95c55349a245f0292c504694.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/Connect.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/GIOP.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/Timeprobe.h | 32 | ||||
-rw-r--r-- | ace/Timeprobe.cpp | 19 | ||||
-rw-r--r-- | ace/Timeprobe.h | 17 |
6 files changed, 56 insertions, 40 deletions
diff --git a/TAO/tao/Connect.cpp b/TAO/tao/Connect.cpp index ef6f7a9c079..82746b90808 100644 --- a/TAO/tao/Connect.cpp +++ b/TAO/tao/Connect.cpp @@ -385,9 +385,8 @@ TAO_Server_Connection_Handler::send_response (TAO_OutputCDR &msg) { TAO_SVC_HANDLER *this_ptr = this; - ACE_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_SEND_RESPONSE_START); + ACE_FUNCTION_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_SEND_RESPONSE_START); TAO_GIOP::send_request (this_ptr, msg); - ACE_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_SEND_RESPONSE_END); } int @@ -399,7 +398,7 @@ TAO_Server_Connection_Handler::handle_input (ACE_HANDLE) // 2. construct a complete request // 3. dispatch that request and return any required reply and errors - ACE_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_HANDLE_INPUT_START); + ACE_FUNCTION_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_HANDLE_INPUT_START); char reqbuf[CDR::DEFAULT_BUFSIZE]; TAO_InputCDR msg (reqbuf, sizeof(reqbuf)); @@ -456,7 +455,6 @@ TAO_Server_Connection_Handler::handle_input (ACE_HANDLE) if (response_required || error_encountered) this->send_response (reply); - ACE_TIMEPROBE (TAO_SERVER_CONNECTION_HANDLER_HANDLE_INPUT_END); return result; } @@ -525,7 +523,7 @@ int TAO_Client_Connection_Handler::send_request (TAO_OutputCDR &stream, int is_twoway) { - ACE_TIMEPROBE (TAO_CLIENT_CONNECTION_HANDLER_SEND_REQUEST_START); + ACE_FUNCTION_TIMEPROBE (TAO_CLIENT_CONNECTION_HANDLER_SEND_REQUEST_START); // NOTE: Here would also be a fine place to calculate a digital // signature for the message and place it into a preallocated slot @@ -571,7 +569,6 @@ TAO_Client_Connection_Handler::send_request (TAO_OutputCDR &stream, this->expecting_response_ = 0; } - ACE_TIMEPROBE (TAO_CLIENT_CONNECTION_HANDLER_SEND_REQUEST_END); return 0; } diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp index b897c9a06b0..8ba087c62e6 100644 --- a/TAO/tao/GIOP.cpp +++ b/TAO/tao/GIOP.cpp @@ -86,7 +86,7 @@ CORBA::Boolean TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, TAO_OutputCDR &stream) { - ACE_TIMEPROBE (TAO_GIOP_SEND_REQUEST_START); + ACE_FUNCTION_TIMEPROBE (TAO_GIOP_SEND_REQUEST_START); char *buf = (char *) stream.buffer (); size_t buflen = stream.length (); @@ -123,7 +123,6 @@ TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, ACE_DEBUG ((LM_DEBUG, "(%P|%t) ?? writebuf, buflen %u > length %u\n", buflen, stream.length ())); - ACE_TIMEPROBE (TAO_GIOP_SEND_REQUEST_FAIL); return CORBA::B_FALSE; } @@ -154,7 +153,6 @@ TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, ACE_DEBUG ((LM_DEBUG, "(%P|%t) closing conn %d after fault\n", peer.get_handle ())); handler->close (); - ACE_TIMEPROBE (TAO_GIOP_SEND_REQUEST_FAIL); return CORBA::B_FALSE; } else if (writelen == 0) @@ -163,7 +161,6 @@ TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, "(%P|%t) OutgoingMessage::writebuf () ... EOF, closing conn %d\n", peer.get_handle ())); handler->close (); - ACE_TIMEPROBE (TAO_GIOP_SEND_REQUEST_FAIL); return CORBA::B_FALSE; } if ((buflen -= writelen) != 0) @@ -178,7 +175,6 @@ TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, dmsg_filter (8, "%u more bytes to write...\n", buflen); #endif /* DEBUG */ } - ACE_TIMEPROBE (TAO_GIOP_SEND_REQUEST_FAIL); return CORBA::B_TRUE; } @@ -305,7 +301,7 @@ TAO_GIOP::recv_request (TAO_SVC_HANDLER *&handler, TAO_InputCDR &msg, CORBA::Environment &env) { - ACE_TIMEPROBE (TAO_GIOP_RECV_REQUEST_START); + ACE_FUNCTION_TIMEPROBE (TAO_GIOP_RECV_REQUEST_START); TAO_GIOP::Message_Type retval; CORBA::ULong message_size; ACE_SOCK_Stream &connection = handler->peer (); @@ -341,7 +337,6 @@ TAO_GIOP::recv_request (TAO_SVC_HANDLER *&handler, ACE_DEBUG ((LM_DEBUG, "(%P|%t) Header EOF ... peer probably aborted connection %d\n", connection.get_handle ())); - ACE_TIMEPROBE (TAO_GIOP_RECV_REQUEST_EOF); return TAO_GIOP::EndOfFile; // @@ should probably find some way to report this without // an exception, since for most servers it's not an error. @@ -362,7 +357,6 @@ TAO_GIOP::recv_request (TAO_SVC_HANDLER *&handler, } env.exception (new CORBA::COMM_FAILURE (CORBA::COMPLETED_MAYBE)); - ACE_TIMEPROBE (TAO_GIOP_RECV_REQUEST_FAIL); return TAO_GIOP::MessageError; } @@ -379,7 +373,6 @@ TAO_GIOP::recv_request (TAO_SVC_HANDLER *&handler, { env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE)); // header ACE_DEBUG ((LM_DEBUG, "bad header, magic word\n")); - ACE_TIMEPROBE (TAO_GIOP_RECV_REQUEST_FAIL); return TAO_GIOP::MessageError; } @@ -391,7 +384,6 @@ TAO_GIOP::recv_request (TAO_SVC_HANDLER *&handler, { env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE)); // header ACE_DEBUG ((LM_DEBUG, "bad header, version\n")); - ACE_TIMEPROBE (TAO_GIOP_RECV_REQUEST_FAIL); return TAO_GIOP::MessageError; } @@ -463,14 +455,12 @@ TAO_GIOP::recv_request (TAO_SVC_HANDLER *&handler, // clean up, and ... env.exception (new CORBA::COMM_FAILURE (CORBA::COMPLETED_MAYBE)); // body ACE_DEBUG ((LM_DEBUG, "couldn't read rest of message\n")); - ACE_TIMEPROBE (TAO_GIOP_RECV_REQUEST_FAIL); return TAO_GIOP::MessageError; } TAO_GIOP::dump_msg ("recv", ACE_reinterpret_cast (u_char *, header), message_size + TAO_GIOP_HEADER_LEN); - ACE_TIMEPROBE (TAO_GIOP_RECV_REQUEST_END); return retval; } diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 37cf9c7003d..d2dc4abeaad 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -185,7 +185,9 @@ CORBA_ORB::run (ACE_Time_Value *tv) while (this->should_shutdown_ == 0) { - ACE_TIMEPROBE (TAO_CORBA_ORB_RUN_START); + ACE_TIMEPROBE_PRINT_USING_TABLE (TAO_Timeprobe_Description); + ACE_TIMEPROBE_RESET; + ACE_FUNCTION_TIMEPROBE (TAO_CORBA_ORB_RUN_START); switch (r->handle_events (tv)) { case 0: // Timed out, so we return to caller. @@ -196,7 +198,6 @@ CORBA_ORB::run (ACE_Time_Value *tv) /* NOTREACHED */ default: // Some handlers were dispatched, so keep on processing // requests until we're told to shutdown . - ACE_TIMEPROBE (TAO_CORBA_ORB_RUN_END); break; /* NOTREACHED */ } diff --git a/TAO/tao/Timeprobe.h b/TAO/tao/Timeprobe.h index 561cd44b63f..d6df95704d7 100644 --- a/TAO/tao/Timeprobe.h +++ b/TAO/tao/Timeprobe.h @@ -12,25 +12,23 @@ static const char *TAO_Timeprobe_Description[] = "TAO Timeprobe Description Table", - " -> GIOP::send_request - start", - " -> GIOP::send_request - fail", - " -> GIOP::send_request - end", + "GIOP::send_request - start", + "GIOP::send_request - end", - " -> GIOP::recv_request - start", - " -> GIOP::recv_request - fail", - " -> GIOP::recv_request - eof", - " -> GIOP::recv_request - end", + "GIOP::recv_request - start", + "GIOP::recv_request - end", - " -> Server_Connection_Handler::send_response - start", - " -> Server_Connection_Handler::send_response - end", - " -> Server_Connection_Handler::handle_input start", - " -> Server_Connection_Handler::handle_input end", + "Server_Connection_Handler::send_response - start", + "Server_Connection_Handler::send_response - end", - " -> Client_Connection_Handler::send_request - start", - " -> Client_Connection_Handler::send_request - end", + "Server_Connection_Handler::handle_input start", + "Server_Connection_Handler::handle_input end", - " -> CORBA_ORB::run start handling events", - " -> CORBA_ORB::run end events handled", + "Client_Connection_Handler::send_request - start", + "Client_Connection_Handler::send_request - end", + + "CORBA_ORB::run start", + "CORBA_ORB::run end", }; @@ -39,16 +37,14 @@ enum TAO_TIMEPROBE_DESCRIPTION_TABLE, TAO_GIOP_SEND_REQUEST_START, - TAO_GIOP_SEND_REQUEST_FAIL, TAO_GIOP_SEND_REQUEST_END, TAO_GIOP_RECV_REQUEST_START, - TAO_GIOP_RECV_REQUEST_FAIL, - TAO_GIOP_RECV_REQUEST_EOF, TAO_GIOP_RECV_REQUEST_END, TAO_SERVER_CONNECTION_HANDLER_SEND_RESPONSE_START, TAO_SERVER_CONNECTION_HANDLER_SEND_RESPONSE_END, + TAO_SERVER_CONNECTION_HANDLER_HANDLE_INPUT_START, TAO_SERVER_CONNECTION_HANDLER_HANDLE_INPUT_END, diff --git a/ace/Timeprobe.cpp b/ace/Timeprobe.cpp index ef78a159677..19b9beae8ea 100644 --- a/ace/Timeprobe.cpp +++ b/ace/Timeprobe.cpp @@ -94,7 +94,7 @@ ACE_Timeprobe<ACE_LOCK>::print_times (const char *event_descriptions[]) const description = event_descriptions[this->timeprobes_[0].event_.event_number_]; ACE_DEBUG ((LM_DEBUG, - "%-50s %8.8x %10.10s\n", + "%-50.50s %8.8x %10.10s\n", description, this->timeprobes_[0].thread_, "START")); @@ -110,13 +110,28 @@ ACE_Timeprobe<ACE_LOCK>::print_times (const char *event_descriptions[]) const description = event_descriptions[this->timeprobes_[i].event_.event_number_]; ACE_DEBUG ((LM_DEBUG, - "%-50s %8.8x %10.3d\n", + "%-50.50s %8.8x %10.3d\n", description, this->timeprobes_[i].thread_, elapsed.msec () * 1000)); } } +template <class Timeprobe> +ACE_Function_Timeprobe<Timeprobe>::ACE_Function_Timeprobe (Timeprobe &timeprobe, + u_long event) + : timeprobe_ (timeprobe), + event_ (event) +{ + this->timeprobe_.timeprobe (this->event_); +} + +template <class Timeprobe> +ACE_Function_Timeprobe<Timeprobe>::~ACE_Function_Timeprobe (void) +{ + this->timeprobe_.timeprobe (this->event_ + 1); +} + #endif /* ACE_ENABLE_TIMEPROBES */ #endif /* ACE_TIMEPROBE_C */ diff --git a/ace/Timeprobe.h b/ace/Timeprobe.h index f3204375902..aa4729d1d16 100644 --- a/ace/Timeprobe.h +++ b/ace/Timeprobe.h @@ -117,6 +117,21 @@ protected: // Current size of timestamp table }; +template <class Timeprobe> +class ACE_Function_Timeprobe +{ +public: + ACE_Function_Timeprobe (Timeprobe &timeprobe, + u_long event); + + ~ACE_Function_Timeprobe (void); + +protected: + + Timeprobe &timeprobe_; + + u_long event_; +}; #if defined (__ACE_INLINE__) #include "ace/Timeprobe.i" @@ -163,6 +178,7 @@ typedef ACE_Singleton<ACE_TIMEPROBE_WITH_LOCKING, ACE_Thread_Mutex> ACE_TIMEPROB # define ACE_TIMEPROBE(id) ACE_TIMEPROBE_SINGLETON::instance ()->timeprobe (id) # define ACE_TIMEPROBE_PRINT ACE_TIMEPROBE_SINGLETON::instance ()->print_times () # define ACE_TIMEPROBE_PRINT_USING_TABLE(table) ACE_TIMEPROBE_SINGLETON::instance ()->print_times (table) +# define ACE_FUNCTION_TIMEPROBE(X) ACE_Function_Timeprobe<ACE_TIMEPROBE_WITH_LOCKING> function_timeprobe (*ACE_TIMEPROBE_SINGLETON::instance (), X) #else /* ACE_ENABLE_TIMEPROBES */ @@ -170,6 +186,7 @@ typedef ACE_Singleton<ACE_TIMEPROBE_WITH_LOCKING, ACE_Thread_Mutex> ACE_TIMEPROB # define ACE_TIMEPROBE(id) # define ACE_TIMEPROBE_PRINT # define ACE_TIMEPROBE_PRINT_USING_TABLE(table) +# define ACE_FUNCTION_TIMEPROBE(X) #endif /* ACE_ENABLE_TIMEPROBES */ |