summaryrefslogtreecommitdiff
path: root/kern/syscnt.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-06-14 01:07:44 +0200
committerRichard Braun <rbraun@sceen.net>2017-06-14 01:09:21 +0200
commitb4c2ce830188d0bd8bb84014a623ecb06c160ed9 (patch)
treec81c1e1a03b9b7c8f65d5fc44f1f7521709971e3 /kern/syscnt.c
parent9f523da9e60aa8b8748dd320b04d8e42a5209668 (diff)
kern/syscnt: new syscnt_info shell command
Diffstat (limited to 'kern/syscnt.c')
-rw-r--r--kern/syscnt.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/kern/syscnt.c b/kern/syscnt.c
index 5b479f36..2e042bc6 100644
--- a/kern/syscnt.c
+++ b/kern/syscnt.c
@@ -22,6 +22,7 @@
#include <kern/init.h>
#include <kern/list.h>
#include <kern/mutex.h>
+#include <kern/shell.h>
#include <kern/spinlock.h>
#include <kern/syscnt.h>
@@ -38,6 +39,32 @@ syscnt_setup(void)
mutex_init(&syscnt_lock);
}
+#ifdef X15_SHELL
+
+static void
+syscnt_shell_info(int argc, char **argv)
+{
+ char *prefix;
+
+ prefix = (argc >= 2) ? argv[1] : NULL;
+ syscnt_info(prefix);
+}
+
+
+static struct shell_cmd syscnt_shell_cmds[] = {
+ SHELL_CMD_INITIALIZER("syscnt_info", syscnt_shell_info,
+ "syscnt_info [<prefix>]",
+ "Show information about system counters"),
+};
+
+#endif /* X15_SHELL */
+
+void __init
+syscnt_register_shell_cmds(void)
+{
+ SHELL_REGISTER_CMDS(syscnt_shell_cmds);
+}
+
void __init
syscnt_register(struct syscnt *syscnt, const char *name)
{