From 5bb6e86e0747ce57ab2033d1b878c49d0035dc00 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 11 Jun 2020 00:24:14 +0200 Subject: Slightly less log spam --- uring.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'uring.c') diff --git a/uring.c b/uring.c index e6b232e..a2668b0 100644 --- a/uring.c +++ b/uring.c @@ -95,8 +95,10 @@ uring_task_put(struct cfg *cfg, struct uring_task *task) { struct uring_task *parent = task->parent; + /* fprintf(stderr, "%s: called with task %s (0x%p) and refcount %u\n", __func__, task->name, task, task->refcount); + */ task->refcount--; if (task->refcount > 0) @@ -125,8 +127,10 @@ uring_task_put(struct cfg *cfg, struct uring_task *task) void uring_task_get(struct cfg *cfg, struct uring_task *task) { + /* fprintf(stderr, "%s: called with task %s (0x%p) and refcount %u\n", __func__, task->name, task, task->refcount); + */ if (task->refcount < 0) error("Negative refcount!\n"); @@ -143,6 +147,8 @@ uring_task_set_buf(struct uring_task *task, struct uring_task_buf *tbuf) void uring_task_set_fd(struct uring_task *task, int fd) { + fprintf(stderr, "%s: task %s (%p) now uses fd %i\n", + __func__, task->name, task, fd); task->fd = fd; } @@ -539,7 +545,9 @@ uring_event_loop(struct cfg *cfg) io_uring_for_each_cqe(&cfg->uev->uring, head, cqe) { struct uring_task *task = io_uring_cqe_get_data(cqe); - fprintf(stderr, "%s: got CEQ (res: %i, task: 0x%p, cb: 0x%p)\n", __func__, cqe->res, task, task ? task->callback : NULL); + fprintf(stderr, "%s: got CEQ (res: %i, task: %s (%p), cb: %p)\n", + __func__, cqe->res, task ? task->name : "", + task, task ? task->callback : NULL); if (task && task->callback) task->callback(cfg, task, cqe->res); @@ -553,7 +561,7 @@ uring_event_loop(struct cfg *cfg) nr++; } - printf("%s: %u CQEs treated\n", __func__, nr); + //printf("%s: %u CQEs treated\n", __func__, nr); io_uring_cq_advance(&cfg->uev->uring, nr); } } -- cgit v1.2.3