summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-system.c
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2010-10-29 03:39:56 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-10-29 03:42:19 -0700
commit9c29312628af743f16badb4bc820cbd31f2a9488 (patch)
treebcf25aa7bdd7f60be49370f6555e2eaa61572965 /cli/src/cli-cmd-system.c
parentc1b80f0f590e2d7448b890b57e80f4a1b2e39a03 (diff)
cli,mgmt/glusterd: fsm log implementation
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1966 (Unnecessarily verbose logs at the default log level) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1966
Diffstat (limited to 'cli/src/cli-cmd-system.c')
-rw-r--r--cli/src/cli-cmd-system.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-system.c b/cli/src/cli-cmd-system.c
index 08fc44a37..8d5514474 100644
--- a/cli/src/cli-cmd-system.c
+++ b/cli/src/cli-cmd-system.c
@@ -129,6 +129,39 @@ out:
return ret;
}
+void
+cli_cmd_fsm_log_usage ()
+{
+ cli_out ("Usage: fsm log [<peer-name>]");
+}
+
+int
+cli_cmd_fsm_log (struct cli_state *state, struct cli_cmd_word *in_word,
+ const char **words, int wordcount)
+{
+ int ret = -1;
+ rpc_clnt_procedure_t *proc = NULL;
+ call_frame_t *frame = NULL;
+ char *name = "";
+
+ if ((wordcount != 3) && (wordcount != 2)) {
+ cli_cmd_fsm_log_usage ();
+ goto out;
+ }
+
+ if (wordcount == 3)
+ name = (char*)words[2];
+ proc = &cli_rpc_prog->proctable[GF1_CLI_FSM_LOG];
+ if (proc && proc->fn) {
+ frame = create_frame (THIS, THIS->ctx->pool);
+ if (!frame)
+ goto out;
+ ret = proc->fn (frame, THIS, (void*)name);
+ }
+out:
+ return ret;
+}
+
struct cli_cmd cli_system_cmds[] = {
{ GETSPEC_SYNTAX,
cli_cmd_getspec_cbk,
@@ -142,6 +175,10 @@ struct cli_cmd cli_system_cmds[] = {
cli_cmd_system_help_cbk,
"display help for system commands"},
+ { "fsm log [<peer-name>]",
+ cli_cmd_fsm_log,
+ "display fsm transitions"},
+
{ NULL, NULL, NULL }
};