summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpc-clnt.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-07-19 07:37:06 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-20 09:46:18 -0700
commit24a8879abfd075836f064b688610c6616184eec3 (patch)
treeef6994820a640feea74306b8e570f3af0879689b /rpc/rpc-lib/src/rpc-clnt.c
parenta3ed6014101d2bc3904041c1c7a062cdf6bdf7d7 (diff)
rpc/rpc-lib added saved frame's call timestamp
it will be good to have the time stamp at which the calls were sent to the server in the gf_log of saved_frames_unwind Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 908 (saved_frames_unwind() : print time stamp of when call was sent to server) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=908
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt.c')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index 2375cc958ca..15173d0501d 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -300,6 +300,8 @@ saved_frames_unwind (struct saved_frames *saved_frames)
{
struct saved_frame *trav = NULL;
struct saved_frame *tmp = NULL;
+ struct tm *frame_sent_tm = NULL;
+ char timestr[256] = {0,};
struct rpc_req req;
struct iovec iov = {0,};
@@ -309,11 +311,17 @@ saved_frames_unwind (struct saved_frames *saved_frames)
req.rpc_status = -1;
list_for_each_entry_safe (trav, tmp, &saved_frames->sf.list, list) {
+ frame_sent_tm = localtime (&trav->saved_at.tv_sec);
+ strftime (timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S",
+ frame_sent_tm);
+ snprintf (timestr + strlen (timestr), sizeof(timestr) - strlen (timestr),
+ ".%"GF_PRI_SUSECONDS, trav->saved_at.tv_usec);
+
gf_log ("rpc-clnt", GF_LOG_ERROR,
- "forced unwinding frame type(%s) op(%s(%d))",
+ "forced unwinding frame type(%s) op(%s(%d)) called at %s",
trav->prog->progname, (trav->prog->procnames) ?
trav->prog->procnames[trav->procnum] : "--",
- trav->procnum);
+ trav->procnum, timestr);
saved_frames->count--;