0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00

Loops track also locking time

This commit is contained in:
Maria Matejka 2023-04-26 19:34:29 +02:00
parent 2ddb34c9d1
commit ab83bab9d1
2 changed files with 7 additions and 4 deletions

View File

@ -974,10 +974,10 @@ bird_thread_show(void *data)
(cs - i > fs) ? 0 : loop->time_by_sec_ns[(cs - i) % TIME_BY_SEC_SIZE]);
bptr[-1] = 0; /* Drop the trailing space */
cli_printf(tsd->cli, -1026, " Loop %s total time: %t",
domain_name(loop->time.domain), loop->total_time_spent_ns NS);
cli_printf(tsd->cli, -1026, " last %d secs [ns]: %s",
MIN(CURRENT_SEC+1, TIME_BY_SEC_SIZE), b);
cli_printf(tsd->cli, -1026, " Loop %s", domain_name(loop->time.domain));
cli_printf(tsd->cli, -1026, " Total time: %t s", loop->total_time_spent_ns NS);
cli_printf(tsd->cli, -1026, " Total locking time: %t s", loop->total_time_locking_ns NS);
cli_printf(tsd->cli, -1026, " Last %d secs [ns]: %s", MIN(CURRENT_SEC+1, TIME_BY_SEC_SIZE), b);
}
total_time_ns += loop->total_time_spent_ns;
@ -1183,6 +1183,8 @@ birdloop_run(void *_loop)
if (locked_time > end_time)
LOOP_WARN(loop, "locked %luns after its scheduled end time", locked_time - end_time);
loop->total_time_locking_ns += (locked_time - start_time);
uint repeat, loop_runs = 0;
do {
repeat = 0;

View File

@ -69,6 +69,7 @@ struct birdloop
u64 time_by_sec_ns[TIME_BY_SEC_SIZE];
u64 last_time_finished_ns;
u64 total_time_spent_ns;
u64 total_time_locking_ns;
};
struct bird_thread