From 9ef8eabae21a3073f3dc09602d0680d631cbd576 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 29 Sep 2011 12:11:44 +0530 Subject: 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 Reviewed-by: Amar Tumballi --- xlators/protocol/client/src/client.c | 33 +++++++-------------------------- xlators/protocol/server/src/server.c | 15 +++++---------- 2 files changed, 12 insertions(+), 36 deletions(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index c7064438352..ccbc0afdc38 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -2236,25 +2236,19 @@ client_priv_dump (xlator_t *this) gf_proc_dump_add_section(key_prefix); list_for_each_entry(tmp, &conf->saved_fds, sfd_pos) { - gf_proc_dump_build_key(key, key_prefix, - "fd.%d.remote_fd", ++i); + sprintf (key, "fd.%d.remote_fd", ++i); gf_proc_dump_write(key, "%d", tmp->remote_fd); } - gf_proc_dump_build_key(key, key_prefix, "connecting"); - gf_proc_dump_write(key, "%d", conf->connecting); - gf_proc_dump_build_key(key, key_prefix, "last_sent"); - gf_proc_dump_write(key, "%s", ctime(&conf->last_sent.tv_sec)); - gf_proc_dump_build_key(key, key_prefix, "last_received"); - gf_proc_dump_write(key, "%s", ctime(&conf->last_received.tv_sec)); + gf_proc_dump_write("connecting", "%d", conf->connecting); + gf_proc_dump_write("last_sent", "%s", ctime(&conf->last_sent.tv_sec)); + gf_proc_dump_write("last_received", "%s", ctime(&conf->last_received.tv_sec)); if (conf->rpc) { - gf_proc_dump_build_key(key, key_prefix, "total_bytes_read"); - gf_proc_dump_write(key, "%"PRIu64, + gf_proc_dump_write("total_bytes_read", "%"PRIu64, conf->rpc->conn.trans->total_bytes_read); - gf_proc_dump_build_key(key, key_prefix, "total_bytes_written"); - gf_proc_dump_write(key, "%"PRIu64, + gf_proc_dump_write("total_bytes_written", "%"PRIu64, conf->rpc->conn.trans->total_bytes_write); } pthread_mutex_unlock(&conf->lock); @@ -2266,26 +2260,13 @@ client_priv_dump (xlator_t *this) int32_t client_inodectx_dump (xlator_t *this, inode_t *inode) { - ino_t par = 0; - uint64_t gen = 0; - int ret = -1; - char key[GF_DUMP_MAX_BUF_LEN]; - if (!inode) return -1; if (!this) return -1; - ret = inode_ctx_get2 (inode, this, &par, &gen); - - if (ret != 0) - return ret; - - gf_proc_dump_build_key(key, "xlator.protocol.client", - "%s.inode.%ld.par", - this->name,inode->ino); - gf_proc_dump_write(key, "%ld, %ld", par, gen); + /*TODO*/ return 0; } diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 3b1f46ad397..e9f2818200f 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -189,24 +189,20 @@ server_fd (xlator_t *this) list_for_each_entry (trav, &conf->conns, list) { if (trav->id) { gf_proc_dump_build_key(key, - "xlator.protocol.server.conn", - "%d.id", i); + "conn","%d.id", i); gf_proc_dump_write(key, "%s", trav->id); } - gf_proc_dump_build_key(key,"xlator.protocol.server.conn", - "%d.ref",i) + gf_proc_dump_build_key(key,"conn","%d.ref",i) gf_proc_dump_write(key, "%d", trav->ref); if (trav->bound_xl) { gf_proc_dump_build_key(key, - "xlator.protocol.server.conn", - "%d.bound_xl", i); + "conn","%d.bound_xl", i); gf_proc_dump_write(key, "%s", trav->bound_xl->name); } gf_proc_dump_build_key(key, - "xlator.protocol.server.conn", - "%d.id", i); + "conn","%d.id", i); fdtable_dump(trav->fdtable,key); i++; } @@ -277,8 +273,7 @@ server_inode (xlator_t *this) list_for_each_entry (trav, &conf->conns, list) { if (trav->bound_xl && trav->bound_xl->itable) { gf_proc_dump_build_key(key, - "xlator.protocol.server.conn", - "%d.bound_xl.%s", + "conn","%d.bound_xl.%s", i, trav->bound_xl->name); inode_table_dump(trav->bound_xl->itable,key); i++; -- cgit