diff options
Diffstat (limited to 'lib/thread.c')
| -rw-r--r-- | lib/thread.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/thread.c b/lib/thread.c index a128786c3d..26be17585e 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -32,6 +32,10 @@ #include "command.h" #include "sigevent.h" +DEFINE_MTYPE_STATIC(LIB, THREAD, "Thread") +DEFINE_MTYPE_STATIC(LIB, THREAD_MASTER, "Thread master") +DEFINE_MTYPE_STATIC(LIB, THREAD_STATS, "Thread stats") + #if defined(__APPLE__) #include <mach/mach.h> #include <mach/mach_time.h> @@ -218,12 +222,12 @@ vty_out_cpu_thread_history(struct vty* vty, struct cpu_thread_history *a) { #ifdef HAVE_RUSAGE - vty_out(vty, "%7ld.%03ld %9d %8ld %9ld %8ld %9ld", + vty_out(vty, "%10ld.%03ld %9d %8ld %9ld %8ld %9ld", a->cpu.total/1000, a->cpu.total%1000, a->total_calls, a->cpu.total/a->total_calls, a->cpu.max, a->real.total/a->total_calls, a->real.max); #else - vty_out(vty, "%7ld.%03ld %9d %8ld %9ld", + vty_out(vty, "%10ld.%03ld %9d %8ld %9ld", a->real.total/1000, a->real.total%1000, a->total_calls, a->real.total/a->total_calls, a->real.max); #endif @@ -274,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 @@ -287,13 +291,13 @@ cpu_record_print(struct vty *vty, thread_type filter) vty_out_cpu_thread_history(vty, &tmp); } -DEFUN(show_thread_cpu, - show_thread_cpu_cmd, - "show thread cpu [FILTER]", - SHOW_STR - "Thread information\n" - "Thread CPU usage\n" - "Display filter (rwtexb)\n") +DEFUN (show_thread_cpu, + show_thread_cpu_cmd, + "show thread cpu [FILTER]", + SHOW_STR + "Thread information\n" + "Thread CPU usage\n" + "Display filter (rwtexb)\n") { int i = 0; thread_type filter = (thread_type) -1U; @@ -369,13 +373,13 @@ cpu_record_clear (thread_type filter) tmp); } -DEFUN(clear_thread_cpu, - clear_thread_cpu_cmd, - "clear thread cpu [FILTER]", - "Clear stored data\n" - "Thread information\n" - "Thread CPU usage\n" - "Display filter (rwtexb)\n") +DEFUN (clear_thread_cpu, + clear_thread_cpu_cmd, + "clear thread cpu [FILTER]", + "Clear stored data\n" + "Thread information\n" + "Thread CPU usage\n" + "Display filter (rwtexb)\n") { int i = 0; thread_type filter = (thread_type) -1U; |
