cyclic: Add 'cyclic list' and 'cyclic demo' commands
This patch adds the cyclic command, which currently only supports the
'list' subcommand, to list all currently registered cyclic functions.
Here an example:
=> cyclic list
function: cyclic_demo, cpu-time: 7010 us, frequency: 99.80 times/s
function: cyclic_demo2, cpu-time: 1 us, frequency: 1.13 times/s
As you can see, the cpu-time is accounted, so that cyclic functions
that take too long might be discovered. Additionally the frequency is
logged.
The 'cyclic demo' commands registers the cyclic_demo() function to
be executed all 'cycletime_ms' milliseconds. The only thing this
function does is delaying by 'delay_us' microseconds.
Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 67c7d25..7d574d4 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2511,6 +2511,22 @@
memory by coreboot before jumping to U-Boot. It can be useful for
debugging the beaaviour of coreboot or U-Boot.
+config CMD_CYCLIC
+ bool "cyclic - Show information about cyclic functions"
+ depends on CYCLIC
+ default y
+ help
+ This enables the 'cyclic' command which provides information about
+ cyclic execution functions. This infrastructure allows registering
+ functions to be executed cyclically, e.g. every 100ms. These commands
+ are supported:
+
+ cyclic list - list cyclic functions
+ cyclic cyclic demo <cycletime_ms> <delay_us> - register cyclic
+ demo function
+
+ See doc/develop/cyclic.rst for more details.
+
config CMD_DIAG
bool "diag - Board diagnostics"
help