summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-04-09 11:18:25 -0400
committerGitHub <noreply@github.com>2021-04-09 11:18:25 -0400
commit3404eb5309a8035dc66f003da90f8b97d7e62cfe (patch)
tree9336082cf31c13566813e54f9d36e204be81ee4a
parent97bbb2c1c4b596945b33668d9ee1cf2a43eb91db (diff)
parentaa270404fcabf88ea3878ca6b711ec64a621326e (diff)
Merge pull request #8428 from idryzhov/show-memory-daemon
vtysh: add "show memory" for a single daemon
-rw-r--r--doc/user/basic.rst5
-rw-r--r--vtysh/vtysh.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/doc/user/basic.rst b/doc/user/basic.rst
index 5cbd3692dc..d78eb9b177 100644
--- a/doc/user/basic.rst
+++ b/doc/user/basic.rst
@@ -444,7 +444,7 @@ Terminal Mode Commands
Shows the current log filters applied to each daemon.
-.. clicmd:: show memory
+.. clicmd:: show memory [DAEMON]
Show information on how much memory is used for which specific things in
|PACKAGE_NAME|. Output may vary depending on system capabilities but will
@@ -502,7 +502,8 @@ Terminal Mode Commands
the column may be missing if system support is not available.
When executing this command from ``vtysh``, each of the daemons' memory
- usage is printed sequentially.
+ usage is printed sequentially. You can specify the daemon's name to print
+ only its memory usage.
.. clicmd:: show history
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 3764188292..931eb91593 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2932,10 +2932,15 @@ DEFUN (vtysh_show_history,
/* Memory */
DEFUN (vtysh_show_memory,
vtysh_show_memory_cmd,
- "show memory",
+ "show memory [" DAEMONS_LIST "]",
SHOW_STR
- "Memory statistics\n")
+ "Memory statistics\n"
+ DAEMONS_STR)
{
+ if (argc == 3)
+ return show_one_daemon(vty, argv, argc - 1,
+ argv[argc - 1]->text);
+
return show_per_daemon(vty, argv, argc, "Memory statistics for %s:\n");
}