From: Christian Franke Date: Wed, 24 Oct 2018 03:38:53 +0000 (+0200) Subject: isisd: Log LSP-update trigger source X-Git-Tag: frr-7.1-dev~247^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=691f3e768a6f6732a5ceace4a7e8b87625c0ec11;p=matthieu%2Ffrr.git 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 --- diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 558bc4276b..8320ad9d75 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -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; diff --git a/isisd/isis_lsp.h b/isisd/isis_lsp.h index 4beee10081..209a80ee70 100644 --- a/isisd/isis_lsp.h +++ b/isisd/isis_lsp.h @@ -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);