summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2009-08-15 12:58:08 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-08-19 17:57:53 -0700
commitb4d6c3d1bb461d2c8a396c9ed3881a4da40fc6ab (patch)
tree7a5a15665d46a91b9d4d744b0da599c4628d7f6c /xlators/storage
parenta31b0016347b3bc9b341fa0f4541ed137224f593 (diff)
TAKE2[PATCH BUG:213 1/1] Support for Process State Dump
Support for process state dump. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 213 (Support for process state dump) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 4bcea07f9..b124d1362 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -45,6 +45,7 @@
#include "compat.h"
#include "byte-order.h"
#include "syscall.h"
+#include "statedump.h"
#undef HAVE_SET_FSID
#ifdef HAVE_SET_FSID
@@ -3808,6 +3809,45 @@ posix_checksum (call_frame_t *frame, xlator_t *this,
return 0;
}
+int32_t
+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);
+ gf_proc_dump_add_section(key_prefix);
+
+ if (!this)
+ return 0;
+
+ priv = this->private;
+
+ 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->max_read);
+ gf_proc_dump_build_key(key, key_prefix, "max_write");
+ gf_proc_dump_write(key,"%d", priv->max_write);
+ gf_proc_dump_build_key(key, key_prefix, "stats.nr_files");
+ gf_proc_dump_write(key,"%ld", priv->stats.nr_files);
+
+ return 0;
+}
+
+int32_t
+posix_inode (xlator_t *this)
+{
+ return 0;
+}
+
/**
* notify - when parent sends PARENT_UP, send CHILD_UP event from here
*/
@@ -4056,6 +4096,11 @@ fini (xlator_t *this)
return;
}
+struct xlator_dumpops dumpops = {
+ .priv = posix_priv,
+ .inode = posix_inode,
+};
+
struct xlator_mops mops = {
.stats = posix_stats,
};