isisd: Log LSP-update trigger source

For debugging the timing of LSP generation, it is useful to know
which event caused a regeneration to be scheduled. Therefore, add
this information to the debug log.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
This commit is contained in:
Christian Franke 2018-10-24 05:38:53 +02:00
parent d62db30d92
commit 691f3e768a
2 changed files with 13 additions and 4 deletions

View File

@ -1388,7 +1388,9 @@ static int lsp_l2_refresh(struct thread *thread)
return lsp_regenerate(area, IS_LEVEL_2);
}
int lsp_regenerate_schedule(struct isis_area *area, int level, int all_pseudo)
int _lsp_regenerate_schedule(struct isis_area *area, int level,
int all_pseudo, const char *func,
const char *file, int line)
{
struct isis_lsp *lsp;
uint8_t id[ISIS_SYS_ID_LEN + 2];
@ -1402,9 +1404,11 @@ int lsp_regenerate_schedule(struct isis_area *area, int level, int all_pseudo)
return ISIS_ERROR;
sched_debug(
"ISIS (%s): Scheduling regeneration of %s LSPs, %sincluding PSNs",
"ISIS (%s): Scheduling regeneration of %s LSPs, %sincluding PSNs"
" Caller: %s %s:%d",
area->area_tag, circuit_t2string(level),
all_pseudo ? "" : "not ");
all_pseudo ? "" : "not ",
func, file, line);
memcpy(id, isis->sysid, ISIS_SYS_ID_LEN);
LSP_PSEUDO_ID(id) = LSP_FRAGMENT(id) = 0;

View File

@ -54,7 +54,12 @@ void lsp_db_destroy(dict_t *lspdb);
int lsp_tick(struct thread *thread);
int lsp_generate(struct isis_area *area, int level);
int lsp_regenerate_schedule(struct isis_area *area, int level, int all_pseudo);
#define lsp_regenerate_schedule(area, level, all_pseudo) \
_lsp_regenerate_schedule((area), (level), (all_pseudo), \
__func__, __FILE__, __LINE__)
int _lsp_regenerate_schedule(struct isis_area *area, int level,
int all_pseudo, const char *func,
const char *file, int line);
int lsp_generate_pseudo(struct isis_circuit *circuit, int level);
int lsp_regenerate_schedule_pseudo(struct isis_circuit *circuit, int level);