diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-17 00:12:54 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-17 02:09:45 +0200 |
commit | 8872626bb4b8f5d9d06ea2b5e513e5ecb6a541aa (patch) | |
tree | 4f07bddb6d420f027b593cdb81dc7ba5f15f59de /vtysh/vtysh.c | |
parent | Merge pull request #2447 from ajones-rvbd/ajones-issue-2391 (diff) | |
download | frr-8872626bb4b8f5d9d06ea2b5e513e5ecb6a541aa.tar.xz frr-8872626bb4b8f5d9d06ea2b5e513e5ecb6a541aa.zip |
lib, vtysh: Add 'show thread poll' command
Add a 'show thread poll' command that displays the
poll information and fd's setup.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'vtysh/vtysh.c')
-rw-r--r-- | vtysh/vtysh.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index c6e060500..4ac744839 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2136,6 +2136,29 @@ DEFUNSH(VTYSH_INTERFACE, vtysh_quit_interface, vtysh_quit_interface_cmd, "quit", return vtysh_exit_interface(self, vty, argc, argv); } +DEFUN (vtysh_show_poll, + vtysh_show_poll_cmd, + "show thread poll", + SHOW_STR + "Thread information\n" + "Thread Poll Information\n") +{ + unsigned int i; + int idx = 0; + int ret = CMD_SUCCESS; + char line[100]; + + snprintf(line, sizeof(line), "do show thread poll\n"); + for (i = 0; i < array_size(vtysh_client); i++) + if (vtysh_client[i].fd >= 0) { + vty_out(vty, "Thread statistics for %s:\n", + vtysh_client[i].name); + ret = vtysh_client_execute(&vtysh_client[i], line); + vty_out(vty, "\n"); + } + return ret; +} + DEFUN (vtysh_show_thread, vtysh_show_thread_cmd, "show thread cpu [FILTER]", @@ -3720,6 +3743,7 @@ void vtysh_init_vty(void) install_element(VIEW_NODE, &vtysh_show_work_queues_cmd); install_element(VIEW_NODE, &vtysh_show_work_queues_daemon_cmd); install_element(VIEW_NODE, &vtysh_show_thread_cmd); + install_element(VIEW_NODE, &vtysh_show_poll_cmd); /* Logging */ install_element(VIEW_NODE, &vtysh_show_logging_cmd); |