summaryrefslogtreecommitdiff
path: root/TAO/utils
diff options
context:
space:
mode:
authorPhil Mesnier <mesnierp@ociweb.com>2016-02-17 09:54:33 -0600
committerPhil Mesnier <mesnierp@ociweb.com>2016-03-04 10:14:59 -0600
commit80f4315eb1314ccdc47052f07c882a45a60fa10b (patch)
tree89ed33ea2a3db66624803d963170ae71a08a5751 /TAO/utils
parent5a183cc311372e89b13a1026afd581edd950255d (diff)
downloadATCD-80f4315eb1314ccdc47052f07c882a45a60fa10b.tar.gz
LogWalker improvements. Add -dd command line option to split the peer and thread data into per-instance files, address a failure to process excessivly long service context buffers attached to a message.
Diffstat (limited to 'TAO/utils')
-rw-r--r--TAO/utils/logWalker/GIOP_Buffer.cpp68
-rw-r--r--TAO/utils/logWalker/HostProcess.cpp58
-rw-r--r--TAO/utils/logWalker/HostProcess.h6
-rw-r--r--TAO/utils/logWalker/Invocation.cpp1
-rw-r--r--TAO/utils/logWalker/Log.cpp21
-rw-r--r--TAO/utils/logWalker/PeerProcess.cpp31
-rw-r--r--TAO/utils/logWalker/PeerProcess.h10
-rw-r--r--TAO/utils/logWalker/Session.cpp57
-rw-r--r--TAO/utils/logWalker/Session.h9
-rw-r--r--TAO/utils/logWalker/Thread.cpp42
-rw-r--r--TAO/utils/logWalker/Thread.h8
-rw-r--r--TAO/utils/logWalker/logWalker.cpp20
12 files changed, 253 insertions, 78 deletions
diff --git a/TAO/utils/logWalker/GIOP_Buffer.cpp b/TAO/utils/logWalker/GIOP_Buffer.cpp
index 10311aeb0dc..a0833ca83ed 100644
--- a/TAO/utils/logWalker/GIOP_Buffer.cpp
+++ b/TAO/utils/logWalker/GIOP_Buffer.cpp
@@ -415,8 +415,14 @@ GIOP_Buffer::parse_svc_contexts (void)
return false;
if (!(*this->cdr_ >> temp))
return false;
+ if ((this->cur_size() == this->buffer_size_) && (this->cdr_->length() < temp))
+ {
+ return this->cdr_->skip_bytes (this->cdr_->length());
+ }
if (!this->cdr_->skip_bytes(temp))
- return false;
+ {
+ return this->cur_size() == this->buffer_size_;
+ }
--num_svc_cont;
}
return true;
@@ -436,8 +442,9 @@ GIOP_Buffer::parse_header (void)
char mtype = this->octets_[7];
if (mtype > 1) // not a request or reply
- return false;
-
+ {
+ return false;
+ }
delete this->cdr_;
this->cdr_ = new ACE_InputCDR (this->octets_,
this->cur_size(),
@@ -452,36 +459,54 @@ GIOP_Buffer::parse_header (void)
if (this->ver_minor_ < 2)
{
if (!this->parse_svc_contexts())
- return false;
+ {
+ return false;
+ }
}
if (!(*this->cdr_ >> len_ulong))
- return false;
+ {
+ return false;
+ }
this->req_id_ = static_cast<size_t>(len_ulong);
switch (mtype) {
case 0: //Request
if (!(*this->cdr_ >> this->resp_exp_))
- return false;
+ {
+ return false;
+ }
if (this->ver_minor_ > 1 &&
!(*this->cdr_ >> len_ulong)) // address disposition
- return false;
+ {
+ return false;
+ }
if (!(*this->cdr_ >> len_ulong))
- return false;
+ {
+ return false;
+ }
this->oid_len_ = static_cast<size_t>(len_ulong);
this->oid_ = this->cdr_->rd_ptr();
if (!this->cdr_->skip_bytes(len_ulong))
- return false;
+ {
+ return false;
+ }
if (!(*this->cdr_ >> len_ulong))
- return false;
+ {
+ return false;
+ }
this->opname_ = this->cdr_->rd_ptr();
if (!this->cdr_->skip_bytes(len_ulong))
- return false;
+ {
+ return false;
+ }
break;
case 1: //Reply
if (!(*this->cdr_ >> len_ulong))
- return false;
+ {
+ return false;
+ }
this->reply_status_ = static_cast<size_t>(len_ulong);
break;
default:
@@ -554,15 +579,16 @@ bool
GIOP_Buffer::matches (GIOP_Buffer *other) const
{
if (other->header_parsed_)
- return this->expected_req_id_ == other->actual_req_id() &&
- this->expected_type_ == other->type() &&
- (this->expected_size_ == other->msg_size() ||
- this->expected_size_ == other->msg_size() + 4);
- else
- return this->expected_req_id_ == other->expected_req_id() &&
- this->expected_type_ == other->expected_type() &&
- this->sending_ == other->sending() &&
- this->expected_size_ == other->expected_size();
+ {
+ return this->expected_req_id_ == other->actual_req_id() &&
+ this->expected_type_ == other->type() &&
+ (this->expected_size_ == other->msg_size() ||
+ this->expected_size_ == other->msg_size() + 4);
+ }
+ return this->expected_req_id_ == other->expected_req_id() &&
+ this->expected_type_ == other->expected_type() &&
+ this->sending_ == other->sending() &&
+ this->expected_size_ == other->expected_size();
}
void
diff --git a/TAO/utils/logWalker/HostProcess.cpp b/TAO/utils/logWalker/HostProcess.cpp
index 93f232fa4c1..75423dc6b93 100644
--- a/TAO/utils/logWalker/HostProcess.cpp
+++ b/TAO/utils/logWalker/HostProcess.cpp
@@ -2,6 +2,7 @@
#include "Invocation.h"
#include "PeerProcess.h"
#include "Thread.h"
+#include "Session.h"
#include "ace/OS_NS_stdio.h"
@@ -67,7 +68,7 @@ HostProcess::find_thread (long tid, size_t offset)
return thr;
}
char alias[20];
- ACE_OS::sprintf (alias,"Thread[" ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "]",
+ ACE_OS::snprintf (alias, 20, "Thread[" ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "]",
this->threads_.size() + 1);
thr = new Thread (tid, alias, offset);
threads_.insert_tail (thr);
@@ -252,9 +253,9 @@ HostProcess::dump_ident (ostream &strm, const char *message)
}
void
-HostProcess::dump_thread_detail (ostream &strm)
+HostProcess::dump_thread_summary (ostream &strm)
{
- this->dump_ident (strm, "thread details:");
+ this->dump_ident (strm, "thread summary:");
long total_sent = 0;
long total_recv = 0;
size_t total_bytes_sent = 0;
@@ -265,7 +266,7 @@ HostProcess::dump_thread_detail (ostream &strm)
{
Thread *thr = 0;
t_iter.next(thr);
- thr->dump_detail (strm);
+ thr->dump_summary (strm);
thr->get_summary (total_recv, total_sent, total_bytes_recv, total_bytes_sent);
}
strm << "Total requests sent: " << total_sent << " received: " << total_recv << endl;
@@ -273,6 +274,25 @@ HostProcess::dump_thread_detail (ostream &strm)
}
void
+HostProcess::split_thread_invocations (Session *session)
+{
+ for (ACE_DLList_Iterator <Thread> t_iter (this->threads_);
+ !t_iter.done();
+ t_iter.advance())
+ {
+ Thread *thr = 0;
+ t_iter.next(thr);
+ char fname[100];
+ thr->split_filename(fname,100);
+ ostream *strm = session->stream_for (0, this, "threads", fname);
+ thr->dump_invocations (*strm);
+ *strm << endl;
+ thr->dump_incidents (*strm);
+ *strm << endl;
+ delete strm;
+ }
+}
+void
HostProcess::dump_thread_invocations (ostream &strm)
{
this->dump_ident (strm, "invocations by thread:");
@@ -319,10 +339,24 @@ HostProcess::iterate_peers (int group,
*strm << endl;
break;
case 2:
- if (!first)
- this->dump_ident (*strm,"Invocations continued");
- entry->item()->dump_invocation_detail (*strm);
- *strm << endl;
+ if (strm == 0)
+ {
+ char fname[100];
+ entry->item()->split_filename(fname,100);
+ strm = session->stream_for (0, this, "peers",fname);
+ this->dump_ident (*strm, "Invocation Detail");
+ entry->item()->dump_invocation_detail (*strm);
+ *strm << endl;
+ delete (strm);
+ strm = 0;
+ }
+ else
+ {
+ if (!first)
+ this->dump_ident (*strm,"Invocations continued");
+ entry->item()->dump_invocation_detail (*strm);
+ *strm << endl;
+ }
break;
case 3:
entry->item()->match_hosts (session);
@@ -333,7 +367,7 @@ HostProcess::iterate_peers (int group,
}
void
-HostProcess::dump_peer_detail (ostream &strm)
+HostProcess::dump_peer_summary (ostream &strm)
{
this->dump_ident (strm, "peer processes:");
size_t num_servers = 0;
@@ -367,6 +401,12 @@ HostProcess::dump_object_detail (ostream &strm)
}
void
+HostProcess::split_peer_invocations (Session *session)
+{
+ this->iterate_peers (3, 2, 0, session);
+}
+
+void
HostProcess::dump_invocation_detail(ostream &strm)
{
this->dump_ident (strm, "invocations: ");
diff --git a/TAO/utils/logWalker/HostProcess.h b/TAO/utils/logWalker/HostProcess.h
index 7cfb50283d8..68b6b33b7b4 100644
--- a/TAO/utils/logWalker/HostProcess.h
+++ b/TAO/utils/logWalker/HostProcess.h
@@ -95,10 +95,12 @@ public:
// various output methods
void dump_ident (ostream &strm, const char *extra);
void dump_summary (ostream &strm);
- void dump_thread_detail (ostream &strm);
+ void dump_thread_summary (ostream &strm);
+ void split_thread_invocations (Session *session);
void dump_thread_invocations (ostream &strm);
- void dump_peer_detail (ostream &strm);
+ void dump_peer_summary (ostream &strm);
void dump_object_detail (ostream &strm);
+ void split_peer_invocations (Session *session);
void dump_invocation_detail (ostream &strm);
// reconcile_peers gives an opportunity to resolve peer process names
diff --git a/TAO/utils/logWalker/Invocation.cpp b/TAO/utils/logWalker/Invocation.cpp
index ffdc786823a..fffac1cc52d 100644
--- a/TAO/utils/logWalker/Invocation.cpp
+++ b/TAO/utils/logWalker/Invocation.cpp
@@ -46,7 +46,6 @@ Invocation::init (const char * text, size_t offset, Thread *thread)
return false;
}
-
if( ACE_OS::strstr(text,"Request") == 0)
this->repl_octets_ = new GIOP_Buffer(text, offset, thread, this);
else
diff --git a/TAO/utils/logWalker/Log.cpp b/TAO/utils/logWalker/Log.cpp
index 80579b33c54..29526d4fc1f 100644
--- a/TAO/utils/logWalker/Log.cpp
+++ b/TAO/utils/logWalker/Log.cpp
@@ -134,7 +134,7 @@ Log::get_preamble ()
if (this->hostproc_ == 0)
{
size_t numprocs = this->procs_.size();
- this->hostproc_ = new HostProcess (this->origin_,pid);
+ this->hostproc_ = new HostProcess (this->origin_, pid);
this->procs_.insert_tail(this->hostproc_);
ACE_CString &procname = this->alias_.length() > 0 ?
this->alias_ : this->origin_;
@@ -163,6 +163,7 @@ Log::get_preamble ()
this->session_.add_process (this->hostproc_);
}
this->thr_ = this->hostproc_->find_thread (tid, this->offset_);
+ this->thr_->add_time (this->timestamp_);
return;
}
@@ -419,8 +420,8 @@ Log::parse_process_parsed_msgs_i (void)
"%d: Error parsing %C, can't find peer "
"for handle %d, text = %s\n",
this->offset_, this->origin_.c_str(), handle, this->info_));
- pp = new PeerProcess (this->offset_, true);
- Transport *t = new Transport ("<unknown>", false, this->offset_);
+ pp = new PeerProcess (this->offset_, this->timestamp_, true);
+ Transport *t = new Transport ("<unknown>", false, this->offset_, this->timestamp_);
t->handle_ = handle;
pp->add_transport(t);
this->hostproc_->add_peer (handle,pp);
@@ -584,7 +585,9 @@ Log::parse_close_connection_i (void)
{
Transport *t = pp->find_transport (handle);
if (t != 0)
- t->close_offset_ = this->offset_;
+ {
+ t->close (this->offset_, this->timestamp_);
+ }
}
this->hostproc_->remove_peer(handle);
@@ -661,7 +664,7 @@ Log::parse_handler_open_i (bool is_ssl)
if (pp->is_server())
{
- Transport *t = new Transport (local_addr.c_str(), true, this->offset_);
+ Transport *t = new Transport (local_addr.c_str(), true, this->offset_, this->timestamp_);
pp->add_transport (t);
this->hostproc_->add_client_endpoint (t->client_endpoint_);
}
@@ -692,7 +695,7 @@ Log::parse_handler_open_i (bool is_ssl)
}
else
{
- trans = new Transport (addr, false, this->offset_);
+ trans = new Transport (addr, false, this->offset_, this->timestamp_);
pp->add_transport(trans);
}
trans->handle_ = handle;
@@ -708,7 +711,7 @@ Log::parse_begin_connection_i (void)
PeerProcess *pp = this->hostproc_->find_peer(addr);
if (pp == 0)
{
- pp = new PeerProcess(this->offset_, true);
+ pp = new PeerProcess(this->offset_, this->timestamp_, true);
pp->set_server_addr (addr);
}
this->conn_waiters_.insert_tail (pp);
@@ -746,7 +749,7 @@ Log::parse_local_addr_i (void)
{
// ACE_DEBUG ((LM_DEBUG, "%d: local_addr: thr %d, peer is server addr = %s\n",
// offset_, thr_->id(), addr));
- Transport *t = new Transport (addr, true, this->offset_);
+ Transport *t = new Transport (addr, true, this->offset_, this->timestamp_);
peer->add_transport (t);
this->hostproc_->add_client_endpoint (t->client_endpoint_);
}
@@ -774,7 +777,7 @@ Log::parse_open_as_server_i (void)
{
// ACE_DEBUG ((LM_DEBUG,"%d: open_as_server: adding peer process\n", offset_));
- this->thr_->push_new_connection (new PeerProcess(this->offset_, false));
+ this->thr_->push_new_connection (new PeerProcess(this->offset_, this->timestamp_, false));
}
void
diff --git a/TAO/utils/logWalker/PeerProcess.cpp b/TAO/utils/logWalker/PeerProcess.cpp
index f405d40d51d..7db2493188a 100644
--- a/TAO/utils/logWalker/PeerProcess.cpp
+++ b/TAO/utils/logWalker/PeerProcess.cpp
@@ -87,14 +87,23 @@ Endpoint::is_client (void) const
}
-Transport::Transport (const char *addr, bool is_client, size_t offset)
+Transport::Transport (const char *addr, bool is_client, size_t offset, const ACE_CString &time)
: handle_ (0),
client_endpoint_ (addr, is_client ? ER_CLIENT : ER_SERVER),
open_offset_ (offset),
- close_offset_ (0)
+ open_time_ (time),
+ close_offset_ (0),
+ close_time_ ()
{
}
+void
+Transport::close (size_t offset, const ACE_CString &time)
+{
+ this->close_offset_ = offset;
+ this->close_time_ = time;
+}
+
char *
PeerProcess::nextIdent(bool is_server)
{
@@ -104,7 +113,7 @@ PeerProcess::nextIdent(bool is_server)
return ident;
}
-PeerProcess::PeerProcess (size_t offset, bool is_server)
+PeerProcess::PeerProcess (size_t offset, const ACE_CString &time, bool is_server)
: ident_ (0),
origin_ (0),
owner_ (0),
@@ -117,7 +126,8 @@ PeerProcess::PeerProcess (size_t offset, bool is_server)
origin_offset_ (offset),
objects_ (),
invocations_ (),
- object_by_index_ ()
+ object_by_index_ (),
+ first_time_ (time)
{
this->ident_ = PeerProcess::nextIdent(is_server);
}
@@ -242,6 +252,12 @@ PeerProcess::id (void) const
return this->ident_;
}
+void
+PeerProcess::split_filename (char *buffer, size_t len) const
+{
+ snprintf (buffer, len, "%s.txt", this->ident_);
+}
+
PeerObject *
PeerProcess::object_for (const char *oid, size_t len)
{
@@ -335,7 +351,11 @@ PeerProcess::dump_summary (ostream &strm)
strm << "server at ";
else
strm << "client to ";
- strm << this->server_ep_.host_ << ":" << this->server_ep_.port_;
+ strm << this->server_ep_.host_ << ":" << this->server_ep_.port_ << endl;
+ strm << " ";
+ if (this->first_time_.length())
+ strm << " first seen at " << this->first_time_;
+
strm << " with " << num_transports << " connections, ";
strm << " referenced " << this->objects_.current_size()
<< " objects in " << this->invocations_.size() << " invocations";
@@ -354,6 +374,7 @@ PeerProcess::dump_summary (ostream &strm)
strm << " closed line " << tran->close_offset_;
strm << endl;
}
+ strm << endl;
}
void
diff --git a/TAO/utils/logWalker/PeerProcess.h b/TAO/utils/logWalker/PeerProcess.h
index cd94fd9c9b5..3c96836082f 100644
--- a/TAO/utils/logWalker/PeerProcess.h
+++ b/TAO/utils/logWalker/PeerProcess.h
@@ -47,11 +47,15 @@ public:
class Transport
{
public:
- Transport (const char *addr, bool is_client, size_t offset);
+ Transport (const char *addr, bool is_client, size_t offset, const ACE_CString &time);
+ void close (size_t offset, const ACE_CString &time);
+
long handle_;
Endpoint client_endpoint_;
size_t open_offset_;
+ ACE_CString open_time_;
size_t close_offset_;
+ ACE_CString close_time_;
};
@@ -64,11 +68,12 @@ class PeerProcess
{
public:
static char *nextIdent(bool is_server);
- PeerProcess (size_t offset, bool is_server);
+ PeerProcess (size_t offset, const ACE_CString &time, bool is_server);
virtual ~PeerProcess (void);
const char * id (void) const;
+ void split_filename (char *buffer, size_t len) const;
void set_owner (HostProcess *host);
HostProcess *owner (void);
@@ -112,6 +117,7 @@ private:
PeerObjectTable objects_;
InvocationList invocations_;
ObjectByIndex object_by_index_;
+ ACE_CString first_time_;
};
diff --git a/TAO/utils/logWalker/Session.cpp b/TAO/utils/logWalker/Session.cpp
index a1e63fd2ea6..59a630a4dbf 100644
--- a/TAO/utils/logWalker/Session.cpp
+++ b/TAO/utils/logWalker/Session.cpp
@@ -14,6 +14,7 @@ Session::alt_addrs_;
Session::Session (void)
+ : split_details_ (false)
{
ACE_CString n ("localhost");
ACE_CString v ("127.0.0.1");
@@ -153,9 +154,10 @@ Session::find_host (const Endpoint &endpoint, bool server)
}
void
-Session::make_dir (const char *dirname)
+Session::make_dir (const char *dirname, bool split)
{
this->base_dir_ = dirname;
+ this->split_details_ = split;
}
void
@@ -177,13 +179,13 @@ Session::has_outfile (void)
}
ostream *
-Session::stream_for ( ostream *oldstream, HostProcess *hp, const char *sub)
+Session::stream_for ( ostream *oldstream, HostProcess *hp, const char *sub, const char *detail)
{
if (this->has_dir())
{
ACE_CString outname = this->base_dir_;
- if (oldstream == 0)
+ if (oldstream == 0 && hp == 0)
{
ACE_OS::mkdir(this->base_dir_.c_str());
}
@@ -196,6 +198,12 @@ Session::stream_for ( ostream *oldstream, HostProcess *hp, const char *sub)
outname += ACE_DIRECTORY_SEPARATOR_CHAR;
}
outname += (sub == 0) ? "summary.txt" : sub;
+ if (detail != 0)
+ {
+ ACE_OS::mkdir(outname.c_str());
+ outname += ACE_DIRECTORY_SEPARATOR_CHAR;
+ outname += detail;
+ }
return new ofstream (outname.c_str());
}
@@ -212,12 +220,14 @@ Session::dump ()
{
bool single = !this->has_dir();
ostream *strm = this->stream_for(0);
-
// report session metrics
if (single)
- *strm << "Session summary report: "
- << this->processes_.current_size() << " Processes detected." << endl;
+ {
+ this->split_details_ = false;
+ *strm << "Session summary report: "
+ << this->processes_.current_size() << " Processes detected." << endl;
+ }
for (Procs_By_Name::ITERATOR i (this->procs_by_name_); !i.done(); i.advance())
{
Procs_By_Name::ENTRY *entry;
@@ -233,8 +243,10 @@ Session::dump ()
Procs_By_Name::ENTRY *entry;
if (i.next(entry) == 0)
continue;
- strm = stream_for (strm,entry->item(),"threads.txt");
- entry->item()->dump_thread_detail (*strm);
+ strm = this->split_details_ ?
+ stream_for (strm,entry->item(),"threads", "summary.txt"):
+ stream_for (strm,entry->item(),"threads.txt");
+ entry->item()->dump_thread_summary (*strm);
}
if (single)
@@ -244,8 +256,10 @@ Session::dump ()
Procs_By_Name::ENTRY *entry;
if (i.next(entry) == 0)
continue;
- strm = stream_for (strm,entry->item(),"peer_processes.txt");
- entry->item()->dump_peer_detail (*strm);
+ strm = this->split_details_ ?
+ stream_for (strm,entry->item(),"peers", "summary.txt") :
+ stream_for (strm,entry->item(),"peer_processes.txt");
+ entry->item()->dump_peer_summary (*strm);
}
if (single)
@@ -266,8 +280,15 @@ Session::dump ()
Procs_By_Name::ENTRY *entry;
if (i.next(entry) == 0)
continue;
- strm = stream_for (strm,entry->item(),"invocation_by_peer.txt");
- entry->item()->dump_invocation_detail (*strm);
+ if (this->split_details_)
+ {
+ entry->item()->split_peer_invocations (this);
+ }
+ else
+ {
+ strm = stream_for (strm,entry->item(),"invocation_by_peer.txt");
+ entry->item()->dump_invocation_detail (*strm);
+ }
}
if (single)
@@ -277,9 +298,15 @@ Session::dump ()
Procs_By_Name::ENTRY *entry;
if (i.next(entry) == 0)
continue;
- strm = stream_for (strm,entry->item(),"invocation_by_thread.txt");
-// entry->item()->dump_invocation_detail (*strm);
- entry->item()->dump_thread_invocations (*strm);
+ if (this->split_details_)
+ {
+ entry->item()->split_thread_invocations (this);
+ }
+ else
+ {
+ strm = stream_for (strm,entry->item(),"invocation_by_thread.txt");
+ entry->item()->dump_thread_invocations (*strm);
+ }
}
if (this->has_outfile() || this->has_dir())
delete strm;
diff --git a/TAO/utils/logWalker/Session.h b/TAO/utils/logWalker/Session.h
index b10b3f7e8c7..95f02dc6993 100644
--- a/TAO/utils/logWalker/Session.h
+++ b/TAO/utils/logWalker/Session.h
@@ -38,23 +38,26 @@ public:
const ACE_CString &alternate);
void default_service (const char *string);
- void make_dir (const char * );
+ void make_dir (const char * ,bool );
void outfile (const char * );
bool has_dir (void);
bool has_outfile (void);
void dump ();
+ ostream * stream_for (ostream *old,
+ HostProcess *hp = 0,
+ const char *sub = 0,
+ const char *detail = 0);
private:
HostProcess *find_host_i (const Endpoint &endpoint, bool server);
- ostream * stream_for ( ostream *, HostProcess * = 0, const char * = 0);
-
Processes processes_;
Procs_By_Name procs_by_name_;
ACE_CString base_dir_;
ACE_CString outfile_;
+ bool split_details_;
static long tao_version_;
static AltAddresses alt_addrs_;
};
diff --git a/TAO/utils/logWalker/Thread.cpp b/TAO/utils/logWalker/Thread.cpp
index c66d73b10d7..9b07eb76f35 100644
--- a/TAO/utils/logWalker/Thread.cpp
+++ b/TAO/utils/logWalker/Thread.cpp
@@ -20,11 +20,24 @@ Thread::Thread (long tid, const char *alias, size_t offset)
target_dup_(0),
current_invocation_ (),
active_handle_ (0),
- first_line_ (offset)
+ first_line_ (offset),
+ first_time_ (),
+ last_time_ ()
{
}
void
+Thread::add_time (const ACE_CString &time)
+{
+ if (time.length())
+ {
+ last_time_ = time;
+ if (first_time_.length() == 0)
+ first_time_ = time;
+ }
+}
+
+void
Thread::push_new_connection (PeerProcess *pp)
{
this->new_connection_.push (pp);
@@ -121,6 +134,17 @@ Thread::alias (void) const
}
void
+Thread::split_filename (char *buff, size_t len) const
+{
+ strncpy (buff, this->alias_.c_str(), len);
+ char *c = strchr(buff, '[');
+ *c = '_';
+ c = strchr (c, ']');
+ strcpy (c, ".txt");
+
+}
+
+void
Thread::incoming_from (PeerProcess *pp)
{
this->incoming_ = pp;
@@ -230,7 +254,7 @@ Thread::current_invocation (void) const
}
void
-Thread::dump_detail (ostream &strm)
+Thread::dump_summary (ostream &strm)
{
strm << " " << this->alias_ << " tid = 0x" << hex << this->id_
<< " (" << dec << this->id_
@@ -238,9 +262,17 @@ Thread::dump_detail (ostream &strm)
<< this->client_encounters_ << " requests sent "
<< this->server_encounters_ << " requests received";
if (this->count_nesting () > 0 && this->max_depth_ > 0)
- strm <<", with " << this->nested_ << " nested upcalls, max depth "
- << this->max_depth_;
- strm << endl;
+ {
+ strm <<", with " << this->nested_ << " nested upcalls, max depth "
+ << this->max_depth_ << endl;
+ }
+ if (this->first_time_.length() )
+ {
+ strm << " first encountered " << this->first_time_
+ << " last encountered " << this->last_time_;
+ }
+
+ strm << "\n" << endl;
}
void
diff --git a/TAO/utils/logWalker/Thread.h b/TAO/utils/logWalker/Thread.h
index 844ab1ade4a..d4f3bb1cee5 100644
--- a/TAO/utils/logWalker/Thread.h
+++ b/TAO/utils/logWalker/Thread.h
@@ -19,11 +19,15 @@ class Thread
{
public:
Thread (long tid, const char *alias, size_t offset);
+ void add_time (const ACE_CString &time);
+
long max_depth (void) const;
long client_encounters (void) const;
long server_encounters (void) const;
long id (void) const;
const ACE_CString &alias (void) const;
+ void split_filename (char *buff, size_t len) const;
+
void incoming_from (PeerProcess *);
void add_invocation (Invocation *);
void push_invocation (Invocation *);
@@ -36,7 +40,7 @@ public:
void exit_wait (PeerProcess *, size_t linenum);
GIOP_Buffer *giop_target (void);
void set_giop_target (GIOP_Buffer *buffer);
- void dump_detail (ostream &strm);
+ void dump_summary (ostream &strm);
void dump_invocations (ostream &strm);
void dump_incidents (ostream &strm);
@@ -74,6 +78,8 @@ private:
InvocationStack current_invocation_;
long active_handle_;
size_t first_line_;
+ ACE_CString first_time_;
+ ACE_CString last_time_;
};
#endif // LOG_WALKER_THREAD_H
diff --git a/TAO/utils/logWalker/logWalker.cpp b/TAO/utils/logWalker/logWalker.cpp
index 20f0d07525d..79f614b8dbc 100644
--- a/TAO/utils/logWalker/logWalker.cpp
+++ b/TAO/utils/logWalker/logWalker.cpp
@@ -82,7 +82,14 @@ parse_manifest (Session &session, ACE_TCHAR *filename)
"or directory but not both\n"));
ACE_OS::exit (0);
}
- session.make_dir (buffer+3);
+ if (buffer[2] == 'd')
+ {
+ session.make_dir (buffer+4, true);
+ }
+ else
+ {
+ session.make_dir (buffer+3, false);
+ }
continue;
}
if (buffer[1] == 't')
@@ -110,11 +117,12 @@ print_help (void)
{
ACE_DEBUG ((LM_DEBUG, "tao_logWalker recongizes the following arguments\n"));
ACE_DEBUG ((LM_DEBUG, "-o <filename> - write all output to specified file\n"));
- ACE_DEBUG ((LM_DEBUG, "-d <directory> - create separate output files, one per log, and put them in specified directory.\n Either -o or -d may be set but not both. Default output to stdout.\n"));
+ ACE_DEBUG ((LM_DEBUG, "-d[d] <directory> - create separate output files, one per log, and put them in specified directory.\n Either -o or -d may be set but not both. Default output to stdout.\n Use -dd to further split thread and peer process details onto multiple files."));
ACE_DEBUG ((LM_DEBUG, "-m <manifest> - Take inputs from named manifest file\n"));
ACE_DEBUG ((LM_DEBUG, "-t <1.5 .. 2.0> - set source TAO version, default 2.0\n"));
ACE_DEBUG ((LM_DEBUG, "-a <name=address> - bind an alias to a host address.\n Repeat as many times as necessary.\n"));
- ACE_DEBUG ((LM_DEBUG, "-p <service=address> - bind a service such as Naming to a specific endpoint address\n"));
+ ACE_DEBUG ((LM_DEBUG, "-p <service=address> - bind a service such as Naming to a specific peer endpoint address\n"));
+ ACE_DEBUG ((LM_DEBUG, "[alias=]filename - provide a source file with an altenate name"));
}
int
@@ -138,13 +146,15 @@ ACE_TMAIN (int argc, ACE_TCHAR **argv)
session.outfile(ACE_TEXT_ALWAYS_CHAR(argv[++i]));
continue;
}
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-d")) == 0)
+ if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-d")) == 0 ||
+ ACE_OS::strcasecmp (argv[i], ACE_TEXT("-dd")) == 0)
{
if (session.has_outfile())
ACE_ERROR_RETURN ((LM_ERROR,
"supply either output file "
"or directory but not both\n"), 0);
- session.make_dir (ACE_TEXT_ALWAYS_CHAR(argv[++i]));
+ bool split = ACE_OS::strcasecmp (argv[i], ACE_TEXT("-dd")) == 0;
+ session.make_dir (ACE_TEXT_ALWAYS_CHAR(argv[++i]), split);
continue;
}
if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-m")) == 0)