From 24a8879abfd075836f064b688610c6616184eec3 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 19 Jul 2010 07:37:06 +0000 Subject: 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 Signed-off-by: Anand V. Avati 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 --- rpc/rpc-lib/src/rpc-clnt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'rpc/rpc-lib/src') diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 2375cc958..15173d050 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--; -- cgit