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/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index fef6b16..31cbaae 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -2409,8 +2409,10 @@
ospf_refresher_register_lsa (ospf, new);
}
if (rt_recalc)
- ospf_spf_calculate_schedule (ospf);
-
+ {
+ ospf_flag_spf_reason (SPF_FLAG_ROUTER_LSA_INSTALL);
+ ospf_spf_calculate_schedule (ospf);
+ }
return new;
}
@@ -2444,7 +2446,10 @@
ospf_refresher_register_lsa (ospf, new);
}
if (rt_recalc)
- ospf_spf_calculate_schedule (ospf);
+ {
+ ospf_flag_spf_reason (SPF_FLAG_NETWORK_LSA_INSTALL);
+ ospf_spf_calculate_schedule (ospf);
+ }
return new;
}
@@ -2467,11 +2472,10 @@
/* This doesn't exist yet... */
ospf_summary_incremental_update(new); */
#else /* #if 0 */
+ ospf_flag_spf_reason (SPF_FLAG_SUMMARY_LSA_INSTALL);
ospf_spf_calculate_schedule (ospf);
#endif /* #if 0 */
- if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
- zlog_debug ("ospf_summary_lsa_install(): SPF scheduled");
}
if (IS_LSA_SELF (new))
@@ -2500,6 +2504,7 @@
- RFC 2328 Section 16.5 implies it should be */
/* ospf_ase_calculate_schedule(); */
#else /* #if 0 */
+ ospf_flag_spf_reason (SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL);
ospf_spf_calculate_schedule (ospf);
#endif /* #if 0 */
}
@@ -3022,6 +3027,7 @@
ospf_ase_incremental_update (ospf, lsa);
break;
default:
+ ospf_flag_spf_reason (SPF_FLAG_MAXAGE);
ospf_spf_calculate_schedule (ospf);
break;
}