From 684ce94729d68e84fd7ab6067998781fdc891358 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 11 Jun 2020 16:12:42 +0200 Subject: Track cqe and sqe usage --- uring.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'uring.c') diff --git a/uring.c b/uring.c index 78a084a..9075327 100644 --- a/uring.c +++ b/uring.c @@ -16,6 +16,9 @@ struct uring_ev { struct uring_task task; }; +uint64_t sqe_count = 0; +uint64_t cqe_count = 0; + static struct io_uring_sqe * get_sqe(struct cfg *cfg, struct uring_task *task) { @@ -32,6 +35,7 @@ get_sqe(struct cfg *cfg, struct uring_task *task) perrordie("Failed to get an sqe!\n"); } + sqe_count++; uring_task_get(cfg, task); return sqe; } @@ -548,6 +552,8 @@ uring_event_loop(struct cfg *cfg) struct uring_task *task = io_uring_cqe_get_data(cqe); bool do_callback; + cqe_count++; + if (!task) die("%s: null task\n", __func__); -- cgit v1.2.3