if (l->loop) birdloop_ping(l->loop);
}
-void io_log_event(void *hook, void *data, uint flag);
-
/**
* ev_run_list - run an event list
* @l: an event list
if (!--limit)
return 1;
- /* This is ugly hack, we want to log just events executed from the main I/O loop */
- if ((l == &global_event_list) || (l == &global_work_list))
- io_log_event(e->hook, e->data, DL_EVENTS);
-
edlog(l, e, NULL, 6, EDL_RUN_LIST);
/* Inactivate the event */
event *next = atomic_load_explicit(&e->next, memory_order_relaxed);
CF_CLI(DUMP SOCKETS, text,, [[Dump open sockets]])
{ cmd_dump_file(this_cli, $3, "sockets", sk_dump_all); } ;
CF_CLI(DUMP EVENTS, text,, [[Dump event log]])
-{ cmd_dump_file(this_cli, $3, "event log", io_log_dump); } ;
+{ /* cmd_dump_file(this_cli, $3, "event log", io_log_dump); */ cli_msg(0, "Warning: this command did nothing and we still need to figure out how to reimplement it properly."); } ;
CF_CLI(DUMP INTERFACES, text,, [[Dump interface information]])
{ cmd_dump_file(this_cli, $3, "interfaces", if_dump_all); } ;
CF_CLI(DUMP NEIGHBORS, text,, [[Dump neighbor cache]])
this to gen small latencies */
#define MAX_RX_STEPS 4
+#if 0
+/**********
+ * Internal event log for the mainloop only makes no sense.
+ * To be replaced by a lockless event log keeping much more information
+ * about all the logs throughout all the threads.
+ */
/*
* Internal event log and watchdog
}
}
+#endif
+
+static btime last_io_time, loop_time;
+static int watchdog_active;
+
void
watchdog_sigalrm(int sig UNUSED)
{
/* Update last_io_time and duration, but skip latency check */
struct global_runtime *gr = atomic_load_explicit(&global_runtime, memory_order_relaxed);
gr->latency_limit = 0xffffffff;
- io_update_time();
+
+ last_io_time = current_time_now();
debug_safe("Watchdog timer timed out\n");
static inline void
watchdog_start1(void)
{
- io_update_time();
-
- loop_time = last_io_time;
+ loop_time = last_io_time = current_time_now();
}
static inline void
watchdog_start(void)
{
- io_update_time();
-
- loop_time = last_io_time;
- event_log_num = 0;
+ loop_time = last_io_time = current_time_now();
+// event_log_num = 0;
union bird_global_runtime *gr = BIRD_GLOBAL_RUNTIME;
if (gr->watchdog_timeout)
static inline void
watchdog_stop(void)
{
- io_update_time();
+ last_io_time = current_time_now();
if (watchdog_active)
{
btime duration = last_io_time - loop_time;
union bird_global_runtime *gr = BIRD_GLOBAL_RUNTIME;
+ /*
if (duration > gr->watchdog_warning)
log(L_WARN "I/O loop cycle took %u.%03u ms for %d events",
(uint) (duration TO_MS), (uint) (duration % 1000), event_log_num);
+ */
+
+ if (duration > gr->watchdog_warning)
+ log(L_WARN "I/O loop cycle took %u.%03u ms",
+ (uint) (duration TO_MS), (uint) (duration % 1000));
}
ev_run_list(&global_event_list);
ev_run_list_limited(&global_work_list, WORK_EVENTS_MAX);
ev_run_list(&main_birdloop.event_list);
- timers_fire(&main_birdloop.time, 1);
- io_close_event();
+ timers_fire(&main_birdloop.time);
+// io_close_event();
events =
!ev_list_empty(&global_event_list) ||
if (async_config_flag)
{
- io_log_event(async_config, NULL, DL_EVENTS);
+// io_log_event(async_config, NULL, DL_EVENTS);
async_config();
async_config_flag = 0;
continue;
}
if (async_dump_flag)
{
- io_log_event(async_dump, NULL, DL_EVENTS);
+// io_log_event(async_dump, NULL, DL_EVENTS);
async_dump();
async_dump_flag = 0;
continue;
}
if (async_shutdown_flag)
{
- io_log_event(async_shutdown, NULL, DL_EVENTS);
+// io_log_event(async_shutdown, NULL, DL_EVENTS);
async_shutdown();
async_shutdown_flag = 0;
continue;
do
{
steps--;
- io_log_event(s->rx_hook, s->data, DL_SOCKETS);
+// io_log_event(s->rx_hook, s->data, DL_SOCKETS);
e = sk_read(s, pfd.pfd.data[s->index].revents);
}
while (e && (main_birdloop.sock_active == s) && s->rx_hook && steps);
do
{
steps--;
- io_log_event(s->tx_hook, s->data, DL_SOCKETS);
+// io_log_event(s->tx_hook, s->data, DL_SOCKETS);
e = sk_write(s);
}
while (e && (main_birdloop.sock_active == s) && steps);
if (!s->fast_rx && (pfd.pfd.data[s->index].revents & POLLIN) && s->rx_hook)
{
count++;
- io_log_event(s->rx_hook, s->data, DL_SOCKETS);
+// io_log_event(s->rx_hook, s->data, DL_SOCKETS);
sk_read(s, pfd.pfd.data[s->index].revents);
if (s != main_birdloop.sock_active)
continue;