Commit 45c725c3 authored by Miguel Jimenez Lopez's avatar Miguel Jimenez Lopez Committed by Benoit Rat

stat: Add a special case to print only one time statistics.

parent c0ffd31c
......@@ -330,6 +330,11 @@ static int wrc_log_stats(void)
ptp_mode != WRC_MODE_SLAVE)
return 0;
last_jiffies = timer_get_tics();
/* Print only one time */
if(wrc_stat_running == -1)
wrc_stat_running = 0;
wrc_stats_last = s->update_count;
shw_pps_gen_get_time(&sec, &nsec);
......
......@@ -35,6 +35,9 @@ static int cmd_stat(const char *args[])
} else if (!strcasecmp(args[0], "off")) {
wrc_stat_running = 0;
pp_printf("statistics now off\n");
} else if (!strcasecmp(args[0], "1")) {
wrc_stat_running = -1; /* Special meaning... (only one) */
wrc_stats_last--; /* force a line to be printed */
} 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