Commit f13ba73f authored by Jeremy Harris's avatar Jeremy Harris

XSG: for XID time-sequence graph, show RPC response timeline rather than RPC...

XSG:  for XID time-sequence graph, show RPC response timeline rather than RPC command + cumulative-ack
parent d34a9510
......@@ -290,6 +290,13 @@ typedef struct seqspace {
quadrant *pquad[4];
} seqspace;
typedef struct xid_hist {
u_int32_t xid;
u_int32_t seq;
struct timeval time;
} xid_hist;
#define XID_HIST_COUNT 32
typedef struct tcb {
/* parent pointer */
struct stcp_pair *ptp;
......@@ -474,6 +481,7 @@ typedef struct tcb {
/* XID Time Sequence Graph info for this one */
PLOTTER xsg_plotter;
char *xsg_plotfile;
xid_hist xsg_history[XID_HIST_COUNT];
/* Time Line Graph */
PLOTTER tline_plotter;
......
......@@ -1374,6 +1374,51 @@ frame_info(PLOTTER pl, ulong fpnum, struct ip *pip)
static xid_hist *
find_free_xid_histent(tcb * thisdir)
{
xid_hist * xp;
/* return the first unused entry */
for (xp = thisdir->xsg_history; xp < thisdir->xsg_history + XID_HIST_COUNT; xp++)
if (!xp->xid) goto out;
/* shuffle up one, losing the oldest. Clear out the now-free bottom one
and return that */
for (xp--; xp > thisdir->xsg_history; xp--) *xp = xp[-1];
out:
xp->xid = 0;
xp->seq = 0;
xp->time.tv_sec = -1;
return xp;
}
static xid_hist *
find_xid_in_hist(tcb * thisdir, u_int32_t xid)
{
xid_hist * xp;
/* search from newest to oldest */
for (xp = thisdir->xsg_history; xp < thisdir->xsg_history + XID_HIST_COUNT; xp++)
if (xid == xp->xid) return xp;
return NULL;
}
static xid_hist *
find_xid_seq_in_hist(tcb * thisdir, u_int32_t seq)
{
xid_hist * xp;
/* search from newest to oldest */
for (xp = thisdir->xsg_history; xp < thisdir->xsg_history + XID_HIST_COUNT; xp++)
if (seq == xp->seq) return xp;
return NULL;
}
tcp_pair *
dotrace(
struct ip *pip,
......@@ -2187,38 +2232,44 @@ nextrpc:
/* XID-only time sequence plots */
if (thisdir->xsg_plotter != NO_PLOTTER) {
if (thisdir->rpc_type == 0) { /* commands */
xid_hist * xp;
xp = find_free_xid_histent(thisdir);
xp->xid = thisdir->rpc_xid;
xp->seq = thisdir->rpc_seq_hi; /* end of RPC command */
xp->time = current_time;
plotter_perm_color(thisdir->xsg_plotter, data_color);
if (!tv_eq(current_time, thisdir->rpc_start_time))
plotter_line(thisdir->xsg_plotter, /* RPC in xple segs */
thisdir->rpc_start_time, thisdir->rpc_xid,
current_time, thisdir->rpc_xid);
plotter_box(thisdir->xsg_plotter,
thisdir->rpc_start_time, thisdir->rpc_xid);
plotter_line(thisdir->xsg_plotter,
thisdir->rpc_start_time, thisdir->rpc_xid,
current_time, thisdir->rpc_xid);
thisdir->rpc_start_time, thisdir->rpc_xid);
plotter_info(thisdir->xsg_plotter,
"C Prog %u Progver %u Proc %u",
thisdir->rpc_prog, thisdir->rpc_progver,
thisdir->rpc_proc);
} else { /* responses */
plotter_temp_color(thisdir->xsg_plotter, ack_color);
plotter_dot(thisdir->xsg_plotter, thisdir->rpc_start_time,
thisdir->rpc_xid);
plotter_info(thisdir->xsg_plotter, "R %u", thisdir->rpc_xid);
}
}
if ( otherdir->xsg_plotter != NO_PLOTTER
&& thisdir->ack_xid_time.tv_sec != -1
&& thisdir->rpc_type != 0) { /* responses */
/* Draw the ACK green-line */
plotter_perm_color(otherdir->xsg_plotter, ack_color);
plotter_line(otherdir->xsg_plotter,
thisdir->ack_xid_time, thisdir->ack_xid,
current_time, thisdir->ack_xid);
plotter_line(otherdir->xsg_plotter,
current_time, thisdir->ack_xid,
current_time, thisdir->rpc_xid);
xid_hist * xp;
/* To display the rpc_proc associated with the
response we'd have to match the call XID */
plotter_perm_color(otherdir->xsg_plotter, ack_color);
if ((xp = find_xid_in_hist(otherdir, thisdir->rpc_xid))) {
plotter_line(otherdir->xsg_plotter,
xp->time, thisdir->rpc_xid,
current_time, thisdir->rpc_xid);
plotter_utick(otherdir->xsg_plotter, current_time, thisdir->rpc_xid);
xp->seq = thisdir->rpc_seq_hi;
xp->time = current_time;
}
else
plotter_dot(otherdir->xsg_plotter,
current_time, thisdir->rpc_xid);
}
thisdir->ack_xid = thisdir->rpc_xid;
thisdir->ack_xid_time = current_time;
......@@ -2630,7 +2681,7 @@ nextrpc:
plotter_line(to_tsgpl,
thisdir->time, SeqRep(otherdir,thisdir->ack),
current_time, SeqRep(otherdir,thisdir->ack));
if (thisdir->ack != ack) {
if (thisdir->ack != ack) { /* a fresh cum-ack */
plotter_line(to_tsgpl,
current_time, SeqRep(otherdir,thisdir->ack),
current_time, SeqRep(otherdir,ack));
......@@ -2662,17 +2713,39 @@ nextrpc:
break;
}
}
/* mark up RPC with TCP-level ack timing, at least for exact seq matches */
{
xid_hist * xp;
if (otherdir->xsg_plotter != NO_PLOTTER) /* TCP ack for RPC cmd */
if (xp = find_xid_seq_in_hist(otherdir, ack)) {
plotter_temp_color(otherdir->xsg_plotter, "blue");
plotter_line(otherdir->xsg_plotter,
xp->time, xp->xid,
current_time, xp->xid);
xp->time = current_time;
}
if (thisdir->xsg_plotter != NO_PLOTTER) /* TCP ack for RPC rsp */
if (xp = find_xid_seq_in_hist(thisdir, ack)) {
plotter_temp_color(thisdir->xsg_plotter, "blue");
plotter_line(thisdir->xsg_plotter,
xp->time, xp->xid,
current_time, xp->xid);
xp->xid = 0; /* mark unused */
}
}
} else {
plotter_dtick(to_tsgpl, current_time, SeqRep(otherdir,ack));
if (*clicky_wireshark)
plotter_clickarea(to_tsgpl, clicky_wireshark);
frame_info(to_tsgpl, fpnum, pip);
if (show_triple_dupack && (ack_type == TRIPLE)) {
if (show_triple_dupack && (ack_type == TRIPLE))
plotter_text(to_tsgpl, current_time,
SeqRep(otherdir,ack),
"a", "3"); /* '3' is for triple dupack */
}
}
if (show_out_order && hw_reorder) {
plotter_perm_color(to_tsgpl, out_order_color);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment