See <ref id="channel-debug" name="debug"> in the channel section.
Default: off.
+ <tag><label id="opt-debug-tables">debug tables all|off|{ states|routes|filters|events [, <m/.../] }</tag>
+ Set global defaults of table debugging options.
+ See <ref id="rtable-debug" name="debug"> in the table section.
+ Default: off.
+
<tag><label id="opt-debug-commands">debug commands <m/number/</tag>
Control logging of client connections (0 for no logging, 1 for logging
of connects and disconnects, 2 and higher for logging of all client
second one is the high threshold (when to pause). The higher is the
threshold, the more memory can get used. In most cases, the defaults
should work for you. Default: 128, 512.
+
+ <tag><label id="rtable-debug">debug all|off|{ states|routes|events [, <m/.../] }</tag>
+ Set table debugging options. Each table can write some trace messages
+ into log with category <cf/trace/. You can request <cf/all/ trace messages
+ or select some types: <cf/states/ for table state changes and auxiliary
+ processes, <cf/routes/ for auxiliary route notifications (next hop update,
+ flowspec revalidation) and <cf/events/ for more detailed auxiliary routine
+ debug. See also <ref id="channel-debug" name="channel debugging option">.
+ Default: off.
+
</descrip>
static inline struct rte_storage *rt_next_hop_update_rte(rtable *tab, net *n, rte *old);
static struct hostentry *rt_get_hostentry(rtable *tab, ip_addr a, ip_addr ll, rtable *dep);
+#define rt_trace(tab, level, fmt, args...) do {\
+ rtable *t = (tab); \
+ if (t->config->debug & (level)) \
+ log(L_TRACE "%s: " fmt, t->name, ##args); \
+} while (0)
+
static void
net_init_with_trie(struct fib *f, void *N)
{
{
rtable *tab = SKIP_BACK(rtable, exporter, e);
- if (config->table_debug)
- log(L_TRACE "%s: Export cleanup requested", tab->name);
+ rt_trace(tab, D_EVENTS, "Export cleanup requested");
if (tab->export_used)
return;
(tab->hcu_scheduled || tab->nhu_state) && rt_cork_check(tab->uncork_event)
)
{
- if (!tab->hcu_corked && !tab->nhu_corked && config->table_debug)
- log(L_TRACE "%s: Auxiliary routines corked", tab->name);
+ if (!tab->hcu_corked && !tab->nhu_corked)
+ rt_trace(tab, D_STATES, "Next hop updater corked");
tab->hcu_corked |= tab->hcu_scheduled;
tab->hcu_scheduled = 0;
tab->nhu_state |= tab->nhu_corked;
tab->nhu_corked = 0;
- if (config->table_debug)
- log(L_TRACE "%s: Auxiliary routines uncorked", tab->name);
+ rt_trace(tab, D_STATES, "Next hop updater uncorked");
ev_schedule(tab->rt_event);
}
struct rt_import_hook *ih;
node *n, *x;
- DBG("Pruning route table %s\n", tab->name);
+ rt_trace(tab, D_STATES, "Pruning");
#ifdef DEBUGGING
fib_check(&tab->fib);
#endif
tab->exporter.first = last_export_to_free ? rt_next_export_fast(last_export_to_free) : NULL;
- if (config->table_debug)
- log(L_TRACE "%s: Export cleanup, old exporter.first seq %lu, new %lu, min_seq %ld",
- tab->name,
+ rt_trace(tab, D_STATES, "Export cleanup, old exporter.first seq %lu, new %lu, min_seq %ld",
first ? first->seq : 0,
tab->exporter.first ? tab->exporter.first->seq : 0,
min_seq);
if (EMPTY_LIST(tab->exporter.pending))
{
- if (config->table_debug)
- log(L_TRACE "%s: Resetting export seq", tab->name);
+ rt_trace(tab, D_EVENTS, "Resetting export seq");
node *n;
WALK_LIST2(eh, n, tab->exporter.hooks, n)
c->max_settle_time = 20 S;
c->cork_threshold.low = 128;
c->cork_threshold.high = 512;
+ c->debug = new_config->table_debug;
add_tail(&new_config->tables, &c->n);
tab->cork_active = 0;
rt_cork_release();
- if (config->table_debug)
- log(L_TRACE "%s: Uncorked", tab->name);
+ rt_trace(tab, D_STATES, "Uncorked");
}
}
tab->cork_active = 1;
rt_cork_acquire();
- if (config->table_debug)
- log(L_TRACE "%s: Corked", tab->name);
+ rt_trace(tab, D_STATES, "Corked");
}
}