summaryrefslogtreecommitdiffstats
path: root/xlators
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
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')
-rw-r--r--xlators/cluster/afr/src/afr-common.c49
-rw-r--r--xlators/cluster/dht/src/dht.c56
-rw-r--r--xlators/cluster/stripe/src/stripe.c30
-rw-r--r--xlators/features/locks/src/posix.c68
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c24
-rw-r--r--xlators/performance/io-cache/src/io-cache.c62
-rw-r--r--xlators/performance/quick-read/src/quick-read.c62
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c52
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c44
-rw-r--r--xlators/performance/write-behind/src/write-behind.c86
-rw-r--r--xlators/protocol/client/src/client.c33
-rw-r--r--xlators/protocol/server/src/server.c15
-rw-r--r--xlators/storage/posix/src/posix.c16
13 files changed, 187 insertions, 410 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index afff0517e7f..7c38d65ed3b 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -3334,41 +3334,28 @@ afr_priv_dump (xlator_t *this)
GF_ASSERT (priv);
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
gf_proc_dump_add_section(key_prefix);
- gf_proc_dump_build_key(key, key_prefix, "child_count");
- gf_proc_dump_write(key, "%u", priv->child_count);
- gf_proc_dump_build_key(key, key_prefix, "read_child_rr");
- gf_proc_dump_write(key, "%u", priv->read_child_rr);
+ gf_proc_dump_write("child_count", "%u", priv->child_count);
+ gf_proc_dump_write("read_child_rr", "%u", priv->read_child_rr);
for (i = 0; i < priv->child_count; i++) {
- gf_proc_dump_build_key(key, key_prefix, "child_up[%d]", i);
+ sprintf (key, "child_up[%d]", i);
gf_proc_dump_write(key, "%d", priv->child_up[i]);
- gf_proc_dump_build_key(key, key_prefix,
- "pending_key[%d]", i);
+ sprintf (key, "pending_key[%d]", i);
gf_proc_dump_write(key, "%s", priv->pending_key[i]);
}
- gf_proc_dump_build_key(key, key_prefix, "data_self_heal");
- gf_proc_dump_write(key, "%s", priv->data_self_heal);
- gf_proc_dump_build_key(key, key_prefix, "metadata_self_heal");
- gf_proc_dump_write(key, "%d", priv->metadata_self_heal);
- gf_proc_dump_build_key(key, key_prefix, "entry_self_heal");
- gf_proc_dump_write(key, "%d", priv->entry_self_heal);
- gf_proc_dump_build_key(key, key_prefix, "data_change_log");
- gf_proc_dump_write(key, "%d", priv->data_change_log);
- gf_proc_dump_build_key(key, key_prefix, "metadata_change_log");
- gf_proc_dump_write(key, "%d", priv->metadata_change_log);
- gf_proc_dump_build_key(key, key_prefix, "entry_change_log");
- gf_proc_dump_write(key, "%d", priv->entry_change_log);
- gf_proc_dump_build_key(key, key_prefix, "read_child");
- gf_proc_dump_write(key, "%d", priv->read_child);
- gf_proc_dump_build_key(key, key_prefix, "favorite_child");
- gf_proc_dump_write(key, "%d", priv->favorite_child);
- gf_proc_dump_build_key(key, key_prefix, "data_lock_server_count");
- gf_proc_dump_write(key, "%u", priv->data_lock_server_count);
- gf_proc_dump_build_key(key, key_prefix, "metadata_lock_server_count");
- gf_proc_dump_write(key, "%u", priv->metadata_lock_server_count);
- gf_proc_dump_build_key(key, key_prefix, "entry_lock_server_count");
- gf_proc_dump_write(key, "%u", priv->entry_lock_server_count);
- gf_proc_dump_build_key(key, key_prefix, "wait_count");
- gf_proc_dump_write(key, "%u", priv->wait_count);
+ gf_proc_dump_write("data_self_heal", "%s", priv->data_self_heal);
+ gf_proc_dump_write("metadata_self_heal", "%d", priv->metadata_self_heal);
+ gf_proc_dump_write("entry_self_heal", "%d", priv->entry_self_heal);
+ gf_proc_dump_write("data_change_log", "%d", priv->data_change_log);
+ gf_proc_dump_write("metadata_change_log", "%d", priv->metadata_change_log);
+ gf_proc_dump_write("entry-change_log", "%d", priv->entry_change_log);
+ gf_proc_dump_write("read_child", "%d", priv->read_child);
+ gf_proc_dump_write("favorite_child", "%d", priv->favorite_child);
+ gf_proc_dump_write("data_lock_server_count", "%u", priv->data_lock_server_count);
+ gf_proc_dump_write("metadata_lock_server_count", "%u",
+ priv->metadata_lock_server_count);
+ gf_proc_dump_write("entry_lock_server_count", "%u",
+ priv->entry_lock_server_count);
+ gf_proc_dump_write("wait_count", "%u", priv->wait_count);
return 0;
}
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index d9499a407a6..7b32a9766a9 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -106,56 +106,42 @@ dht_priv_dump (xlator_t *this)
gf_proc_dump_add_section("xlator.cluster.dht.%s.priv", this->name);
gf_proc_dump_build_key(key_prefix,"xlator.cluster.dht","%s.priv",
this->name);
- gf_proc_dump_build_key(key, key_prefix, "subvolume_cnt");
- gf_proc_dump_write(key,"%d", conf->subvolume_cnt);
+ gf_proc_dump_write("subvol_cnt","%d", conf->subvolume_cnt);
for (i = 0; i < conf->subvolume_cnt; i++) {
- gf_proc_dump_build_key(key, key_prefix, "subvolumes[%d]", i);
+ sprintf (key, "subvolumes[%d]", i);
gf_proc_dump_write(key, "%s.%s", conf->subvolumes[i]->type,
conf->subvolumes[i]->name);
if (conf->file_layouts && conf->file_layouts[i]){
- gf_proc_dump_build_key(key, key_prefix,
- "file_layouts[%d]",i);
+ sprintf (key, "file_layouts[%d]", i);
dht_layout_dump(conf->file_layouts[i], key);
}
if (conf->dir_layouts && conf->dir_layouts[i]) {
- gf_proc_dump_build_key(key, key_prefix,
- "dir_layouts[%d]",i);
+ sprintf (key, "dir_layouts[%d]", i);
dht_layout_dump(conf->dir_layouts[i], key);
}
if (conf->subvolume_status) {
- gf_proc_dump_build_key(key, key_prefix,
- "subvolume_status[%d]", i);
+
+ sprintf (key, "subvolume_status[%d]", i);
gf_proc_dump_write(key, "%d",
(int)conf->subvolume_status[i]);
}
}
- gf_proc_dump_build_key(key, key_prefix, "search_unhashed");
- gf_proc_dump_write(key, "%d", conf->search_unhashed);
- gf_proc_dump_build_key(key, key_prefix, "gen");
- gf_proc_dump_write(key, "%d", conf->gen);
- gf_proc_dump_build_key(key, key_prefix, "min_free_disk");
- gf_proc_dump_write(key, "%lu", conf->min_free_disk);
- gf_proc_dump_build_key(key, key_prefix, "disk_unit");
- gf_proc_dump_write(key, "%c", conf->disk_unit);
- gf_proc_dump_build_key(key, key_prefix, "refresh_interval");
- gf_proc_dump_write(key, "%d", conf->refresh_interval);
- gf_proc_dump_build_key(key, key_prefix, "unhashed_sticky_bit");
- gf_proc_dump_write(key, "%d", conf->unhashed_sticky_bit);
+ gf_proc_dump_write("search_unhashed", "%d", conf->search_unhashed);
+ gf_proc_dump_write("gen", "%d", conf->gen);
+ gf_proc_dump_write("min_free_disk", "%lu", conf->min_free_disk);
+ gf_proc_dump_write("disk_unit", "%c", conf->disk_unit);
+ gf_proc_dump_write("refresh_interval", "%d", conf->refresh_interval);
+ gf_proc_dump_write("unhashed_sticky_bit", "%d", conf->unhashed_sticky_bit);
if (conf ->du_stats) {
- gf_proc_dump_build_key(key, key_prefix,
- "du_stats.avail_percent");
- gf_proc_dump_write(key, "%lf", conf->du_stats->avail_percent);
- gf_proc_dump_build_key(key, key_prefix,
- "du_stats.avail_space");
- gf_proc_dump_write(key, "%lu", conf->du_stats->avail_space);
- gf_proc_dump_build_key(key, key_prefix,
- "du_stats.log");
- gf_proc_dump_write(key, "%lu", conf->du_stats->log);
+ gf_proc_dump_write("du_stats.avail_percent", "%lf",
+ conf->du_stats->avail_percent);
+ gf_proc_dump_write("du_stats.avail_space", "%lu",
+ conf->du_stats->avail_space);
+ gf_proc_dump_write("du_stats.log", "%lu", conf->du_stats->log);
}
- gf_proc_dump_build_key(key, key_prefix, "last_stat_fetch");
- gf_proc_dump_write(key, "%s", ctime(&conf->last_stat_fetch.tv_sec));
+ gf_proc_dump_write("last_stat_fetch", "%s", ctime(&conf->last_stat_fetch.tv_sec));
UNLOCK(&conf->subvolume_lock);
@@ -167,7 +153,6 @@ int32_t
dht_inodectx_dump (xlator_t *this, inode_t *inode)
{
int ret = -1;
- char key_prefix[GF_DUMP_MAX_BUF_LEN];
dht_layout_t *layout = NULL;
uint64_t tmp_layout = 0;
@@ -184,9 +169,8 @@ dht_inodectx_dump (xlator_t *this, inode_t *inode)
if (!layout)
return -1;
- gf_proc_dump_build_key(key_prefix, "xlator.cluster.dht",
- "%s.inode.%ld", this->name, inode->ino);
- dht_layout_dump(layout, key_prefix);
+ gf_proc_dump_add_section("xlator.cluster.dht.%s.inode", this->name);
+ dht_layout_dump(layout, "layout");
out:
return ret;
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 9c41c405cf1..b49b11915ac 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -4479,7 +4479,6 @@ err:
int32_t
stripe_priv_dump (xlator_t *this)
{
- char key_prefix[GF_DUMP_MAX_BUF_LEN];
char key[GF_DUMP_MAX_BUF_LEN];
int i = 0;
stripe_private_t *priv = NULL;
@@ -4497,39 +4496,26 @@ stripe_priv_dump (xlator_t *this)
goto out;
gf_proc_dump_add_section("xlator.cluster.stripe.%s.priv", this->name);
- gf_proc_dump_build_key(key_prefix,"xlator.cluster.stripe","%s.priv",
- this->name);
- gf_proc_dump_build_key(key, key_prefix, "child_count");
- gf_proc_dump_write(key,"%d", priv->child_count);
+ gf_proc_dump_write("child_count","%d", priv->child_count);
for (i = 0; i < priv->child_count; i++) {
- gf_proc_dump_build_key (key, key_prefix, "subvolumes[%d]", i);
+ sprintf (key, "subvolumes[%d]", i);
gf_proc_dump_write (key, "%s.%s", priv->xl_array[i]->type,
priv->xl_array[i]->name);
}
options = priv->pattern;
while (options != NULL) {
- gf_proc_dump_build_key (key, key_prefix, "path_pattern");
- gf_proc_dump_write (key, "%s", priv->pattern->path_pattern);
-
- gf_proc_dump_build_key (key, key_prefix, "options_block_size");
- gf_proc_dump_write (key, "%ul", options->block_size);
+ gf_proc_dump_write ("path_pattern", "%s", priv->pattern->path_pattern);
+ gf_proc_dump_write ("options_block_size", "%ul", options->block_size);
options = options->next;
}
- gf_proc_dump_build_key (key, key_prefix, "block_size");
- gf_proc_dump_write (key, "%ul", priv->block_size);
-
- gf_proc_dump_build_key (key, key_prefix, "nodes_down");
- gf_proc_dump_write (key, "%d", priv->nodes_down);
-
- gf_proc_dump_build_key (key, key_prefix, "first_child_down");
- gf_proc_dump_write (key, "%d", priv->first_child_down);
-
- gf_proc_dump_build_key (key, key_prefix, "xatter_supported");
- gf_proc_dump_write (key, "%d", priv->xattr_supported);
+ gf_proc_dump_write ("block_size", "%ul", priv->block_size);
+ gf_proc_dump_write ("nodes-down", "%d", priv->nodes_down);
+ gf_proc_dump_write ("first-child_down", "%d", priv->first_child_down);
+ gf_proc_dump_write ("xattr_supported", "%d", priv->xattr_supported);
UNLOCK (&priv->lock);
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 62bdf812dee..2afb3b07fcd 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -1558,7 +1558,7 @@ __dump_entrylks (pl_inode_t *pl_inode)
count = 0;
gf_proc_dump_build_key(key,
- "xlator.feature.locks.lock-dump.domain",
+ "lock-dump.domain",
"domain");
gf_proc_dump_write(key, "%s", dom->domain);
@@ -1629,14 +1629,14 @@ __dump_inodelks (pl_inode_t *pl_inode)
count = 0;
gf_proc_dump_build_key(key,
- "xlator.feature.locks.lock-dump.domain",
+ "lock-dump.domain",
"domain");
gf_proc_dump_write(key, "%s", dom->domain);
list_for_each_entry (lock, &dom->inodelk_list, list) {
gf_proc_dump_build_key(key,
- "xlator.feature.locks.lock-dump.domain.inodelk",
+ "inodelk",
"inodelk[%d](ACTIVE)",count );
SET_FLOCK_PID (&lock->user_flock, lock);
@@ -1653,7 +1653,7 @@ __dump_inodelks (pl_inode_t *pl_inode)
list_for_each_entry (lock, &dom->blocked_inodelks, blocked_locks) {
gf_proc_dump_build_key(key,
- "xlator.feature.locks.lock-dump.domain.inodelk",
+ "inodelk",
"inodelk[%d](BLOCKED)",count );
SET_FLOCK_PID (&lock->user_flock, lock);
pl_dump_lock (tmp, 256, &lock->user_flock,
@@ -1693,7 +1693,7 @@ __dump_posixlks (pl_inode_t *pl_inode)
SET_FLOCK_PID (&lock->user_flock, lock);
gf_proc_dump_build_key(key,
- "xlator.feature.locks.lock-dump.domain.posixlk",
+ "posixlk",
"posixlk[%d](%s)",
count,
lock->blocked ? "BLOCKED" : "ACTIVE");
@@ -1728,7 +1728,6 @@ pl_dump_inode_priv (xlator_t *this, inode_t *inode)
int ret = -1;
uint64_t tmp_pl_inode = 0;
pl_inode_t *pl_inode = NULL;
- char key[GF_DUMP_MAX_BUF_LEN];
int count = 0;
@@ -1746,61 +1745,32 @@ pl_dump_inode_priv (xlator_t *this, inode_t *inode)
goto out;
}
- gf_proc_dump_build_key(key,
- "xlator.feature.locks.inode",
- "%ld.mandatory",inode->ino);
- gf_proc_dump_write(key, "%d", pl_inode->mandatory);
-
+ gf_proc_dump_add_section("xlator.features.locks.%s.inode", this->name);
- count = get_entrylk_count (this, inode);
- gf_proc_dump_build_key(key,
- "xlator.feature.locks.entrylk-count",
- "%ld.entrylk-count", inode->ino);
- gf_proc_dump_write(key, "%d", count);
+ gf_proc_dump_write("mandatory", "%d", pl_inode->mandatory);
+ count = get_entrylk_count (this, inode);
+ if (count) {
+ gf_proc_dump_write("entrylk-count", "%d", count);
dump_entrylks(pl_inode);
+ }
- count = get_inodelk_count (this, inode);
- gf_proc_dump_build_key(key,
- "xlator.feature.locks.inodelk-count",
- "%ld.inodelk-count", inode->ino);
- gf_proc_dump_write(key, "%d", count);
-
+ count = get_inodelk_count (this, inode);
+ if (count) {
+ gf_proc_dump_write("inodlk-count", "%d", count);
dump_inodelks(pl_inode);
+ }
- count = get_posixlk_count (this, inode);
- gf_proc_dump_build_key(key,
- "xlator.feature.locks.posixlk-count",
- "%ld.posixlk-count", inode->ino);
- gf_proc_dump_write(key, "%d", count);
-
+ count = get_posixlk_count (this, inode);
+ if (count) {
+ gf_proc_dump_write("posixlk-count", "%d", count);
dump_posixlks(pl_inode);
-
+ }
out:
return ret;
}
-
-
-/*
- * pl_dump_inode - inode dump function for posix locks
- *
- */
-int
-pl_dump_inode (xlator_t *this)
-{
-
- GF_ASSERT (this);
-
- if (this->itable) {
- inode_table_dump(this->itable,
- "xlator.features.locks.inode_table");
- }
-
- return 0;
-}
-
int32_t
mem_acct_init (xlator_t *this)
{
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 174938a68a4..9c4be889293 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3275,28 +3275,28 @@ fuse_priv_dump (xlator_t *this)
gf_proc_dump_add_section("xlator.mount.fuse.priv");
- gf_proc_dump_write("xlator.mount.fuse.priv.fd", "%d", private->fd);
- gf_proc_dump_write("xlator.mount.fuse.priv.proto_minor", "%u",
+ gf_proc_dump_write("fd", "%d", private->fd);
+ gf_proc_dump_write("proto_minor", "%u",
private->proto_minor);
- gf_proc_dump_write("xlator.mount.fuse.priv.volfile", "%s",
+ gf_proc_dump_write("volfile", "%s",
private->volfile?private->volfile:"None");
- gf_proc_dump_write("xlator.mount.fuse.volfile_size", "%d",
+ gf_proc_dump_write("volfile_size", "%d",
private->volfile_size);
- gf_proc_dump_write("xlator.mount.fuse.mount_point", "%s",
+ gf_proc_dump_write("mount_point", "%s",
private->mount_point);
- gf_proc_dump_write("xlator.mount.fuse.iobuf", "%u",
+ gf_proc_dump_write("iobuf", "%u",
private->iobuf);
- gf_proc_dump_write("xlator.mount.fuse.fuse_thread_started", "%d",
+ gf_proc_dump_write("fuse_thread_started", "%d",
(int)private->fuse_thread_started);
- gf_proc_dump_write("xlator.mount.fuse.direct_io_mode", "%d",
+ gf_proc_dump_write("direct_io_mode", "%d",
private->direct_io_mode);
- gf_proc_dump_write("xlator.mount.fuse.entry_timeout", "%lf",
+ gf_proc_dump_write("entry_timeout", "%lf",
private->entry_timeout);
- gf_proc_dump_write("xlator.mount.fuse.attribute_timeout", "%lf",
+ gf_proc_dump_write("attribute_timeout", "%lf",
private->attribute_timeout);
- gf_proc_dump_write("xlator.mount.fuse.init_recvd", "%d",
+ gf_proc_dump_write("init_recvd", "%d",
(int)private->init_recvd);
- gf_proc_dump_write("xlator.mount.fuse.strict_volfile_check", "%d",
+ gf_proc_dump_write("strict_volfile_check", "%d",
(int)private->strict_volfile_check);
return 0;
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 375004c9346..b848910c14c 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -1738,8 +1738,7 @@ ioc_page_waitq_dump (ioc_page_t *page, char *prefix)
while (trav) {
frame = trav->data;
- gf_proc_dump_build_key (key, prefix,
- "waitq.frame[%d]", i++);
+ sprintf (key, "waitq.frame[%d]", i++);
gf_proc_dump_write (key, "%"PRId64, frame->root->unique);
trav = trav->next;
@@ -1758,9 +1757,8 @@ __ioc_inode_waitq_dump (ioc_inode_t *ioc_inode, char *prefix)
while (trav) {
page = trav->data;
- gf_proc_dump_build_key (key, prefix,
- "cache-validation-waitq.page[%d].offset",
- i++);
+
+ sprintf (key, "cache-validation-waitq.page[%d].offset", i++);
gf_proc_dump_write (key, "%"PRId64, page->offset);
trav = trav->next;
@@ -1770,18 +1768,13 @@ __ioc_inode_waitq_dump (ioc_inode_t *ioc_inode, char *prefix)
void
__ioc_page_dump (ioc_page_t *page, char *prefix)
{
- char key[GF_DUMP_MAX_BUF_LEN] = {0, };
ioc_page_lock (page);
{
- gf_proc_dump_build_key (key, prefix, "offset");
- gf_proc_dump_write (key, "%"PRId64, page->offset);
- gf_proc_dump_build_key (key, prefix, "size");
- gf_proc_dump_write (key, "%"PRId64, page->size);
- gf_proc_dump_build_key (key, prefix, "dirty");
- gf_proc_dump_write (key, "%s", page->dirty ? "yes" : "no");
- gf_proc_dump_build_key (key, prefix, "ready");
- gf_proc_dump_write (key, "%s", page->ready ? "yes" : "no");
+ gf_proc_dump_write ("offset", "%"PRId64, page->offset);
+ gf_proc_dump_write ("size", "%"PRId64, page->size);
+ gf_proc_dump_write ("dirty", "%s", page->dirty ? "yes" : "no");
+ gf_proc_dump_write ("ready", "%s", page->ready ? "yes" : "no");
ioc_page_waitq_dump (page, prefix);
}
ioc_page_unlock (page);
@@ -1809,8 +1802,7 @@ __ioc_cache_dump (ioc_inode_t *ioc_inode, char *prefix)
snprintf (timestr + strlen (timestr), 256 - strlen (timestr),
".%"GF_PRI_SUSECONDS, ioc_inode->cache.tv.tv_usec);
- gf_proc_dump_build_key (key, prefix, "last-cache-validation-time");
- gf_proc_dump_write (key, "%s", timestr);
+ gf_proc_dump_write ("last-cache-validation-time", "%s", timestr);
for (offset = 0; offset < ioc_inode->ia_size;
offset += table->page_size) {
@@ -1819,9 +1811,7 @@ __ioc_cache_dump (ioc_inode_t *ioc_inode, char *prefix)
continue;
}
- gf_proc_dump_build_key (key, prefix,
- "inode.cache.page[%d]", i++);
-
+ sprintf (key, "inode.cache.page[%d]", i++);
__ioc_page_dump (page, key);
}
out:
@@ -1832,22 +1822,14 @@ out:
void
ioc_inode_dump (ioc_inode_t *ioc_inode, char *prefix)
{
- char key[GF_DUMP_MAX_BUF_LEN] = {0, };
- char uuidbuf[256] = {0, };
- if ((ioc_inode == NULL) || (prefix == NULL)) {
+ if ((ioc_inode == NULL) || (prefix == NULL)) {
goto out;
}
ioc_inode_lock (ioc_inode);
{
- gf_proc_dump_build_key (key, prefix, "\ninode.gfid");
- uuid_unparse (ioc_inode->inode->gfid, uuidbuf);
- gf_proc_dump_write (key, "%s", uuidbuf);
- gf_proc_dump_build_key (key, prefix, "inode.ino");
- gf_proc_dump_write (key, "%ld", ioc_inode->inode->ino);
- gf_proc_dump_build_key (key, prefix, "inode.weight");
- gf_proc_dump_write (key, "%d", ioc_inode->weight);
+ gf_proc_dump_write ("inode.weight", "%d", ioc_inode->weight);
__ioc_cache_dump (ioc_inode, prefix);
__ioc_inode_waitq_dump (ioc_inode, prefix);
}
@@ -1862,7 +1844,6 @@ ioc_priv_dump (xlator_t *this)
ioc_table_t *priv = NULL;
ioc_inode_t *ioc_inode = NULL;
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
- char key[GF_DUMP_MAX_BUF_LEN] = {0, };
if (!this || !this->private)
goto out;
@@ -1874,20 +1855,13 @@ ioc_priv_dump (xlator_t *this)
ioc_table_lock (priv);
{
- gf_proc_dump_build_key (key, key_prefix, "page_size");
- gf_proc_dump_write (key, "%ld", priv->page_size);
- gf_proc_dump_build_key (key, key_prefix, "cache_size");
- gf_proc_dump_write (key, "%ld", priv->cache_size);
- gf_proc_dump_build_key (key, key_prefix, "cache_used");
- gf_proc_dump_write (key, "%ld", priv->cache_used);
- gf_proc_dump_build_key (key, key_prefix, "inode_count");
- gf_proc_dump_write (key, "%u", priv->inode_count);
- gf_proc_dump_build_key (key, key_prefix, "cache_timeout");
- gf_proc_dump_write (key, "%u", priv->cache_timeout);
- gf_proc_dump_build_key (key, key_prefix, "min-file-size");
- gf_proc_dump_write (key, "%u", priv->min_file_size);
- gf_proc_dump_build_key (key, key_prefix, "max-file-size");
- gf_proc_dump_write (key, "%u", priv->max_file_size);
+ gf_proc_dump_write ("page_size", "%ld", priv->page_size);
+ gf_proc_dump_write ("cache_size", "%ld", priv->cache_size);
+ gf_proc_dump_write ("cache_used", "%ld", priv->cache_used);
+ gf_proc_dump_write ("inode_count", "%u", priv->inode_count);
+ gf_proc_dump_write ("cache_timeout", "%u", priv->cache_timeout);
+ gf_proc_dump_write ("min-file-size", "%u", priv->min_file_size);
+ gf_proc_dump_write ("max-file-size", "%u", priv->max_file_size);
list_for_each_entry (ioc_inode, &priv->inodes, inode_list) {
ioc_inode_dump (ioc_inode, key_prefix);
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 287ce5afc25..1d7a04e9554 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -3204,7 +3204,6 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode)
qr_inode_t *qr_inode = NULL;
uint64_t value = 0;
int32_t ret = -1;
- char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
char buf[256] = {0, };
struct tm *tm = NULL;
@@ -3222,23 +3221,14 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode)
"inodectx");
gf_proc_dump_add_section (key_prefix);
- gf_proc_dump_build_key (key, key_prefix, "inode.gfid");
- uuid_unparse (inode->gfid, buf);
- gf_proc_dump_write (key, "%s", buf);
-
- gf_proc_dump_build_key (key, key_prefix, "inode.ino");
- gf_proc_dump_write (key, "%ld", inode->ino);
-
- gf_proc_dump_build_key (key, key_prefix, "entire-file-cached");
- gf_proc_dump_write (key, "%s", qr_inode->xattr ? "yes" : "no");
+ gf_proc_dump_write ("entire-file-cached", "%s", qr_inode->xattr ? "yes" : "no");
tm = localtime (&qr_inode->tv.tv_sec);
strftime (buf, 256, "%Y-%m-%d %H:%M:%S", tm);
snprintf (buf + strlen (buf), 256 - strlen (buf),
".%"GF_PRI_SUSECONDS, qr_inode->tv.tv_usec);
- gf_proc_dump_build_key (key, key_prefix, "last-cache-validation-time");
- gf_proc_dump_write (key, "%s", buf);
+ gf_proc_dump_write ("last-cache-validation-time", "%s", buf);
ret = 0;
out:
@@ -3251,7 +3241,6 @@ qr_fdctx_dump (xlator_t *this, fd_t *fd)
qr_fd_ctx_t *fdctx = NULL;
uint64_t value = 0;
int32_t ret = 0, i = 0;
- char uuidbuf[256] = {0, };
char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
call_stub_t *stub = NULL;
@@ -3270,45 +3259,31 @@ qr_fdctx_dump (xlator_t *this, fd_t *fd)
"fdctx");
gf_proc_dump_add_section (key_prefix);
- gf_proc_dump_build_key (key, key_prefix, "fd");
- gf_proc_dump_write (key, "%p", fd);
-
- gf_proc_dump_build_key (key, key_prefix, "path");
- gf_proc_dump_write (key, "%s", fdctx->path);
-
- gf_proc_dump_build_key (key, key_prefix, "fd.inode.gfid");
- uuid_unparse (fd->inode->gfid, uuidbuf);
- gf_proc_dump_write (key, "%s", uuidbuf);
+ gf_proc_dump_write ("fd", "%p", fd);
- gf_proc_dump_build_key (key, key_prefix, "fd.inode.ino");
- gf_proc_dump_write (key, "%ld", fd->inode->ino);
+ gf_proc_dump_write ("path", "%s", fdctx->path);
LOCK (&fdctx->lock);
{
- gf_proc_dump_build_key (key, key_prefix, "opened");
- gf_proc_dump_write (key, "%s", fdctx->opened ? "yes" : "no");
+ gf_proc_dump_write ("opened", "%s", fdctx->opened ? "yes" : "no");
- gf_proc_dump_build_key (key, key_prefix, "open-in-progress");
- gf_proc_dump_write (key, "%s", fdctx->open_in_transit ?
+ gf_proc_dump_write ("open-in-progress", "%s", fdctx->open_in_transit ?
"yes" : "no");
- gf_proc_dump_build_key (key, key_prefix,
- "caching-disabled (for this fd)");
- gf_proc_dump_write (key, "%s", fdctx->disabled ? "yes" : "no");
+ gf_proc_dump_write ("caching disabled (for this fd)", "%s",
+ fdctx->disabled ? "yes" : "no");
- gf_proc_dump_build_key (key, key_prefix, "flags");
- gf_proc_dump_write (key, "%d", fdctx->flags);
+ gf_proc_dump_write ("flags", "%d", fdctx->flags);
- gf_proc_dump_build_key (key, key_prefix, "wbflags");
- gf_proc_dump_write (key, "%d", fdctx->wbflags);
+ gf_proc_dump_write ("wbflags", "%d", fdctx->wbflags);
list_for_each_entry (stub, &fdctx->waiting_ops, list) {
- gf_proc_dump_build_key (key, key_prefix,
+ gf_proc_dump_build_key (key, "",
"waiting-ops[%d].frame", i);
gf_proc_dump_write (key, "%"PRId64,
stub->frame->root->unique);
- gf_proc_dump_build_key (key, key_prefix,
+ gf_proc_dump_build_key (key, "",
"waiting-ops[%d].fop", i);
gf_proc_dump_write (key, "%s", gf_fop_list[stub->fop]);
@@ -3332,7 +3307,6 @@ qr_priv_dump (xlator_t *this)
uint32_t i = 0;
qr_inode_t *curr = NULL;
uint64_t total_size = 0;
- char key[GF_DUMP_MAX_BUF_LEN];
char key_prefix[GF_DUMP_MAX_BUF_LEN];
if (!this) {
@@ -3355,10 +3329,8 @@ qr_priv_dump (xlator_t *this)
gf_proc_dump_add_section (key_prefix);
- gf_proc_dump_build_key (key, key_prefix, "max_file_size");
- gf_proc_dump_write (key, "%d", conf->max_file_size);
- gf_proc_dump_build_key (key, key_prefix, "cache_timeout");
- gf_proc_dump_write (key, "%d", conf->cache_timeout);
+ gf_proc_dump_write ("max_file_size", "%d", conf->max_file_size);
+ gf_proc_dump_write ("cache_timeout", "%d", conf->cache_timeout);
if (!table) {
gf_log (this->name, GF_LOG_WARNING, "table is NULL");
@@ -3372,10 +3344,8 @@ qr_priv_dump (xlator_t *this)
}
}
- gf_proc_dump_build_key (key, key_prefix, "total_files_cached");
- gf_proc_dump_write (key, "%d", file_count);
- gf_proc_dump_build_key (key, key_prefix, "total_cache_used");
- gf_proc_dump_write (key, "%d", total_size);
+ gf_proc_dump_write ("total_files_cached", "%d", file_count);
+ gf_proc_dump_write ("total_cache_used", "%d", total_size);
out:
return 0;
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index 6e4e7c30bf9..e49709c0ea8 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);
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index f8b2bcd7951..c98a2076b8c 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -4025,10 +4025,6 @@ sp_cache_traverse (void *data, void *mydata)
dump->i);
gf_proc_dump_write (key, "%s", uuidbuf);
- gf_proc_dump_build_key(key, dump->key_prefix, "entry[%d].inode.ino",
- dump->i);
- gf_proc_dump_write(key, "%ld", dirent->d_stat.ia_ino);
-
dump->i++;
out:
return;
@@ -4061,7 +4057,7 @@ sp_fdctx_dump (xlator_t *this, fd_t *fd)
"xlator.performance.stat-prefetch",
"fdctx");
gf_proc_dump_add_section (key_prefix);
-
+
gf_proc_dump_build_key (key, key_prefix, "fd");
gf_proc_dump_write (key, "%p", fd);
@@ -4076,18 +4072,15 @@ sp_fdctx_dump (xlator_t *this, fd_t *fd)
gf_proc_dump_build_key (key, key_prefix, "fd.inode.gfid");
gf_proc_dump_write (key, "%s", uuidbuf);
- gf_proc_dump_build_key (key, key_prefix, "fd.inode.ino");
- gf_proc_dump_write (key, "%ld", fd->inode->ino);
-
gf_proc_dump_build_key (key, key_prefix, "miss");
gf_proc_dump_write (key, "%lu", cache->miss);
gf_proc_dump_build_key (key, key_prefix, "hits");
gf_proc_dump_write (key, "%lu", cache->hits);
- gf_proc_dump_build_key (key, key_prefix, "cache");
+ gf_proc_dump_build_key (key, key_prefix, "cache");
dump->key_prefix = key;
-
+
rbthash_table_traverse (cache->table, sp_cache_traverse, dump);
GF_FREE (dump);
@@ -4101,7 +4094,6 @@ sp_inodectx_dump (xlator_t *this, inode_t *inode)
{
char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
- char uuidbuf[256] = {0, };
sp_inode_ctx_t *inode_ctx = NULL;
call_stub_t *stub = NULL;
uint64_t value = 0;
@@ -4121,48 +4113,36 @@ sp_inodectx_dump (xlator_t *this, inode_t *inode)
}
gf_proc_dump_build_key (key_prefix,
- "xlator.performance.stat-prefetch",
+ "stat-prefetch",
"inodectx");
gf_proc_dump_add_section (key_prefix);
-
- uuid_unparse (inode->gfid, uuidbuf);
- gf_proc_dump_build_key (key, key_prefix, "inode.gfid");
- gf_proc_dump_write (key, "%s", uuidbuf);
-
- gf_proc_dump_build_key (key, key_prefix, "inode.ino");
- gf_proc_dump_write (key, "%ld", inode->ino);
LOCK (&inode_ctx->lock);
{
- gf_proc_dump_build_key (key, key_prefix, "looked_up");
- gf_proc_dump_write (key, "%s",
+ gf_proc_dump_write ("looked_up", "%s",
inode_ctx->looked_up ? "yes" : "no");
- gf_proc_dump_build_key (key, key_prefix, "lookup_in_progress");
- gf_proc_dump_write (key, "%s",
+ gf_proc_dump_write ("lookup_in_progress", "%s",
inode_ctx->lookup_in_progress ?
"yes" : "no");
- gf_proc_dump_build_key (key, key_prefix, "need_unwind");
- gf_proc_dump_write (key, "%s", inode_ctx->need_unwind ?
+ gf_proc_dump_write ("need_unwind", "%s", inode_ctx->need_unwind ?
"yes" : "no");
- gf_proc_dump_build_key (key, key_prefix, "op_ret");
- gf_proc_dump_write (key, "%d", inode_ctx->op_ret);
+ gf_proc_dump_write ("op_ret", "%d", inode_ctx->op_ret);
- gf_proc_dump_build_key (key, key_prefix, "op_errno");
- gf_proc_dump_write (key, "%d", inode_ctx->op_errno);
+ gf_proc_dump_write ("op_errno", "%d", inode_ctx->op_errno);
list_for_each_entry (stub, &inode_ctx->waiting_ops, list) {
- gf_proc_dump_build_key (key, key_prefix,
+ gf_proc_dump_build_key (key, "",
"waiting-ops[%d].frame", i);
gf_proc_dump_write (key, "%"PRId64,
stub->frame->root->unique);
- gf_proc_dump_build_key (key, key_prefix,
+ gf_proc_dump_build_key (key, "",
"waiting-ops[%d].fop", i);
gf_proc_dump_write (key, "%s", gf_fop_list[stub->fop]);
-
+
i++;
}
}
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index 4d47eb54ebe..2bedac38f6c 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -2678,7 +2678,6 @@ int
wb_priv_dump (xlator_t *this)
{
wb_conf_t *conf = NULL;
- char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
int ret = -1;
@@ -2692,18 +2691,13 @@ wb_priv_dump (xlator_t *this)
gf_proc_dump_add_section (key_prefix);
- gf_proc_dump_build_key (key, key_prefix, "aggregate_size");
- gf_proc_dump_write (key, "%d", conf->aggregate_size);
- gf_proc_dump_build_key (key, key_prefix, "window_size");
- gf_proc_dump_write (key, "%d", conf->window_size);
- gf_proc_dump_build_key (key, key_prefix, "disable_till");
- gf_proc_dump_write (key, "%d", conf->disable_till);
- gf_proc_dump_build_key (key, key_prefix, "enable_O_SYNC");
- gf_proc_dump_write (key, "%d", conf->enable_O_SYNC);
- gf_proc_dump_build_key (key, key_prefix, "flush_behind");
- gf_proc_dump_write (key, "%d", conf->flush_behind);
- gf_proc_dump_build_key (key, key_prefix, "enable_trickling_writes");
- gf_proc_dump_write (key, "%d", conf->enable_trickling_writes);
+ gf_proc_dump_write ("aggregate_size", "%d", conf->aggregate_size);
+ gf_proc_dump_write ("window_size", "%d", conf->window_size);
+ gf_proc_dump_write ("disable_till", "%d", conf->disable_till);
+ gf_proc_dump_write ("enable_O_SYNC", "%d", conf->enable_O_SYNC);
+ gf_proc_dump_write ("flush_behind", "%d", conf->flush_behind);
+ gf_proc_dump_write ("enable_trickling_writes", "%d",
+ conf->enable_trickling_writes);
ret = 0;
out:
@@ -2726,46 +2720,34 @@ __wb_dump_requests (struct list_head *head, char *prefix, char passive)
gf_proc_dump_add_section(key_prefix);
- gf_proc_dump_build_key (key, key_prefix, "request-ptr");
- gf_proc_dump_write (key, "%p", request);
+ gf_proc_dump_write ("request-ptr", "%p", request);
- gf_proc_dump_build_key (key, key_prefix, "refcount");
- gf_proc_dump_write (key, "%d", request->refcount);
+ gf_proc_dump_write ("refcount", "%d", request->refcount);
if (request->fop == GF_FOP_WRITE) {
flag = request->flags.write_request.stack_wound;
- gf_proc_dump_build_key (key, key_prefix, "stack_wound");
- gf_proc_dump_write (key, "%d", flag);
+ gf_proc_dump_write ("stack_wound", "%d", flag);
- gf_proc_dump_build_key (key, key_prefix, "size");
- gf_proc_dump_write (key, "%"GF_PRI_SIZET,
+ gf_proc_dump_write ("size", "%"GF_PRI_SIZET,
request->write_size);
- gf_proc_dump_build_key (key, key_prefix, "offset");
- gf_proc_dump_write (key, "%"PRId64,
+ gf_proc_dump_write ("offset", "%"PRId64,
request->stub->args.writev.off);
flag = request->flags.write_request.write_behind;
- gf_proc_dump_build_key (key, key_prefix,
- "write_behind");
- gf_proc_dump_write (key, "%d", flag);
+ gf_proc_dump_write ("write_behind", "%d", flag);
flag = request->flags.write_request.got_reply;
- gf_proc_dump_build_key (key, key_prefix, "got_reply");
- gf_proc_dump_write (key, "%d", flag);
+ gf_proc_dump_write ("got_reply", "%d", flag);
flag = request->flags.write_request.virgin;
- gf_proc_dump_build_key (key, key_prefix, "virgin");
- gf_proc_dump_write (key, "%d", flag);
+ gf_proc_dump_write ("virgin", "%d", flag);
flag = request->flags.write_request.flush_all;
- gf_proc_dump_build_key (key, key_prefix, "flush_all");
- gf_proc_dump_write (key, "%d", flag);
+ gf_proc_dump_write ("flush_all", "%d", flag);
} else {
flag = request->flags.other_requests.marked_for_resume;
- gf_proc_dump_build_key (key, key_prefix,
- "marked_for_resume");
- gf_proc_dump_write (key, "%d", flag);
+ gf_proc_dump_write ("marked_for_resume", "%d", flag);
}
}
}
@@ -2778,7 +2760,6 @@ wb_file_dump (xlator_t *this, fd_t *fd)
uint64_t tmp_file = 0;
int32_t ret = -1;
char *path = NULL;
- char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
if ((fd == NULL) || (this == NULL)) {
@@ -2805,41 +2786,30 @@ wb_file_dump (xlator_t *this, fd_t *fd)
__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, "%d", file->disabled);
+ gf_proc_dump_write ("disabled", "%d", file->disabled);
- gf_proc_dump_build_key (key, key_prefix, "disable_till");
- gf_proc_dump_write (key, "%lu", file->disable_till);
+ gf_proc_dump_write ("disable_till", "%lu", file->disable_till);
- gf_proc_dump_build_key (key, key_prefix, "window_conf");
- gf_proc_dump_write (key, "%"GF_PRI_SIZET, file->window_conf);
+ gf_proc_dump_write ("window_conf", "%"GF_PRI_SIZET, file->window_conf);
- gf_proc_dump_build_key (key, key_prefix, "window_current");
- gf_proc_dump_write (key, "%"GF_PRI_SIZET, file->window_current);
+ gf_proc_dump_write ("window_current", "%"GF_PRI_SIZET, file->window_current);
- gf_proc_dump_build_key (key, key_prefix, "flags");
- gf_proc_dump_write (key, "%s", (file->flags & O_APPEND) ? "O_APPEND"
+ gf_proc_dump_write ("flags", "%s", (file->flags & O_APPEND) ? "O_APPEND"
: "!O_APPEND");
- gf_proc_dump_build_key (key, key_prefix, "aggregate_current");
- gf_proc_dump_write (key, "%"GF_PRI_SIZET, file->aggregate_current);
+ gf_proc_dump_write ("aggregate_current", "%"GF_PRI_SIZET, file->aggregate_current);
- gf_proc_dump_build_key (key, key_prefix, "refcount");
- gf_proc_dump_write (key, "%d", file->refcount);
+ gf_proc_dump_write ("refcount", "%d", file->refcount);
- gf_proc_dump_build_key (key, key_prefix, "op_ret");
- gf_proc_dump_write (key, "%d", file->op_ret);
+ gf_proc_dump_write ("op_ret", "%d", file->op_ret);
- gf_proc_dump_build_key (key, key_prefix, "op_errno");
- gf_proc_dump_write (key, "%d", file->op_errno);
+ gf_proc_dump_write ("op_errno", "%d", file->op_errno);
LOCK (&file->lock);
{
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++;
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index aad8a7350b1..6a623c0a9e8 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3649,7 +3649,6 @@ posix_priv (xlator_t *this)
{
struct posix_private *priv = NULL;
char key_prefix[GF_DUMP_MAX_BUF_LEN];
- char key[GF_DUMP_MAX_BUF_LEN];
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type,
this->name);
@@ -3663,16 +3662,11 @@ posix_priv (xlator_t *this)
if (!priv)
return 0;
- gf_proc_dump_build_key(key, key_prefix, "base_path");
- gf_proc_dump_write(key,"%s", priv->base_path);
- gf_proc_dump_build_key(key, key_prefix, "base_path_length");
- gf_proc_dump_write(key,"%d", priv->base_path_length);
- gf_proc_dump_build_key(key, key_prefix, "max_read");
- gf_proc_dump_write(key,"%d", priv->read_value);
- gf_proc_dump_build_key(key, key_prefix, "max_write");
- gf_proc_dump_write(key,"%d", priv->write_value);
- gf_proc_dump_build_key(key, key_prefix, "nr_files");
- gf_proc_dump_write(key,"%ld", priv->nr_files);
+ gf_proc_dump_write("base_path","%s", priv->base_path);
+ gf_proc_dump_write("base_path_length","%d", priv->base_path_length);
+ gf_proc_dump_write("max_read","%d", priv->read_value);
+ gf_proc_dump_write("max_write","%d", priv->write_value);
+ gf_proc_dump_write("nr_files","%ld", priv->nr_files);
return 0;
}