From 1929bfe81379a9c986bfa4202265f76d201a49bc Mon Sep 17 00:00:00 2001 From: Bob Glossman Date: Fri, 5 Feb 2016 12:47:48 -0800 Subject: [PATCH] LU-7733 ptlrpc: print times in microseconds report times and time diffs in seconds.microseconds instead of seconds Signed-off-by: Bob Glosman Change-Id: I272626012a7162072fb3ad73912a56403afb6b39 Reviewed-on: http://review.whamcloud.com/18335 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Minh Diep Reviewed-by: Oleg Drokin --- lustre/ptlrpc/lproc_ptlrpc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index adbd7e2..82fe468 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -964,23 +964,34 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) rc = ptlrpc_lprocfs_svc_req_history_seek(svcpt, srhi, srhi->srhi_seq); if (rc == 0) { + struct timespec arrival, sent, arrivaldiff; char nidstr[LNET_NIDSTR_SIZE]; req = srhi->srhi_req; libcfs_nid2str_r(req->rq_self, nidstr, sizeof(nidstr)); + arrival.tv_sec = req->rq_arrival_time.tv_sec; + arrival.tv_nsec = + req->rq_arrival_time.tv_usec * NSEC_PER_USEC; + sent.tv_sec = req->rq_sent; + sent.tv_nsec = 0; + arrivaldiff = timespec_sub(sent, arrival); + /* Print common req fields. * CAVEAT EMPTOR: we're racing with the service handler * here. The request could contain any old crap, so you * must be just as careful as the service's request * parser. Currently I only print stuff here I know is OK * to look at coz it was set up in request_in_callback()!!! */ - seq_printf(s, LPD64":%s:%s:x"LPU64":%d:%s:%ld:%lds(%+lds) ", + seq_printf(s, LPD64":%s:%s:x"LPU64":%d:%s:" + "%ld.%06ld:%ld.%06lds(%+ld.0s) ", req->rq_history_seq, nidstr, libcfs_id2str(req->rq_peer), req->rq_xid, req->rq_reqlen, ptlrpc_rqphase2str(req), req->rq_arrival_time.tv_sec, - req->rq_sent - req->rq_arrival_time.tv_sec, + req->rq_arrival_time.tv_usec, + arrivaldiff.tv_sec, + arrivaldiff.tv_nsec / NSEC_PER_USEC, req->rq_sent - req->rq_deadline); if (svc->srv_ops.so_req_printer == NULL) seq_printf(s, "\n"); -- 1.8.3.1