summaryrefslogtreecommitdiffstats
path: root/xlators/performance/read-ahead
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-09-29 12:11:44 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-01 05:55:22 -0700
commit9ef8eabae21a3073f3dc09602d0680d631cbd576 (patch)
tree8474d6dd21510aad862490586c7e8ca2359b12fd /xlators/performance/read-ahead
parent161ab1b9664abf3561902c94b8748e9a95d4867c (diff)
statedump: do not print the inode number in the statedump
Since gfid is used to uniquely identify a inode, in the statedump printing inode number is not necessary. Its suffecient if the gfid of the inode is printed. And do not print the the inodelks, entrylks and posixlks if the lock count is 0. Change-Id: Idac115fbce3a5684a0f02f8f5f20b194df8fb27f BUG: 3476 Reviewed-on: http://review.gluster.com/530 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'xlators/performance/read-ahead')
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index 6e4e7c30b..e49709c0e 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -794,7 +794,7 @@ unwind:
void
-ra_page_dump (struct ra_page *page, char *key_prefix)
+ra_page_dump (struct ra_page *page)
{
int i = 0;
call_frame_t *frame = NULL;
@@ -805,22 +805,17 @@ ra_page_dump (struct ra_page *page, char *key_prefix)
goto out;
}
- gf_proc_dump_build_key (key, key_prefix, "offset");
- gf_proc_dump_write (key, "%"PRId64, page->offset);
+ gf_proc_dump_write ("offset", "%"PRId64, page->offset);
- gf_proc_dump_build_key (key, key_prefix, "size");
- gf_proc_dump_write (key, "%"PRId64, page->size);
+ gf_proc_dump_write ("size", "%"PRId64, page->size);
- gf_proc_dump_build_key (key, key_prefix, "dirty");
- gf_proc_dump_write (key, "%s", page->dirty ? "yes" : "no");
+ gf_proc_dump_write ("dirty", "%s", page->dirty ? "yes" : "no");
- gf_proc_dump_build_key (key, key_prefix, "ready");
- gf_proc_dump_write (key, "%s", page->ready ? "yes" : "no");
+ gf_proc_dump_write ("ready", "%s", page->ready ? "yes" : "no");
for (trav = page->waitq; trav; trav = trav->next) {
frame = trav->data;
- gf_proc_dump_build_key (key, key_prefix, "waiting-frame[%d]",
- i++);
+ sprintf (key, "waiting-frame[%d]", i++);
gf_proc_dump_write (key, "%"PRId64, frame->root->unique);
}
@@ -855,36 +850,31 @@ ra_fdctx_dump (xlator_t *this, fd_t *fd)
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_proc_dump_write ("path", "%s", path);
GF_FREE (path);
}
- gf_proc_dump_build_key (key, key_prefix, "fd");
- gf_proc_dump_write (key, "%p", fd);
+ gf_proc_dump_write ("fd", "%p", fd);
- gf_proc_dump_build_key (key, key_prefix, "disabled");
- gf_proc_dump_write (key, "%s", file->disabled ? "yes" : "no");
+ gf_proc_dump_write ("disabled", "%s", file->disabled ? "yes" : "no");
if (file->disabled) {
ret = 0;
goto out;
}
- gf_proc_dump_build_key (key, key_prefix, "page-size");
- gf_proc_dump_write (key, "%"PRId64, file->page_size);
+ gf_proc_dump_write ("page-size", "%"PRId64, file->page_size);
- gf_proc_dump_build_key (key, key_prefix, "page-count");
- gf_proc_dump_write (key, "%u", file->page_count);
+ gf_proc_dump_write ("page-count", "%u", file->page_count);
- gf_proc_dump_build_key (key, key_prefix,
- "next-expected-offset-for-sequential-reads");
- gf_proc_dump_write (key, "%"PRId64, file->offset);
+ gf_proc_dump_write ("next-expected-offset-for-sequential-reads",
+ "%"PRId64, file->offset);
for (page = file->pages.next; page != &file->pages;
page = page->next) {
- gf_proc_dump_build_key (key, key_prefix, "page[%d]", i++);
- ra_page_dump (page, key_prefix);
+ sprintf (key, "page[%d]", i);
+ gf_proc_dump_write (key, "%p", page[i++]);
+ ra_page_dump (page);
}
ret = 0;
@@ -974,7 +964,6 @@ ra_priv_dump (xlator_t *this)
{
ra_conf_t *conf = NULL;
int ret = -1;
- char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
if (!this) {
@@ -999,12 +988,9 @@ ra_priv_dump (xlator_t *this)
"priv");
gf_proc_dump_add_section (key_prefix);
- gf_proc_dump_build_key (key, key_prefix, "page_size");
- gf_proc_dump_write (key, "%d", conf->page_size);
- gf_proc_dump_build_key (key, key_prefix, "page_count");
- gf_proc_dump_write (key, "%d", conf->page_count);
- gf_proc_dump_build_key (key, key_prefix, "force_atime_update");
- gf_proc_dump_write (key, "%d", conf->force_atime_update);
+ gf_proc_dump_write ("page_size", "%d", conf->page_size);
+ gf_proc_dump_write ("page_count", "%d", conf->page_count);
+ gf_proc_dump_write ("force_atime_update", "%d", conf->force_atime_update);
pthread_mutex_unlock (&conf->conf_lock);