summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance')
-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
5 files changed, 93 insertions, 213 deletions
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);
{