1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Loop spent time refactored to separate structures and functions

This commit is contained in:
Maria Matejka
2023-04-26 22:24:42 +02:00
parent ab83bab9d1
commit 9c22310612
2 changed files with 149 additions and 88 deletions

View File

@@ -29,9 +29,12 @@ void pipe_pollin(struct pipe *, struct pfd *);
void pipe_drain(struct pipe *);
void pipe_kick(struct pipe *);
struct total_time_since {
u64 total;
u64 since;
#define TIME_BY_SEC_SIZE 16
struct spent_time {
u64 total_ns;
u64 last_written_ns;
u64 by_sec_ns[TIME_BY_SEC_SIZE];
};
struct birdloop
@@ -66,10 +69,7 @@ struct birdloop
struct bird_thread *thread;
#define TIME_BY_SEC_SIZE 16
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 spent_time working, locking;
};
struct bird_thread
@@ -98,6 +98,8 @@ struct bird_thread
u64 max_latency_ns;
u64 max_loop_time_ns;
struct spent_time overhead;
};
#endif