summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-01-09 12:45:36 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-02-06 03:54:07 -0500
commit7c242cacf578c18b1c9131771567a17e18b4b369 (patch)
tree8070e0d8d1e6079c8a943008b4130309b4fe52b0
parentc2d854e4f6d8735a5669a4da90b7042418898bc7 (diff)
debug/trace: Print entries' iatts in readdirp cbk
Backport of: http://review.gluster.org/16432 Change-Id: Ie96b04e7961d353f2a193f368ac5ae94a3f64d77 BUG: 1417802 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: https://review.gluster.org/16482 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r--xlators/debug/trace/src/trace.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c
index 03e92184dcd..555147aec47 100644
--- a/xlators/debug/trace/src/trace.c
+++ b/xlators/debug/trace/src/trace.c
@@ -294,14 +294,17 @@ trace_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, gf_dirent_t *buf,
dict_t *xdata)
{
- trace_conf_t *conf = NULL;
+ int count = 0;
+ char statstr[4096] = {0,};
+ char string[4096] = {0,};
+ trace_conf_t *conf = NULL;
+ gf_dirent_t *entry = NULL;
conf = this->private;
if (!conf->log_file && !conf->log_history)
goto out;
if (trace_fop_names[GF_FOP_READDIRP].enabled) {
- char string[4096] = {0,};
snprintf (string, sizeof (string),
"%"PRId64" : gfid=%s op_ret=%d, op_errno=%d",
frame->root->unique, uuid_utoa (frame->local),
@@ -309,6 +312,17 @@ trace_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
LOG_ELEMENT (conf, string);
}
+ if (op_ret < 0)
+ goto out;
+
+ list_for_each_entry (entry, &buf->list, list) {
+ count++;
+ TRACE_STAT_TO_STR (&entry->d_stat, statstr);
+ snprintf (string, sizeof (string), "entry no. %d, pargfid=%s, "
+ "bname=%s *buf {%s}", count, uuid_utoa (frame->local),
+ entry->d_name, statstr);
+ LOG_ELEMENT (conf, string);
+ }
out:
TRACE_STACK_UNWIND (readdirp, frame, op_ret, op_errno, buf, xdata);