Commit 67c9e10f authored by Alessandro Rubini's avatar Alessandro Rubini

cmd_stat: ack the user when turning off stat reporting

If we are master (or slave with no master running) the next commit
makes stats completely silent (nothing happens: nothing printed).
A user typing "stat" won't know if it turned them on or off. So
turning on is now printed:

   wrc# stat
   wrc#
   wrc#
   wrc# stat
   statistics now off
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 290fc745
......@@ -11,6 +11,8 @@ static int cmd_stat(const char *args[])
/* no arguments: invert */
if (!args[0]) {
wrc_stat_running = !wrc_stat_running;
if (!wrc_stat_running)
pp_printf("statistics now off\n");
return 0;
}
......@@ -19,9 +21,10 @@ static int cmd_stat(const char *args[])
mprintf("%d ps\n", ep_get_bitslide());
else if (!strcasecmp(args[0], "on"))
wrc_stat_running = 1;
else if (!strcasecmp(args[0], "off"))
else if (!strcasecmp(args[0], "off")) {
wrc_stat_running = 0;
else
pp_printf("statistics now off\n");
} else
return -EINVAL;
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment