Compute and display SPF execution statistics
Detailed SPF statistics, all around time spent executing various pieces of SPF
such as the SPF algorithm itself, installing routes, pruning unreachable networks
etc.
Reason codes for firing up SPF are:
R - Router LSA, N - Network LSA, S - Summary LSA, ABR - ABR status change,
ASBR - ASBR Status Change, AS - ASBR Summary, M - MaxAge
Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Paul Jakma <paul@opensourcerouting.org>
diff --git a/lib/thread.c b/lib/thread.c
index 9c3ee82..cb51332 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -102,7 +102,7 @@
? a.tv_usec - b.tv_usec : a.tv_sec - b.tv_sec);
}
-static unsigned long
+unsigned long
timeval_elapsed (struct timeval a, struct timeval b)
{
return (((a.tv_sec - b.tv_sec) * TIMER_SECOND_MICRO)
diff --git a/lib/thread.h b/lib/thread.h
index 9743a22..4856dec 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -211,6 +211,7 @@
extern void thread_call (struct thread *);
extern unsigned long thread_timer_remain_second (struct thread *);
extern int thread_should_yield (struct thread *);
+extern unsigned long timeval_elapsed (struct timeval a, struct timeval b);
/* Internal libzebra exports */
extern void thread_getrusage (RUSAGE_T *);