From 9c29312628af743f16badb4bc820cbd31f2a9488 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Fri, 29 Oct 2010 03:39:56 +0000 Subject: cli,mgmt/glusterd: fsm log implementation Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati BUG: 1966 (Unnecessarily verbose logs at the default log level) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1966 --- cli/src/cli-cmd-system.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'cli/src/cli-cmd-system.c') diff --git a/cli/src/cli-cmd-system.c b/cli/src/cli-cmd-system.c index 08fc44a37c2..8d55144749d 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 []"); +} + +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 []", + cli_cmd_fsm_log, + "display fsm transitions"}, + { NULL, NULL, NULL } }; -- cgit