summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
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 /libglusterfs/src
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 'libglusterfs/src')
-rw-r--r--libglusterfs/src/fd.c13
-rw-r--r--libglusterfs/src/inode.c15
-rw-r--r--libglusterfs/src/stack.c72
-rw-r--r--libglusterfs/src/statedump.c27
4 files changed, 45 insertions, 82 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 7779dfe2551..bd12519b963 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -726,16 +726,9 @@ fd_dump (fd_t *fd, char *prefix)
return;
memset(key, 0, sizeof(key));
- gf_proc_dump_build_key(key, prefix, "pid");
- gf_proc_dump_write(key, "%d", fd->pid);
- gf_proc_dump_build_key(key, prefix, "refcount");
- gf_proc_dump_write(key, "%d", fd->refcount);
- gf_proc_dump_build_key(key, prefix, "flags");
- gf_proc_dump_write(key, "%d", fd->flags);
- if (fd->inode) {
- gf_proc_dump_build_key(key, prefix, "inode");
- gf_proc_dump_write(key, "%ld", fd->inode->ino);
- }
+ gf_proc_dump_write("pid", "%d", fd->pid);
+ gf_proc_dump_write("refcount", "%d", fd->refcount);
+ gf_proc_dump_write("flags", "%d", fd->flags);
}
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index 7f938236738..117b977b924 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -1495,7 +1495,6 @@ inode_ctx_del (inode_t *inode, xlator_t *key, uint64_t *value)
void
inode_dump (inode_t *inode, char *prefix)
{
- char key[GF_DUMP_MAX_BUF_LEN];
int ret = -1;
xlator_t *xl = NULL;
int i = 0;
@@ -1518,16 +1517,10 @@ inode_dump (inode_t *inode, char *prefix)
}
{
- gf_proc_dump_build_key(key, prefix, "gfid");
- gf_proc_dump_write(key, "%s", uuid_utoa (inode->gfid));
- gf_proc_dump_build_key(key, prefix, "nlookup");
- gf_proc_dump_write(key, "%ld", inode->nlookup);
- gf_proc_dump_build_key(key, prefix, "ref");
- gf_proc_dump_write(key, "%u", inode->ref);
- gf_proc_dump_build_key(key, prefix, "ino");
- gf_proc_dump_write(key, "%ld", inode->ino);
- gf_proc_dump_build_key(key, prefix, "ia_type");
- gf_proc_dump_write(key, "%d", inode->ia_type);
+ gf_proc_dump_write("gfid", "%s", uuid_utoa (inode->gfid));
+ gf_proc_dump_write("nlookup", "%ld", inode->nlookup);
+ gf_proc_dump_write("ref", "%u", inode->ref);
+ gf_proc_dump_write("ia_type", "%d", inode->ia_type);
if (inode->_ctx) {
inode_ctx = GF_CALLOC (inode->table->xl->graph->xl_count,
sizeof (*inode_ctx),
diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c
index f4110528c64..0f65faa6fb7 100644
--- a/libglusterfs/src/stack.c
+++ b/libglusterfs/src/stack.c
@@ -41,7 +41,6 @@ gf_proc_dump_call_frame (call_frame_t *call_frame, const char *key_buf,...)
char prefix[GF_DUMP_MAX_BUF_LEN];
va_list ap;
- char key[GF_DUMP_MAX_BUF_LEN];
call_frame_t my_frame;
int ret = -1;
@@ -66,32 +65,23 @@ gf_proc_dump_call_frame (call_frame_t *call_frame, const char *key_buf,...)
memcpy(&my_frame, call_frame, sizeof(my_frame));
UNLOCK(&call_frame->lock);
- gf_proc_dump_build_key(key, prefix,"ref_count");
- gf_proc_dump_write(key, "%d", my_frame.ref_count);
- gf_proc_dump_build_key(key, prefix,"translator");
- gf_proc_dump_write(key, "%s", my_frame.this->name);
- gf_proc_dump_build_key(key, prefix,"complete");
- gf_proc_dump_write(key, "%d", my_frame.complete);
- if (my_frame.parent) {
- gf_proc_dump_build_key(key, prefix,"parent");
- gf_proc_dump_write(key, "%s", my_frame.parent->this->name);
- }
- if (my_frame.wind_from) {
- gf_proc_dump_build_key(key, prefix, "wind_from");
- gf_proc_dump_write(key, "%s", my_frame.wind_from);
- }
- if (my_frame.wind_to) {
- gf_proc_dump_build_key(key, prefix, "wind_to");
- gf_proc_dump_write(key, "%s", my_frame.wind_to);
- }
- if (my_frame.unwind_from) {
- gf_proc_dump_build_key(key, prefix, "unwind_from");
- gf_proc_dump_write(key, "%s", my_frame.unwind_from);
- }
- if (my_frame.unwind_to) {
- gf_proc_dump_build_key(key, prefix, "unwind_to");
- gf_proc_dump_write(key, "%s", my_frame.unwind_to);
- }
+ gf_proc_dump_write("ref_count", "%d", my_frame.ref_count);
+ gf_proc_dump_write("translator", "%s", my_frame.this->name);
+ gf_proc_dump_write("complete", "%d", my_frame.complete);
+ if (my_frame.parent)
+ gf_proc_dump_write("parent", "%s", my_frame.parent->this->name);
+
+ if (my_frame.wind_from)
+ gf_proc_dump_write("wind_from", "%s", my_frame.wind_from);
+
+ if (my_frame.wind_to)
+ gf_proc_dump_write("wind_to", "%s", my_frame.wind_to);
+
+ if (my_frame.unwind_from)
+ gf_proc_dump_write("unwind_from", "%s", my_frame.unwind_from);
+
+ if (my_frame.unwind_to)
+ gf_proc_dump_write("unwind_to", "%s", my_frame.unwind_to);
}
@@ -102,7 +92,6 @@ gf_proc_dump_call_stack (call_stack_t *call_stack, const char *key_buf,...)
va_list ap;
call_frame_t *trav;
int32_t cnt, i;
- char key[GF_DUMP_MAX_BUF_LEN];
if (!call_stack)
return;
@@ -116,25 +105,18 @@ gf_proc_dump_call_stack (call_stack_t *call_stack, const char *key_buf,...)
vsnprintf(prefix, GF_DUMP_MAX_BUF_LEN, key_buf, ap);
va_end(ap);
- gf_proc_dump_build_key(key, prefix,"uid");
- gf_proc_dump_write(key, "%d", call_stack->uid);
- gf_proc_dump_build_key(key, prefix,"gid");
- gf_proc_dump_write(key, "%d", call_stack->gid);
- gf_proc_dump_build_key(key, prefix,"pid");
- gf_proc_dump_write(key, "%d", call_stack->pid);
- gf_proc_dump_build_key(key, prefix,"unique");
- gf_proc_dump_write(key, "%Ld", call_stack->unique);
+ gf_proc_dump_write("uid", "%d", call_stack->uid);
+ gf_proc_dump_write("gid", "%d", call_stack->gid);
+ gf_proc_dump_write("pid", "%d", call_stack->pid);
+ gf_proc_dump_write("unique", "%Ld", call_stack->unique);
- gf_proc_dump_build_key(key, prefix,"op");
if (call_stack->type == GF_OP_TYPE_FOP)
- gf_proc_dump_write(key, "%s", gf_fop_list[call_stack->op]);
+ gf_proc_dump_write("op", "%s", gf_fop_list[call_stack->op]);
else if (call_stack->type == GF_OP_TYPE_MGMT)
- gf_proc_dump_write(key, "%s", gf_mgmt_list[call_stack->op]);
+ gf_proc_dump_write("op", "%s", gf_mgmt_list[call_stack->op]);
- gf_proc_dump_build_key(key, prefix,"type");
- gf_proc_dump_write(key, "%d", call_stack->type);
- gf_proc_dump_build_key(key, prefix,"cnt");
- gf_proc_dump_write(key, "%d", cnt);
+ gf_proc_dump_write("type", "%d", call_stack->type);
+ gf_proc_dump_write("cnt", "%d", cnt);
trav = &call_stack->frames;
@@ -167,8 +149,8 @@ gf_proc_dump_pending_frames (call_pool_t *call_pool)
gf_proc_dump_add_section("global.callpool");
- gf_proc_dump_write("global.callpool","%p", call_pool);
- gf_proc_dump_write("global.callpool.cnt","%d", call_pool->cnt);
+ gf_proc_dump_write("callpool_address","%p", call_pool);
+ gf_proc_dump_write("callpool.cnt","%d", call_pool->cnt);
list_for_each_entry (trav, &call_pool->all_frames, all_frames) {
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index 525980bfacd..52de73b50e3 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -139,8 +139,6 @@ gf_proc_dump_write (char *key, char *value,...)
static void
gf_proc_dump_xlator_mem_info (xlator_t *xl)
{
- char key[GF_DUMP_MAX_BUF_LEN];
- char prefix[GF_DUMP_MAX_BUF_LEN];
int i = 0;
struct mem_acct rec = {0,};
@@ -158,20 +156,17 @@ gf_proc_dump_xlator_mem_info (xlator_t *xl)
sizeof (struct mem_acct))))
continue;
- gf_proc_dump_add_section ("%s.%s - usage-type %d", xl->type,
- xl->name,i);
- gf_proc_dump_build_key (prefix, "memusage", "%s.%s.type.%d",
- xl->type, xl->name, i);
- gf_proc_dump_build_key (key, prefix, "size");
- gf_proc_dump_write (key, "%u", xl->mem_acct.rec[i].size);
- gf_proc_dump_build_key (key, prefix, "num_allocs");
- gf_proc_dump_write (key, "%u", xl->mem_acct.rec[i].num_allocs);
- gf_proc_dump_build_key (key, prefix, "max_size");
- gf_proc_dump_write (key, "%u", xl->mem_acct.rec[i].max_size);
- gf_proc_dump_build_key (key, prefix, "max_num_allocs");
- gf_proc_dump_write (key, "%u", xl->mem_acct.rec[i].max_num_allocs);
- gf_proc_dump_build_key (key, prefix, "total_allocs");
- gf_proc_dump_write (key, "%u", xl->mem_acct.rec[i].total_allocs);
+ gf_proc_dump_add_section ("%s.%s - usage-type %d memusage",
+ xl->type, xl->name, i);
+ gf_proc_dump_write ("size", "%u", xl->mem_acct.rec[i].size);
+ gf_proc_dump_write ("num_allocs", "%u",
+ xl->mem_acct.rec[i].num_allocs);
+ gf_proc_dump_write ("max_size", "%u",
+ xl->mem_acct.rec[i].max_size);
+ gf_proc_dump_write ("max_num_allocs", "%u",
+ xl->mem_acct.rec[i].max_num_allocs);
+ gf_proc_dump_write ("total_allocs", "%u",
+ xl->mem_acct.rec[i].total_allocs);
}
return;