diff options
author | Maria Matejka <mq@ucw.cz> | 2023-04-26 22:24:42 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-05-03 21:30:29 +0200 |
commit | 9c2231061212c24de1466b235486c4ee0ec8dc0f (patch) | |
tree | 4bdb9407409b919ec198a4e42b5440bce5ac5408 /sysdep/unix/io-loop.h | |
parent | ab83bab9d1c51e4102f6626430e0e1b2b7f1e53a (diff) |
Loop spent time refactored to separate structures and functions
Diffstat (limited to 'sysdep/unix/io-loop.h')
-rw-r--r-- | sysdep/unix/io-loop.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sysdep/unix/io-loop.h b/sysdep/unix/io-loop.h index d60b5206..9b0efb6c 100644 --- a/sysdep/unix/io-loop.h +++ b/sysdep/unix/io-loop.h @@ -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 |