diff options
author | ajs <ajs> | 2005-04-16 17:11:24 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-04-16 17:11:24 +0000 |
commit | 924b9229717b749e303f3fb161616bebf53b5cdc (patch) | |
tree | 4788cd7cdc18bfc1cd12916ba506c091e9d73fb8 /lib/thread.h | |
parent | dc830cbfac8dd9633e070550359a5d6f8dac8fe5 (diff) |
2005-04-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* configure.ac: Added AC_ARG_ENABLE(time-check). By default,
warning messages will now be printed for threads or commands that take
longer than 5 seconds, but this configure argument can be used
to disable the checks or change the threshold.
* thread.h (thread_consumed_time): Declare new function to calculate
elapsed microseconds.
* thread.c (thread_consumed_time): Must be global not static so we
can call it from lib/vty.c:vty_command.
(thread_should_yield): Surround with `#if 0' to make clear that this
function is not currently being used anywhere.
(thread_call): If CONSUMED_TIME_CHECK is defined, print a CPU HOG
warning message if the thread takes more than CONSUMED_TIME_CHECK
microseconds.
* vty.c (vty_command): If CONSUMED_TIME_CHECK is defined, print a CPU
HOG warning message if the command takes more than CONSUMED_TIME_CHECK
microseconds.
Diffstat (limited to 'lib/thread.h')
-rw-r--r-- | lib/thread.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/thread.h b/lib/thread.h index 716a6a6c..4008ba72 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -158,4 +158,6 @@ unsigned long thread_timer_remain_second (struct thread *); extern struct cmd_element show_thread_cpu_cmd; +extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before); + #endif /* _ZEBRA_THREAD_H */ |