summaryrefslogtreecommitdiffstats
path: root/xlators/debug/trace
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-08-31 09:56:02 +0530
committerVijay Bellur <vbellur@redhat.com>2015-08-31 03:11:06 -0700
commitfb8c9b38d8c42ecaf17df6e28c2a97d2cf13fb14 (patch)
tree1b3d90540a23139fbe6140c71671d05e78842714 /xlators/debug/trace
parent1e0644031c7ac0fa28f0912e951a9238f7bbe8ab (diff)
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 <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12053 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/debug/trace')
-rw-r--r--xlators/debug/trace/src/trace.c9
1 files changed, 7 insertions, 2 deletions
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;