summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/iobuf.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-05-13 03:46:38 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-13 12:12:38 -0700
commit675d330897aa6923d667cc318ee466cb0cb84f9b (patch)
tree75ee0945bcf7ef7720e5bbe6ed2f2ffa4c7c7317 /libglusterfs/src/iobuf.c
parent16f0d3b9da3a0b21204cd8fc7ad2139a6f58ee90 (diff)
libglusterfs: Provide ability to filter output of state dump
Output of statedump can be controlled by having file /tmp/glusterdump.input. /tmp/glusterdump.input needs to have a <key>=<value> in each line. key can be one of 'priv', 'fd', 'inode', 'mem', 'callpool' and 'iobuf'. value has to be one of 'yes' or 'no'. If /tmp/glusterdump.input is not available, no filtering happens in statedump. Else statedump would contain only those sections which correspond to a <key> having value 'yes'. Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 828 (glusterdump filled up the /) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=828
Diffstat (limited to 'libglusterfs/src/iobuf.c')
-rw-r--r--libglusterfs/src/iobuf.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c
index 4d458b4ba71..b16409fbf81 100644
--- a/libglusterfs/src/iobuf.c
+++ b/libglusterfs/src/iobuf.c
@@ -695,40 +695,40 @@ iobuf_stats_dump (struct iobuf_pool *iobuf_pool)
{
char msg[1024];
- struct iobuf_arena *trav;
+ struct iobuf_arena *trav = NULL;
int i = 1;
int ret = -1;
if (!iobuf_pool)
return;
- memset(msg, 0, sizeof(msg));
+ memset (msg, 0, sizeof(msg));
- ret = pthread_mutex_trylock(&iobuf_pool->mutex);
+ ret = pthread_mutex_trylock (&iobuf_pool->mutex);
if (ret) {
- gf_log("", GF_LOG_WARNING, "Unable to dump iobuf pool"
+ gf_log ("", GF_LOG_WARNING, "Unable to dump iobuf pool"
" errno: %d", errno);
return;
}
- gf_proc_dump_add_section("iobuf.global");
- gf_proc_dump_write("iobuf.global.iobuf_pool","%p", iobuf_pool);
- gf_proc_dump_write("iobuf.global.iobuf_pool.page_size", "%d",
+ gf_proc_dump_add_section ("iobuf.global");
+ gf_proc_dump_write ("iobuf.global.iobuf_pool","%p", iobuf_pool);
+ gf_proc_dump_write ("iobuf.global.iobuf_pool.page_size", "%d",
iobuf_pool->page_size);
- gf_proc_dump_write("iobuf.global.iobuf_pool.arena_size", "%d",
+ gf_proc_dump_write( "iobuf.global.iobuf_pool.arena_size", "%d",
iobuf_pool->arena_size);
- gf_proc_dump_write("iobuf.global.iobuf_pool.arena_cnt", "%d",
+ gf_proc_dump_write ("iobuf.global.iobuf_pool.arena_cnt", "%d",
iobuf_pool->arena_cnt);
list_for_each_entry (trav, &iobuf_pool->arenas.list, list) {
- snprintf(msg, sizeof(msg), "iobuf.global.iobuf_pool.arena.%d",
+ snprintf (msg, sizeof(msg), "iobuf.global.iobuf_pool.arena.%d",
i);
- gf_proc_dump_add_section(msg);
- iobuf_arena_info_dump(trav,msg);
+ gf_proc_dump_add_section (msg);
+ iobuf_arena_info_dump (trav,msg);
i++;
}
- pthread_mutex_unlock(&iobuf_pool->mutex);
+ pthread_mutex_unlock (&iobuf_pool->mutex);
return;
}