mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
Disabling the old IO event logger as it doesn't run from worker loops anyway
This commit is contained in:
parent
03a87c4f7c
commit
8e7fef42bb
@ -269,8 +269,6 @@ ev_send(event_list *l, event *e)
|
|||||||
if (l->loop) birdloop_ping(l->loop);
|
if (l->loop) birdloop_ping(l->loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void io_log_event(void *hook, void *data, uint flag);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ev_run_list - run an event list
|
* ev_run_list - run an event list
|
||||||
* @l: an event list
|
* @l: an event list
|
||||||
@ -320,10 +318,6 @@ ev_run_list_limited(event_list *l, uint limit)
|
|||||||
if (!--limit)
|
if (!--limit)
|
||||||
return 1;
|
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);
|
edlog(l, e, NULL, 6, EDL_RUN_LIST);
|
||||||
/* Inactivate the event */
|
/* Inactivate the event */
|
||||||
event *next = atomic_load_explicit(&e->next, memory_order_relaxed);
|
event *next = atomic_load_explicit(&e->next, memory_order_relaxed);
|
||||||
|
@ -156,10 +156,8 @@ timers_init(struct timeloop *loop, pool *p)
|
|||||||
BUFFER_PUSH(loop->timers) = NULL;
|
BUFFER_PUSH(loop->timers) = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void io_log_event(void *hook, void *data, uint flag);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
timers_fire(struct timeloop *loop, int io_log)
|
timers_fire(struct timeloop *loop)
|
||||||
{
|
{
|
||||||
TLOCK_TIMER_ASSERT(loop);
|
TLOCK_TIMER_ASSERT(loop);
|
||||||
|
|
||||||
@ -189,10 +187,6 @@ timers_fire(struct timeloop *loop, int io_log)
|
|||||||
else
|
else
|
||||||
tm_stop(t);
|
tm_stop(t);
|
||||||
|
|
||||||
/* This is ugly hack, we want to log just timers executed from the main I/O loop */
|
|
||||||
if (io_log)
|
|
||||||
io_log_event(t->hook, t->data, DL_TIMERS);
|
|
||||||
|
|
||||||
t->hook(t);
|
t->hook(t);
|
||||||
tmp_flush();
|
tmp_flush();
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ void times_update(void);
|
|||||||
|
|
||||||
/* For I/O loop */
|
/* For I/O loop */
|
||||||
void timers_init(struct timeloop *loop, pool *p);
|
void timers_init(struct timeloop *loop, pool *p);
|
||||||
void timers_fire(struct timeloop *loop, int io_log);
|
void timers_fire(struct timeloop *loop);
|
||||||
|
|
||||||
/* For extra fine precision */
|
/* For extra fine precision */
|
||||||
u64 ns_now(void);
|
u64 ns_now(void);
|
||||||
|
@ -952,7 +952,7 @@ CF_CLI(DUMP RESOURCES,,, [[Dump all allocated resource]])
|
|||||||
CF_CLI(DUMP SOCKETS,,, [[Dump open sockets]])
|
CF_CLI(DUMP SOCKETS,,, [[Dump open sockets]])
|
||||||
{ sk_dump_all(); cli_msg(0, ""); } ;
|
{ sk_dump_all(); cli_msg(0, ""); } ;
|
||||||
CF_CLI(DUMP EVENTS,,, [[Dump event log]])
|
CF_CLI(DUMP EVENTS,,, [[Dump event log]])
|
||||||
{ io_log_dump(); cli_msg(0, ""); } ;
|
{ /* io_log_dump(); */ cli_msg(0, "Warning: this command did nothing, needs reimplementation"); } ;
|
||||||
CF_CLI(DUMP INTERFACES,,, [[Dump interface information]])
|
CF_CLI(DUMP INTERFACES,,, [[Dump interface information]])
|
||||||
{ if_dump_all(); cli_msg(0, ""); } ;
|
{ if_dump_all(); cli_msg(0, ""); } ;
|
||||||
CF_CLI(DUMP NEIGHBORS,,, [[Dump neighbor cache]])
|
CF_CLI(DUMP NEIGHBORS,,, [[Dump neighbor cache]])
|
||||||
|
@ -835,7 +835,7 @@ bird_thread_main(void *arg)
|
|||||||
int timeout;
|
int timeout;
|
||||||
|
|
||||||
/* Schedule all loops with timed out timers */
|
/* Schedule all loops with timed out timers */
|
||||||
timers_fire(&thr->meta->time, 0);
|
timers_fire(&thr->meta->time);
|
||||||
|
|
||||||
/* Pickup new loops */
|
/* Pickup new loops */
|
||||||
birdloop_take(thr->group);
|
birdloop_take(thr->group);
|
||||||
@ -1540,7 +1540,7 @@ birdloop_run(void *_loop)
|
|||||||
sockets_fire(loop, 0, 1);
|
sockets_fire(loop, 0, 1);
|
||||||
|
|
||||||
/* Run timers */
|
/* Run timers */
|
||||||
timers_fire(&loop->time, 0);
|
timers_fire(&loop->time);
|
||||||
|
|
||||||
/* Run events */
|
/* Run events */
|
||||||
repeat = ev_run_list(&loop->event_list);
|
repeat = ev_run_list(&loop->event_list);
|
||||||
|
@ -59,6 +59,12 @@
|
|||||||
this to gen small latencies */
|
this to gen small latencies */
|
||||||
#define MAX_RX_STEPS 4
|
#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
|
* Internal event log and watchdog
|
||||||
@ -150,13 +156,19 @@ io_log_dump(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static btime last_io_time, loop_time;
|
||||||
|
static int watchdog_active;
|
||||||
|
|
||||||
void
|
void
|
||||||
watchdog_sigalrm(int sig UNUSED)
|
watchdog_sigalrm(int sig UNUSED)
|
||||||
{
|
{
|
||||||
/* Update last_io_time and duration, but skip latency check */
|
/* Update last_io_time and duration, but skip latency check */
|
||||||
struct global_runtime *gr = atomic_load_explicit(&global_runtime, memory_order_relaxed);
|
struct global_runtime *gr = atomic_load_explicit(&global_runtime, memory_order_relaxed);
|
||||||
gr->latency_limit = 0xffffffff;
|
gr->latency_limit = 0xffffffff;
|
||||||
io_update_time();
|
|
||||||
|
last_io_time = current_time_now();
|
||||||
|
|
||||||
debug_safe("Watchdog timer timed out\n");
|
debug_safe("Watchdog timer timed out\n");
|
||||||
|
|
||||||
@ -167,18 +179,14 @@ watchdog_sigalrm(int sig UNUSED)
|
|||||||
static inline void
|
static inline void
|
||||||
watchdog_start1(void)
|
watchdog_start1(void)
|
||||||
{
|
{
|
||||||
io_update_time();
|
loop_time = last_io_time = current_time_now();
|
||||||
|
|
||||||
loop_time = last_io_time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
watchdog_start(void)
|
watchdog_start(void)
|
||||||
{
|
{
|
||||||
io_update_time();
|
loop_time = last_io_time = current_time_now();
|
||||||
|
// event_log_num = 0;
|
||||||
loop_time = last_io_time;
|
|
||||||
event_log_num = 0;
|
|
||||||
|
|
||||||
union bird_global_runtime *gr = BIRD_GLOBAL_RUNTIME;
|
union bird_global_runtime *gr = BIRD_GLOBAL_RUNTIME;
|
||||||
if (gr->watchdog_timeout)
|
if (gr->watchdog_timeout)
|
||||||
@ -191,7 +199,7 @@ watchdog_start(void)
|
|||||||
static inline void
|
static inline void
|
||||||
watchdog_stop(void)
|
watchdog_stop(void)
|
||||||
{
|
{
|
||||||
io_update_time();
|
last_io_time = current_time_now();
|
||||||
|
|
||||||
if (watchdog_active)
|
if (watchdog_active)
|
||||||
{
|
{
|
||||||
@ -201,9 +209,15 @@ watchdog_stop(void)
|
|||||||
|
|
||||||
btime duration = last_io_time - loop_time;
|
btime duration = last_io_time - loop_time;
|
||||||
union bird_global_runtime *gr = BIRD_GLOBAL_RUNTIME;
|
union bird_global_runtime *gr = BIRD_GLOBAL_RUNTIME;
|
||||||
|
/*
|
||||||
if (duration > gr->watchdog_warning)
|
if (duration > gr->watchdog_warning)
|
||||||
log(L_WARN "I/O loop cycle took %u.%03u ms for %d events",
|
log(L_WARN "I/O loop cycle took %u.%03u ms for %d events",
|
||||||
(uint) (duration TO_MS), (uint) (duration % 1000), event_log_num);
|
(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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -254,8 +268,8 @@ io_loop(void)
|
|||||||
ev_run_list(&global_event_list);
|
ev_run_list(&global_event_list);
|
||||||
ev_run_list_limited(&global_work_list, WORK_EVENTS_MAX);
|
ev_run_list_limited(&global_work_list, WORK_EVENTS_MAX);
|
||||||
ev_run_list(&main_birdloop.event_list);
|
ev_run_list(&main_birdloop.event_list);
|
||||||
timers_fire(&main_birdloop.time, 1);
|
timers_fire(&main_birdloop.time);
|
||||||
io_close_event();
|
// io_close_event();
|
||||||
|
|
||||||
events =
|
events =
|
||||||
!ev_list_empty(&global_event_list) ||
|
!ev_list_empty(&global_event_list) ||
|
||||||
@ -283,21 +297,21 @@ io_loop(void)
|
|||||||
|
|
||||||
if (async_config_flag)
|
if (async_config_flag)
|
||||||
{
|
{
|
||||||
io_log_event(async_config, NULL, DL_EVENTS);
|
// io_log_event(async_config, NULL, DL_EVENTS);
|
||||||
async_config();
|
async_config();
|
||||||
async_config_flag = 0;
|
async_config_flag = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (async_dump_flag)
|
if (async_dump_flag)
|
||||||
{
|
{
|
||||||
io_log_event(async_dump, NULL, DL_EVENTS);
|
// io_log_event(async_dump, NULL, DL_EVENTS);
|
||||||
async_dump();
|
async_dump();
|
||||||
async_dump_flag = 0;
|
async_dump_flag = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (async_shutdown_flag)
|
if (async_shutdown_flag)
|
||||||
{
|
{
|
||||||
io_log_event(async_shutdown, NULL, DL_EVENTS);
|
// io_log_event(async_shutdown, NULL, DL_EVENTS);
|
||||||
async_shutdown();
|
async_shutdown();
|
||||||
async_shutdown_flag = 0;
|
async_shutdown_flag = 0;
|
||||||
continue;
|
continue;
|
||||||
@ -344,7 +358,7 @@ io_loop(void)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
steps--;
|
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);
|
e = sk_read(s, pfd.pfd.data[s->index].revents);
|
||||||
}
|
}
|
||||||
while (e && (main_birdloop.sock_active == s) && s->rx_hook && steps);
|
while (e && (main_birdloop.sock_active == s) && s->rx_hook && steps);
|
||||||
@ -357,7 +371,7 @@ io_loop(void)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
steps--;
|
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);
|
e = sk_write(s);
|
||||||
}
|
}
|
||||||
while (e && (main_birdloop.sock_active == s) && steps);
|
while (e && (main_birdloop.sock_active == s) && steps);
|
||||||
@ -388,7 +402,7 @@ io_loop(void)
|
|||||||
if (!s->fast_rx && (pfd.pfd.data[s->index].revents & POLLIN) && s->rx_hook)
|
if (!s->fast_rx && (pfd.pfd.data[s->index].revents & POLLIN) && s->rx_hook)
|
||||||
{
|
{
|
||||||
count++;
|
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);
|
sk_read(s, pfd.pfd.data[s->index].revents);
|
||||||
if (s != main_birdloop.sock_active)
|
if (s != main_birdloop.sock_active)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user