summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");
}