Commit 8bcb5fb1 authored by Ondrej Zajicek's avatar Ondrej Zajicek
Browse files

Implement latency tracking, internal event log and watchdog

parent 4e639744
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ struct config {
  u32 gr_wait;				/* Graceful restart wait timeout */

  int cli_debug;			/* Tracing of CLI connections and commands */
  int latency_debug;			/* I/O loop tracks duration of each event */
  u32 latency_limit;			/* Events with longer duration are logged (us) */
  u32 watchdog_warning;			/* I/O loop watchdog limit for warning (us) */
  u32 watchdog_timeout;			/* Watchdog timeout (in seconds, 0 = disabled) */
  char *err_msg;			/* Parser error message */
  int err_lino;				/* Line containing error */
  char *err_file_name;			/* File name containing error */
+7 −3
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@
# Turn on global debugging of all protocols
#debug protocols all;

# Turn on internal watchdog
#watchdog warning 5 s;
#watchdog timeout 30 s;

# The direct protocol automatically generates device routes to
# all network interfaces. Can exist in as many instances as you wish
# if you want to populate multiple routing tables with device routes.
+17 −0
Original line number Diff line number Diff line
@@ -344,6 +344,23 @@ protocol rip {
	of connects and disconnects, 2 and higher for logging of all client
	commands). Default: 0.

	<tag>debug latency <m/switch/</tag>
	Activate tracking of elapsed time for internal events. Recent events
	could be examined using <cf/dump events/ command. Default: off.

	<tag>debug latency limit <m/time/</tag>
	If <cf/debug latency/ is enabled, this option allows to specify a limit
	for elapsed time. Events exceeding the limit are logged. Default: 1 s.

	<tag>watchdog warning <m/time/</tag>
	Set time limit for I/O loop cycle. If one iteration took more time to
	complete, a warning is logged. Default: 5 s.

	<tag>watchdog timeout <m/time/</tag>
	Set time limit for I/O loop cycle. If the limit is breached, BIRD is
	killed by abort signal. The timeout has effective granularity of
	seconds, zero means disabled. Default: disabled (0).

	<tag>mrtdump "<m/filename/"</tag>
	Set MRTdump file name. This option must be specified to allow MRTdump
	feature. Default: no dump file.
+7 −0
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ ev_schedule(event *e)
  ev_enqueue(&global_event_list, e);
}

void io_log_event(void *hook, void *data);

/**
 * ev_run_list - run an event list
 * @l: an event list
@@ -132,6 +134,11 @@ ev_run_list(event_list *l)
  WALK_LIST_FIRST(n, tmp_list)
    {
      event *e = SKIP_BACK(event, n, n);

      /* This is ugly hack, we want to log just events executed from the main I/O loop */
      if (l == &global_event_list)
	io_log_event(e->hook, e->data);

      ev_run(e);
    }
  return !EMPTY_LIST(*l);
+2 −0
Original line number Diff line number Diff line
@@ -621,6 +621,8 @@ CF_CLI(DUMP RESOURCES,,, [[Dump all allocated resource]])
{ rdump(&root_pool); cli_msg(0, ""); } ;
CF_CLI(DUMP SOCKETS,,, [[Dump open sockets]])
{ sk_dump_all(); cli_msg(0, ""); } ;
CF_CLI(DUMP EVENTS,,, [[Dump event log]])
{ io_log_dump(); cli_msg(0, ""); } ;
CF_CLI(DUMP INTERFACES,,, [[Dump interface information]])
{ if_dump_all(); cli_msg(0, ""); } ;
CF_CLI(DUMP NEIGHBORS,,, [[Dump neighbor cache]])
Loading