summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-06-14 01:42:10 +0000
committerAnand Avati <avati@gluster.com>2011-06-14 22:37:51 -0700
commit9e59ce6d30f4ffd3dc7fb88c29fbd0ea79b9de28 (patch)
tree218f65ba2f6f8e478e3d02f6b000d4167f337c1e /xlators/performance
parent90117ca1c28b54845d617cdba0887d6453f875a4 (diff)
performance-translators: print path to file while dumping fdctx.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 1059 (enhancements for getting statistics from performance translators) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1059
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c11
-rw-r--r--xlators/performance/write-behind/src/write-behind.c9
2 files changed, 19 insertions, 1 deletions
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index 6358b4f48e8..600082e00bc 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -835,6 +835,7 @@ ra_fdctx_dump (xlator_t *this, fd_t *fd)
ra_page_t *page = NULL;
int32_t ret = 0, i = 0;
uint64_t tmp_file = 0;
+ char *path = NULL;
char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
@@ -852,6 +853,13 @@ ra_fdctx_dump (xlator_t *this, fd_t *fd)
gf_proc_dump_add_section (key_prefix);
+ ret = __inode_path (fd->inode, NULL, &path);
+ if (path != NULL) {
+ gf_proc_dump_build_key (key, key_prefix, "path");
+ gf_proc_dump_write (key, "%s", path);
+ GF_FREE (path);
+ }
+
gf_proc_dump_build_key (key, key_prefix, "fd");
gf_proc_dump_write (key, "%p", fd);
@@ -878,7 +886,8 @@ ra_fdctx_dump (xlator_t *this, fd_t *fd)
gf_proc_dump_build_key (key, key_prefix, "page[%d]", i++);
ra_page_dump (page, key_prefix);
}
-
+
+ ret = 0;
out:
return ret;
}
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index 4b8e0d188bf..f49487e87f4 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -2777,6 +2777,7 @@ wb_file_dump (xlator_t *this, fd_t *fd)
wb_file_t *file = NULL;
uint64_t tmp_file = 0;
int32_t ret = -1;
+ char *path = NULL;
char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
@@ -2802,6 +2803,13 @@ wb_file_dump (xlator_t *this, fd_t *fd)
gf_proc_dump_add_section (key_prefix);
+ __inode_path (fd->inode, NULL, &path);
+ if (path != NULL) {
+ gf_proc_dump_build_key (key, key_prefix, "path");
+ gf_proc_dump_write (key, "%s", path);
+ GF_FREE (path);
+ }
+
gf_proc_dump_build_key (key, key_prefix, "fd");
gf_proc_dump_write (key, "%p", fd);
@@ -2846,6 +2854,7 @@ wb_file_dump (xlator_t *this, fd_t *fd)
}
UNLOCK (&file->lock);
+ ret = 0;
out:
return ret;
}