2 #include "Invocation.h"
3 #include "PeerProcess.h"
4 #include "HostProcess.h"
7 #include "ace/OS_NS_stdio.h"
9 #include "ace/Mem_Map.h"
11 Log::Log (Session
&session
)
30 Log::process_file (const ACE_TCHAR
*filename
, const char *alias
)
32 ACE_DEBUG ((LM_DEBUG
,"Processing log file %C\n",
34 this->origin_
= ACE_TEXT_ALWAYS_CHAR (filename
);
37 ACE_Mem_Map mapped_file
;
38 int result
= mapped_file
.map(filename
);
42 size_t mapsize
= mapped_file
.size();
43 char *base
= reinterpret_cast<char *>(mapped_file
.addr());
44 if (mapsize
== 0 || base
== 0)
50 size_t remainder
= mapsize
;
53 size_t maxline
= 1000;
54 char *buffer
= new char[maxline
];
56 while ((text
= ACE_OS::strchr(base
,'\n')) != 0)
58 linelen
= text
- base
;
59 if (linelen
>= maxline
)
63 maxline
= linelen
+ 100;
64 buffer
= new char[maxline
];
66 ACE_OS::strncpy(buffer
,base
,linelen
);
88 char * p
= ACE_OS::strstr (this->line_
, "(");
91 this->info_
= this->line_
;
98 char * x
= ACE_OS::strstr (this->line_
, "TAO (");
101 x
= ACE_OS::strstr (this->line_
, "@(");
107 long pid
= ACE_OS::strtol(p
+ 1, &t
, 10);
113 tid
= ACE_OS::strtol(t
+ 1, 0, 10);
115 return; // not either (pid) or (pid|tid)
117 this->info_
= ACE_OS::strstr (p
, ")") + 1;
119 for (ACE_DLList_Iterator
<HostProcess
> i (this->procs_
);
123 i
.next(this->hostproc_
);
124 if (this->hostproc_
->pid() == pid
)
131 if (this->hostproc_
== 0)
132 this->hostproc_
= this->session_
.find_process(pid
);
134 if (this->hostproc_
== 0)
136 size_t numprocs
= this->procs_
.size();
137 this->hostproc_
= new HostProcess (this->origin_
, pid
);
138 this->procs_
.insert_tail(this->hostproc_
);
139 this->hostproc_
->start_time (this->time_
);
140 ACE_CString
&procname
= this->alias_
.length() > 0 ?
141 this->alias_
: this->origin_
;
145 this->hostproc_
->proc_name(procname
);
149 ACE_CString a2
= procname
+ "_1";
151 if (this->procs_
.get(first
) == 0)
152 first
->proc_name(a2
);
158 ACE_OS::sprintf(ext
,"_" ACE_SIZE_T_FORMAT_SPECIFIER_ASCII
,numprocs
+1);
159 ACE_CString a2
= procname
+ ext
;
160 this->hostproc_
->proc_name(a2
);
164 this->session_
.add_process (this->hostproc_
);
166 this->thr_
= this->hostproc_
->find_thread (tid
, this->offset_
);
167 this->thr_
->add_time (this->timestamp_
);
172 Log::handle_msg_octets ()
174 int pos
= this->dump_target_
->add_octets(this->line_
, this->offset_
);
175 if (this->dump_target_
== &this->unknown_msg_
)
177 for (ACE_DLList_Iterator
<Thread
> t_iter(this->giop_waiters_
);
183 GIOP_Buffer
*waiter
= th
->giop_target();
186 if (waiter
->matches (this->dump_target_
))
188 waiter
->transfer_from (this->dump_target_
);
189 this->dump_target_
= waiter
;
195 if (pos
== -1) // done
197 Invocation
*inv
= this->dump_target_
->owner();
201 const char *oid
= this->dump_target_
->target_oid(len
);
203 inv
->set_target (oid
, len
);
207 if (this->dump_target_
== &this->unknown_msg_
)
208 ACE_ERROR ((LM_ERROR
, "%d dump ended with no target owner\n", this->offset_
));
210 this->dump_target_
= 0;
211 this->unknown_msg_
.reset();
216 Log::parse_HEXDUMP_i ()
218 char *pos
= ACE_OS::strstr (this->line_
,"HEXDUMP");
221 if (this->dump_target_
!= 0)
223 ACE_ERROR ((LM_ERROR
,
224 "%d: Parse HEXDUMP in the middle of an existing dump\n",
229 this->unknown_msg_
.init_buf (this->line_
, this->offset_
);
230 this->dump_target_
= &this->unknown_msg_
;
235 Log::parse_dump_giop_msg_i ()
237 int sending
= ACE_OS::strstr (this->info_
,"send") != 0 ? 0 : 1;
238 int type
= ACE_OS::strstr (this->info_
,"Request") != 0 ? 0 : 1;
239 int mode
= sending
+ type
* 2;
241 char *pos
= strrchr (this->info_
,'[');
242 long rid
= ACE_OS::strtol(pos
+1, 0, 10);
243 PeerProcess
*pp
= this->thr_
->incoming();
247 "%d: dump_msg, could not find pp for incoming, text = %s\n",
248 this->offset_
, this->info_
));
252 GIOP_Buffer
*target
= 0;
255 case 1: { // receiving request
256 this->thr_
->handle_request();
257 Invocation
*inv
= pp
->new_invocation (rid
, this->thr_
);
260 ACE_ERROR ((LM_ERROR
,
261 "%d: process %s already has invocation %d\n",
262 this->offset_
, pp
->id(), rid
));
265 inv
->init (this->line_
, this->offset_
, this->thr_
);
266 this->thr_
->push_invocation (inv
);
267 target
= inv
->octets(true);
270 ACE_ERROR ((LM_ERROR
, "%d: no target octets for new recv reqeust, id = %d\n",
271 this->offset_
, rid
));
274 target
->time (this->time_
);
277 case 0: // sending request
278 this->thr_
->enter_wait(pp
);
279 this->thr_
->push_invocation (0);
281 case 3: { // receiving reply
282 Invocation
*inv
= pp
->find_invocation(rid
, this->thr_
->active_handle());
285 ACE_ERROR ((LM_ERROR
,
286 "%d: could not find existing invocation for req_id %d\n",
287 this->offset_
, rid
));
288 inv
= pp
->new_invocation (rid
,this->thr_
);
290 inv
->init (this->line_
, this->offset_
, this->thr_
);
291 target
= inv
->octets(mode
== 0);
296 ACE_ERROR ((LM_ERROR
,
297 "%d: could not map invocation to target for req_id %d\n",
298 this->offset_
, rid
));
304 target
->time (this->time_
);
307 // this->thr_->exit_wait(pp, this->offset_);
310 case 2: { // sending reply
311 target
= new GIOP_Buffer(this->line_
, this->offset_
, this->thr_
);
312 target
->time (this->time_
);
313 this->thr_
->pop_invocation ();
319 this->thr_
->set_giop_target (target
);
320 if (this->giop_waiters_
.size() > 0)
322 Thread
*other_thr
= 0;
323 for (ACE_DLList_Iterator
<Thread
> t_iter(this->giop_waiters_
);
327 t_iter
.next(other_thr
);
328 GIOP_Buffer
*tgt
= other_thr
->giop_target();
331 ACE_ERROR ((LM_ERROR
, "%d: dump_giop_msg_i, target is null, mode = %d, reqid = %d\n",
332 this->offset_
, mode
, rid
));
335 if (tgt
!= 0 && this->thr_
!= other_thr
&& target
->matches (tgt
))
337 this->thr_
->set_dup (other_thr
, true);
341 this->giop_waiters_
.insert_tail(this->thr_
);
345 Log::parse_open_listener_i ()
347 char *addr
= ACE_OS::strchr(this->info_
,'<') +1;
348 char *c
= ACE_OS::strchr(addr
,'>');
350 Endpoint
server_addr(addr
);
351 this->hostproc_
->add_listen_endpoint(server_addr
);
355 Log::parse_got_existing_i ()
357 char *hpos
= ACE_OS::strchr(this->info_
,'[');
358 long handle
= ACE_OS::strtol(hpos
+1,0,10);
360 PeerProcess
*pp
= this->hostproc_
->find_peer(handle
);
363 ACE_ERROR ((LM_ERROR
,
364 "%d: Error parsing %C, can't find peer "
365 "for handle %d, text = %s\n",
366 this->offset_
, this->origin_
.c_str(), handle
, this->info_
));
369 this->thr_
->active_handle (handle
);
373 Log::parse_muxed_tms_i ()
375 char *hpos
= ACE_OS::strchr(this->info_
,'[');
376 long handle
= ACE_OS::strtol(hpos
+1,0,10);
377 hpos
= ACE_OS::strchr(hpos
, '<');
378 long req_id
= ACE_OS::strtol(hpos
+1,0,10);
379 PeerProcess
*pp
= this->hostproc_
->find_peer(handle
);
382 ACE_ERROR ((LM_ERROR
,
383 "%d: Error parsing %C, can't find peer "
384 "for handle %d, text = %s\n",
385 this->offset_
, this->origin_
.c_str(), handle
, this->info_
));
388 this->thr_
->active_handle (handle
);
390 Invocation
*inv
= pp
->new_invocation(req_id
, this->thr_
);
392 ACE_ERROR ((LM_ERROR
,"%d: peer %s already has invocation id %d\n",
393 this->offset_
, pp
->id(), req_id
));
394 this->thr_
->incoming_from (pp
);
398 Log::parse_exclusive_tms_i ()
400 long handle
= this->thr_
->active_handle();
401 PeerProcess
*pp
= this->hostproc_
->find_peer(handle
);
404 ACE_ERROR ((LM_ERROR
,
405 "%d: Error parsing %C, can't find peer "
406 "for handle %d, text = %s\n",
407 this->offset_
, this->origin_
.c_str(), handle
, this->info_
));
410 char *rpos
= ACE_OS::strchr(this->info_
, '<');
411 long req_id
= ACE_OS::strtol(rpos
+1,0,10);
413 Invocation
*inv
= pp
->new_invocation(req_id
, this->thr_
);
415 ACE_ERROR ((LM_ERROR
,"%d: peer %s already has invocation id %d\n",
416 this->offset_
, pp
->id(), req_id
));
417 this->thr_
->incoming_from (pp
);
421 Log::parse_process_parsed_msgs_i ()
423 char *hpos
= ACE_OS::strchr(this->info_
, '[');
424 long handle
= ACE_OS::strtol(hpos
+1, 0, 10);
426 PeerProcess
*pp
= this->hostproc_
->find_peer(handle
);
429 ACE_ERROR ((LM_ERROR
,
430 "%d: Error parsing %C, can't find peer "
431 "for handle %d, text = %s\n",
432 this->offset_
, this->origin_
.c_str(), handle
, this->info_
));
433 pp
= new PeerProcess (this->offset_
, this->timestamp_
, true);
434 Transport
*t
= new Transport ("<unknown>", false, this->offset_
, this->timestamp_
);
436 pp
->add_transport(t
);
437 this->hostproc_
->add_peer (handle
,pp
);
440 this->thr_
->active_handle(handle
);
441 this->thr_
->incoming_from (pp
);
445 Log::parse_wait_for_event_i ()
447 // char *pos = ACE_OS::strchr (this->info_,'[');
448 // long rid = ACE_OS::strtol(pos+1, 0, 10);
450 bool done
= (ACE_OS::strstr (this->info_
,"done (follower)") != 0) ||
451 (ACE_OS::strstr(this->info_
,"(leader) exit") != 0);
453 PeerProcess
*pp
= this->thr_
->incoming();
455 pp
= this->thr_
->peek_new_connection();
458 this->thr_
->exit_wait(pp
, this->offset_
);
463 Log::parse_wait_on_read_i ()
465 PeerProcess
*pp
= this->thr_
->incoming();
466 this->thr_
->exit_wait (pp
, this->offset_
);
470 Log::parse_make_idle_i ()
472 char *hpos
= ACE_OS::strchr(this->info_
,'[');
473 long handle
= ACE_OS::strtol(hpos
+1,0,10);
474 PeerProcess
*pp
= this->hostproc_
->find_peer(handle
);
477 ACE_ERROR ((LM_ERROR
,
478 "%d: make idle, error parsing %C, can't find peer "
479 "for handle %d, text = %s\n",
480 this->offset_
, this->origin_
.c_str(), handle
, this->info_
));
483 this->thr_
->exit_wait (pp
, this->offset_
);
487 Log::parse_cleanup_queue_i ()
489 char *hpos
= ACE_OS::strchr(this->info_
,'[');
490 long handle
= ACE_OS::strtol(hpos
+1,0,10);
491 PeerProcess
*pp
= this->hostproc_
->find_peer(handle
);
494 ACE_ERROR ((LM_ERROR
,
495 "%d: cleanup queue, error parsing %C, can't find peer "
496 "for handle %d, text = %s\n",
497 this->offset_
, this->origin_
.c_str(), handle
, this->info_
));
501 Thread
*original_thr
= this->thr_
;
502 GIOP_Buffer
*target
= original_thr
->giop_target();
503 if (target
== 0 || target
->owner() != 0)
505 original_thr
= this->hostproc_
->find_thread_for_handle (handle
);
506 if (original_thr
== 0)
508 ACE_ERROR ((LM_ERROR
,
509 "%d: cleanup queue, no original "
510 "thread found, handle %d\n",
511 this->offset_
, handle
));
514 target
= original_thr
->giop_target();
516 if (target
!= 0 && target
->cur_size() == 0 && original_thr
->has_dup())
518 ACE_ERROR ((LM_ERROR
, "%d: cleanup queue, swapping targets for thread %d\n",
519 this->offset_
, original_thr
->id()));
520 original_thr
->swap_target();
522 original_thr
->set_giop_target(0);
523 original_thr
->active_handle (0);
525 if (target
!= 0 && target
->owner() == 0)
527 size_t rid
= target
->actual_req_id();
528 char mtype
= target
->type();
529 Invocation
*inv
= pp
->find_invocation(rid
, handle
);
532 ACE_ERROR ((LM_ERROR
,
533 "%d: Cleanup queue detected, "
534 "could not find invocation for rid = %d on thread %d\n",
535 this->offset_
, rid
, original_thr
->id()));
536 rid
= target
->expected_req_id();
537 inv
= pp
->find_invocation (rid
, handle
);
540 ACE_ERROR ((LM_ERROR
,
541 "%d, Cleanup queue still failed to find rid %d, on thread %d\n",
542 this->offset_
, rid
, original_thr
->id()));
545 original_thr
->exit_wait(pp
, this->offset_
);
546 mtype
= target
->expected_type();
548 inv
->set_octets (mtype
== 0, target
);
550 const char *oid
= target
->target_oid(len
);
551 if (mtype
== 0 && len
> 0)
552 inv
->set_target (oid
, len
);
558 Log::parse_complete_connection_i ()
560 if (ACE_OS::strstr (this->info_
, "failed") == 0)
562 char *addr
= ACE_OS::strrchr(this->info_
,'<') +1;
563 char *c
= ACE_OS::strchr(addr
,'>');
565 // ACE_DEBUG ((LM_DEBUG, "%d, complete_connection, failed for addr %s\n", this->offset_, addr));
567 if (this->conn_waiters_
.size() > 0)
569 // ACE_DEBUG ((LM_DEBUG,"%d: complete_connection: conn_waiters_.size() = %d, addr = %s\n",
570 // this->offset_, this->conn_waiters_.size(), addr));
571 for (ACE_DLList_Iterator
<PeerProcess
> c_iter (this->conn_waiters_
);
575 PeerProcess
*waiter
= 0;
577 if (waiter
!= 0 && waiter
->match_server_addr (addr
))
580 // ACE_DEBUG ((LM_DEBUG,"%d: complete_connection: purging waiter\n",this->offset_));
589 Log::parse_close_connection_i ()
591 char *hpos
= ACE_OS::strchr(this->info_
,'[');
592 long handle
= ACE_OS::strtol(hpos
+1,0,10);
593 PeerProcess
*pp
= this->hostproc_
->find_peer(handle
);
596 Transport
*t
= pp
->find_transport (handle
);
599 t
->close (this->offset_
, this->timestamp_
);
603 this->hostproc_
->remove_peer(handle
);
607 Log::parse_handler_open_i (bool is_ssl
)
609 char *addr
= ACE_OS::strrchr(this->info_
,'<') +1;
610 char *c
= ACE_OS::strchr(addr
,'>');
612 c
= ACE_OS::strstr(c
+1,"on ");
616 long handle
= ACE_OS::strtol(c
,0,10);
617 PeerProcess
*pp
= this->thr_
->peek_new_connection();
618 if (this->conn_waiters_
.size() > 0)
620 // ACE_DEBUG ((LM_DEBUG,"%d: handler_open: conn_waiters_.size() = %d, addr = %s\n",
621 // this->offset_, this->conn_waiters_.size(), addr));
622 for (ACE_DLList_Iterator
<PeerProcess
> c_iter (this->conn_waiters_
);
626 PeerProcess
*waiter
= 0;
628 if (waiter
!= 0 && waiter
->match_server_addr (addr
))
630 if (pp
!= 0 && waiter
!= pp
)
632 // ACE_DEBUG ((LM_DEBUG,"%d: handler_open: found waiter other than for tid %d\n",
633 // this->offset_, thr_->id ()));
636 // ACE_DEBUG ((LM_DEBUG,"%d: handler_open: found waiter addr = %s:%s\n",
638 // (waiter == 0 ? "<null>" : waiter->server_addr().host_.c_str()),
639 // (waiter == 0 ? "<null>" : waiter->server_addr().port_.c_str())
646 // ACE_DEBUG ((LM_DEBUG,"%d: handler_open: no match waiter addr = %s:%s\n",
648 // (waiter == 0 ? "<null>" : waiter->server_addr().host_.c_str()),
649 // (waiter == 0 ? "<null>" : waiter->server_addr().port_.c_str())
656 // ACE_DEBUG ((LM_DEBUG,"%d: handler_open: calling pop_new_connection, addr = %s\n",
657 // this->offset_, addr));
658 pp
= this->thr_
->pop_new_connection();
662 ACE_ERROR ((LM_ERROR
,"%d: handler_open: no pending peer for addr %s\n",
663 this->offset_
, addr
));
669 const ACE_CString
&local_addr
= this->thr_
->pending_local_addr();
670 if (local_addr
.length() > 0 )
672 // ACE_DEBUG ((LM_DEBUG,"%d: handler_open: local addr = %s, pp is server = %d\n",
673 // this->offset_, local_addr.c_str(), pp->is_server() ));
677 Transport
*t
= new Transport (local_addr
.c_str(), true, this->offset_
, this->timestamp_
);
678 pp
->add_transport (t
);
679 this->hostproc_
->add_client_endpoint (t
->client_endpoint_
);
683 pp
->set_server_addr (local_addr
);
685 this->thr_
->pending_local_addr ("");
688 // ACE_DEBUG ((LM_DEBUG,"%d: handler_open: tid %d, local addr = empty\n",
689 // this->offset_, this->thr_->id () ));
692 Transport
*trans
= 0;
695 trans
= pp
->last_transport();
698 ACE_ERROR ((LM_ERROR
,
699 "%d: Pending peer exists, but no last transport "
701 this->offset_
, this->origin_
.c_str()));
708 trans
= new Transport (addr
, false, this->offset_
, this->timestamp_
);
709 pp
->add_transport(trans
);
711 trans
->handle_
= handle
;
712 this->hostproc_
->add_peer (handle
,pp
);
716 Log::parse_begin_connection_i ()
718 char *addr
= ACE_OS::strchr(this->info_
,'<') +1;
719 char *c
= ACE_OS::strchr(addr
,'>');
721 PeerProcess
*pp
= this->hostproc_
->find_peer(addr
);
724 pp
= new PeerProcess(this->offset_
, this->timestamp_
, true);
725 pp
->set_server_addr (addr
);
727 this->conn_waiters_
.insert_tail (pp
);
728 this->thr_
->push_new_connection (pp
);
729 // ACE_DEBUG ((LM_DEBUG,"%d: begin_connection: tid %d pushing pp for addr %s\n",
730 // offset_,thr_->id (), addr));
734 Log::parse_connection_handler_ctor_i ()
736 // char *c = ACE_OS::strchr (this->info_, '[') + 1;
737 // size_t handle = ACE_OS::strtol (c, 0, 10);
738 // ACE_DEBUG ((LM_DEBUG,"%d: constructed new handler for %d\n", offset_, handle));
742 Log::parse_local_addr_i ()
744 char *addr
= ACE_OS::strchr(this->info_
,'<') +1;
745 char *c
= ACE_OS::strchr(addr
,'>');
748 PeerProcess
*peer
= this->thr_
->peek_new_connection();
751 // ACE_DEBUG ((LM_DEBUG, "%d: local_addr: thr %d, pending = %s\n",
752 // offset_, thr_->id(), addr));
753 this->thr_
->pending_local_addr (addr
);
757 if (peer
->is_server())
759 // ACE_DEBUG ((LM_DEBUG, "%d: local_addr: thr %d, peer is server addr = %s\n",
760 // offset_, thr_->id(), addr));
761 Transport
*t
= new Transport (addr
, true, this->offset_
, this->timestamp_
);
762 peer
->add_transport (t
);
763 this->hostproc_
->add_client_endpoint (t
->client_endpoint_
);
767 peer
->set_server_addr (addr
);
772 Log::parse_connection_not_complete_i ()
774 PeerProcess
*pp
= this->thr_
->pop_new_connection ();
777 // ACE_DEBUG ((LM_DEBUG,"%d: connection_not_complete: popping pp from %d\n",
778 // offset_, pp->offset()));
781 ACE_ERROR ((LM_ERROR
,"%d: connection_not_complete: no pending peer\n", offset_
));
785 Log::parse_open_as_server_i ()
787 // ACE_DEBUG ((LM_DEBUG,"%d: open_as_server: adding peer process\n", offset_));
789 this->thr_
->push_new_connection (new PeerProcess(this->offset_
, this->timestamp_
, false));
793 Log::parse_iiop_connection_handler_ctor_i ()
795 PeerProcess
*pp
= this->thr_
->peek_new_connection();
798 ACE_ERROR ((LM_ERROR
, "%d: iiop_connection_handler_ctor_i: no pending peer on thread\n", this->offset_
));
803 char *pos
= ACE_OS::strchr (this->info_
,'[') + 1;
804 long tmp_handle
= ACE_OS::strtol (pos
, 0, 10);
805 // pp->set_handle (tmp_handle);
810 Log::parse_wait_for_connection_i ()
812 // ACE_ERROR ((LM_ERROR,"%d: wait_for_connection, line = %s\n", this->offset_, this->info_));
813 if (ACE_OS::strstr (this->info_
,"Connection not complete") == 0)
817 else if (ACE_OS::strstr (this->info_
,"wait done result =") == 0)
820 char *pos
= ACE_OS::strchr (this->info_
, '=') + 2;
821 int result
= ACE_OS::strtol (pos
, 0, 10);
824 pos
= ACE_OS::strchr (this->info_
, '[') + 1;
825 long handle
= ACE_OS::strtol (pos
, 0, 10);
828 // ACE_DEBUG ((LM_DEBUG,
829 // "%d: wait_for_connection: wait done, result = %d, "
830 // "purging handle = %d\n",
831 // this->offset_, result, handle));
833 if (this->conn_waiters_
.size() > 0)
835 for (ACE_DLList_Iterator
<PeerProcess
> c_iter (this->conn_waiters_
);
839 PeerProcess
*waiter
= 0;
843 Transport
*t
= waiter
->find_transport (handle
);
855 pp
= this->thr_
->pop_new_connection ();
856 Transport
*t
= pp
->find_transport (handle
);
859 this->thr_
->push_new_connection (pp
);
865 ACE_ERROR ((LM_ERROR
,"%d: wait_for_connection: no pending peer for handle %s\n",
866 this->offset_
, handle
));
875 Log::parse_post_open_i ()
877 // ACE_ERROR ((LM_ERROR,"%d: post_open, line = %s\n", this->offset_, this->line_));
881 Log::parse_notify_poa_helper_i ()
883 Invocation
*inv
= this->thr_
->current_invocation ();
886 ACE_ERROR ((LM_ERROR
,"%d: notify_poa_helper line = %s, no current invocation on thread\n", this->offset_
, this->info_
));
889 bool activate
= ACE_OS::strstr (this->info_
, "Activating") != 0;
890 char *idpos
= ACE_OS::strstr (this->info_
, "id = ");
891 long objid
= ACE_OS::strtol (idpos
+ 5, 0, 10);
892 idpos
= ACE_OS::strstr (idpos
+ 5, "in POA : ");
893 long poaid
= ACE_OS::strtol (idpos
+ 10, 0, 10);
896 ACE_OS::sprintf (buffer
,"Notify object %s, object id %ld, POA %ld on line %ld",
897 (activate
? "activation" : "deactivation"), objid
, poaid
,
898 (unsigned long)this->offset_
);
899 ACE_CString
text (buffer
);
901 inv
->add_notify_incident (text
, this->offset_
);
905 Log::parse_notify_object_i ()
907 Invocation
*inv
= this->thr_
->current_invocation ();
910 // ACE_ERROR ((LM_ERROR,"%d: notify_object line = %s, no current invocation on thread\n", this->offset_, this->info_));
913 char *ptr
= ACE_OS::strstr (this->info_
, "object:") + 7;
914 u_long objid
= ACE_OS::strtol (ptr
, &ptr
, 16);
917 if (ACE_OS::strstr (ptr
, "created") != 0)
919 ::sprintf (note
, "Created notify object %lx",objid
);
921 NotifyObject notobj
= new NotifyObject (objid
, this->offset_
, this->timestamp_
);
922 this->hostproc_
->add_notify_obj (notobj
);
925 else if (ACE_OS::strstr (ptr
, "destroyed") != 0)
927 ::sprintf (note
, "Destroyed notify object %lx",objid
);
929 NotifyObject notobj
= this->hostproc_
->find_notify_obj (objid
);
932 ACE_ERROR ((LM_ERROR
, "%d: could not find notify object %lx\n", this->offset_
, objid
));
936 notobj
->destroyed (this->offset_
, this->timestamp_
);
940 else if (ACE_OS::strstr (ptr
, "incr ") != 0)
942 ptr
= ACE_OS::strchr (ptr
, '=');
943 int count
= ACE_OS::strtol (ptr
+ 2, 0, 10);
944 ::sprintf (note
, "increment reference notify object %lx, count now %d",objid
, count
);
946 NotifyObject notobj
= this->hostproc_
->find_notify_obj (objid
);
949 notobj
= new NotifyObject (objid
, this->offset_
, this->timestamp_
);
950 this->hostproc_
->add_notify_obj (notobj
);
952 notobj
->incr (this->offset_
, this->timestamp_
);
955 else if (ACE_OS::strstr (ptr
, "decr ") != 0)
957 ptr
= ACE_OS::strchr (ptr
, '=');
958 int count
= ACE_OS::strtol (ptr
+ 2, 0, 10);
959 ::sprintf (note
, "decrement reference notify object %lx, count now %d",objid
, count
);
961 NotifyObject notobj
= this->hostproc_
->find_notify_obj (objid
);
964 ACE_ERROR ((LM_ERROR
, "%d: could not find notify object %x\n", this->offset_
, objid
));
968 notobj
->decr (this->offset_
, this->timestamp_
);
973 ACE_CString
text (note
);
975 inv
->add_notify_incident (text
, this->offset_
);
979 Log::get_timestamp ()
981 const char *time_tok
= ACE_OS::strchr (this->line_
,'@');
982 size_t len
= (size_t)(time_tok
- this->line_
);
984 if (time_tok
!= 0 && len
< 28 )
986 if (this->line_
[4] != '-' ||
987 this->line_
[7] != '-' ||
988 this->line_
[10] != ' ')
992 ACE_CString prev_st
= this->timestamp_
;
993 this->timestamp_
= ACE_CString (this->line_
, len
);
997 ::sscanf (this->timestamp_
.c_str(),"%d-%d-%d %d:%d:%d.%d",
998 &tms
.tm_year
, &tms
.tm_mon
, &tms
.tm_mday
,
999 &tms
.tm_hour
, &tms
.tm_min
, &tms
.tm_sec
, &msec
);
1000 tms
.tm_year
-= 1900;
1006 this->time_
= ::mktime (&tms
);
1007 this->time_
.usec (msec
* 1000);
1014 if (this->dump_target_
!= 0)
1016 this->handle_msg_octets ();
1020 this->get_timestamp();
1021 this->get_preamble();
1023 if (ACE_OS::strstr (this->info_
, "Handler::open, IIOP connection to peer") != 0)
1025 this->parse_handler_open_i(false);
1027 else if (ACE_OS::strstr (this->info_
, "GIOP_Message_Base::dump_msg,") != 0)
1029 this->parse_dump_giop_msg_i();
1031 else if (ACE_OS::strstr (this->info_
, "GIOP message - HEXDUMP") != 0)
1033 this->parse_HEXDUMP_i();
1035 else if (ACE_OS::strstr (this->info_
, "open_i, listening on:") != 0)
1037 this->parse_open_listener_i();
1039 else if (ACE_OS::strstr (this->info_
, "Muxed_TMS[") != 0)
1041 this->parse_muxed_tms_i();
1043 else if (ACE_OS::strstr (this->info_
, "Exclusive_TMS::request_id") != 0)
1045 this->parse_exclusive_tms_i();
1047 else if (ACE_OS::strstr (this->info_
, "process_parsed_messages") != 0)
1049 this->parse_process_parsed_msgs_i();
1051 else if (ACE_OS::strstr (this->info_
, "wait_for_event") != 0)
1053 this->parse_wait_for_event_i();
1055 else if (ACE_OS::strstr (this->info_
, "Wait_On_Read") != 0)
1057 this->parse_wait_on_read_i();
1059 else if (ACE_OS::strstr (this->info_
, "::make_idle") != 0)
1061 this->parse_make_idle_i();
1063 else if (ACE_OS::strstr (this->info_
, "::cleanup_queue, byte_count") != 0)
1065 this->parse_cleanup_queue_i();
1067 else if (ACE_OS::strstr (this->info_
, "close_connection_eh") != 0)
1069 this->parse_close_connection_i();
1071 else if (ACE_OS::strstr (this->info_
, "complete_connection, connection to") != 0)
1073 this->parse_complete_connection_i();
1075 else if (ACE_OS::strstr (this->info_
, "IIOP_Connector::begin_connection, to ") != 0)
1077 this->parse_begin_connection_i();
1079 else if (ACE_OS::strstr (this->info_
, "::IIOP_Connection_Handler ") != 0)
1081 this->parse_connection_handler_ctor_i();
1083 else if (ACE_OS::strstr (this->info_
, "IIOP_Connection_Handler::open, The local addr is") != 0)
1085 this->parse_local_addr_i();
1087 else if (ACE_OS::strstr (this->info_
, "Connection not complete.") != 0)
1089 this->parse_connection_not_complete_i();
1091 else if (ACE_OS::strstr (this->info_
, "opened as TAO_SERVER_ROLE") != 0)
1093 this->parse_open_as_server_i();
1095 else if (ACE_OS::strstr (this->info_
, "Transport_Connector::connect, got an existing connected") != 0)
1097 this->parse_got_existing_i();
1099 else if (ACE_OS::strstr (this->info_
, "Transport_Connector::wait_for_connection_completion") != 0)
1101 this->parse_wait_for_connection_i();
1103 else if (ACE_OS::strstr (this->info_
, "Transport::post_open, tport") != 0)
1105 this->parse_post_open_i();
1107 else if (ACE_OS::strstr (this->info_
, "SSLIOP connection from client") != 0)
1109 this->parse_handler_open_i(true);
1111 else if (ACE_OS::strstr (this->info_
, "SSLIOP connection accepted from server") != 0)
1113 this->parse_local_addr_i();
1115 else if (ACE_OS::strstr (this->info_
, "POA_Helper") != 0)
1117 this->parse_notify_poa_helper_i();
1119 else if (ACE_OS::strstr (this->info_
, "object:") != 0)
1121 this->parse_notify_object_i ();