summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 26be17585e..5dc296f2cc 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -278,7 +278,7 @@ cpu_record_print(struct vty *vty, thread_type filter)
vty_out(vty, "%21s %18s %18s%s",
"", "CPU (user+system):", "Real (wall-clock):", VTY_NEWLINE);
#endif
- vty_out(vty, " Runtime(ms) Invoked Avg uSec Max uSecs");
+ vty_out(vty, "Runtime(ms) Invoked Avg uSec Max uSecs");
#ifdef HAVE_RUSAGE
vty_out(vty, " Avg uSec Max uSecs");
#endif
@@ -299,15 +299,16 @@ DEFUN (show_thread_cpu,
"Thread CPU usage\n"
"Display filter (rwtexb)\n")
{
+ int idx_filter = 3;
int i = 0;
thread_type filter = (thread_type) -1U;
- if (argc > 0)
+ if (argc > 3)
{
filter = 0;
- while (argv[0][i] != '\0')
+ while (argv[idx_filter]->arg[i] != '\0')
{
- switch ( argv[0][i] )
+ switch ( argv[idx_filter]->arg[i] )
{
case 'r':
case 'R':
@@ -342,7 +343,7 @@ DEFUN (show_thread_cpu,
{
vty_out(vty, "Invalid filter \"%s\" specified,"
" must contain at least one of 'RWTEXB'%s",
- argv[0], VTY_NEWLINE);
+ argv[idx_filter]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
}
@@ -381,15 +382,16 @@ DEFUN (clear_thread_cpu,
"Thread CPU usage\n"
"Display filter (rwtexb)\n")
{
+ int idx_filter = 3;
int i = 0;
thread_type filter = (thread_type) -1U;
- if (argc > 0)
+ if (argc > 3)
{
filter = 0;
- while (argv[0][i] != '\0')
+ while (argv[idx_filter]->arg[i] != '\0')
{
- switch ( argv[0][i] )
+ switch ( argv[idx_filter]->arg[i] )
{
case 'r':
case 'R':
@@ -424,7 +426,7 @@ DEFUN (clear_thread_cpu,
{
vty_out(vty, "Invalid filter \"%s\" specified,"
" must contain at least one of 'RWTEXB'%s",
- argv[0], VTY_NEWLINE);
+ argv[idx_filter]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
}