summaryrefslogtreecommitdiff
path: root/uring.c
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-11 00:24:14 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-11 00:24:14 +0200
commit5bb6e86e0747ce57ab2033d1b878c49d0035dc00 (patch)
tree8d6ecd34b5c75915cd055a8029dbc3f41f28ffc8 /uring.c
parent97d4714958663f2f463567664d8500984be6f704 (diff)
Slightly less log spam
Diffstat (limited to 'uring.c')
-rw-r--r--uring.c12
1 files changed, 10 insertions, 2 deletions
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 : "<none>",
+ 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);
}
}