From fb8c9b38d8c42ecaf17df6e28c2a97d2cf13fb14 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Mon, 31 Aug 2015 09:56:02 +0530 Subject: debug/trace: Print total write size in trace_writev This is some information I find useful while debugging issues in shard translator. Change-Id: Ic35c34c2f52d27b3617fc722dabe558de2056b67 BUG: 1258311 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/12053 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur --- xlators/debug/trace/src/trace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xlators/debug/trace/src') diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index 88a41ae480f..94d32a70cca 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -2286,6 +2286,8 @@ trace_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, uint32_t flags, struct iobref *iobref, dict_t *xdata) { trace_conf_t *conf = NULL; + int i = 0; + size_t total_size = 0; conf = this->private; @@ -2293,12 +2295,15 @@ trace_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, goto out; if (trace_fop_names[GF_FOP_WRITE].enabled) { char string[4096] = {0,}; + for (i = 0; i < count; i++) + total_size += vector[i].iov_len; + snprintf (string, sizeof (string), "%"PRId64": gfid=%s fd=%p, count=%d, " - " offset=%"PRId64" flags=0%x)", + " offset=%"PRId64" flags=0%x write_size=%lu", frame->root->unique, uuid_utoa (fd->inode->gfid), fd, count, - offset, flags); + offset, flags, total_size); frame->local = fd->inode->gfid; -- cgit