diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-08-31 09:56:02 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-08-31 22:57:01 -0700 |
commit | b60f931e8e2479d9a93e568b358feb24f52a864b (patch) | |
tree | e23377f67bc039860702bc16959f2ce8bb72d6d1 /xlators/debug | |
parent | 9f2a399055d3738457dbc461b1e9e99f718884e0 (diff) |
debug/trace: Print total write size in trace_writev
Backport of: http://review.gluster.org/12053
This is some information I find useful while debugging issues
in shard translator.
Change-Id: Ia33f656741750b4d5306599ea71ba1dc85bf311d
BUG: 1258411
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/12065
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/debug')
-rw-r--r-- | xlators/debug/trace/src/trace.c | 9 |
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; |