diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-09-29 12:11:44 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-10-01 05:55:22 -0700 |
commit | 9ef8eabae21a3073f3dc09602d0680d631cbd576 (patch) | |
tree | 8474d6dd21510aad862490586c7e8ca2359b12fd /libglusterfs/src/stack.c | |
parent | 161ab1b9664abf3561902c94b8748e9a95d4867c (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/stack.c')
-rw-r--r-- | libglusterfs/src/stack.c | 72 |
1 files changed, 27 insertions, 45 deletions
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) { |