From 9c2231061212c24de1466b235486c4ee0ec8dc0f Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 26 Apr 2023 22:24:42 +0200 Subject: Loop spent time refactored to separate structures and functions --- sysdep/unix/io-loop.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'sysdep/unix/io-loop.h') 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 -- cgit v1.2.3