diff --git a/src/fast_timer.c b/src/fast_timer.c index 53cb666..6ab5717 100644 --- a/src/fast_timer.c +++ b/src/fast_timer.c @@ -105,6 +105,7 @@ int fast_timer_modify(FastTimer *timer, FastTimerEntry *entry, if ((result=fast_timer_remove(timer, entry)) == 0) { fast_timer_add_ex(timer, entry, new_expires, true); } + return result; } return 0; diff --git a/src/ioevent.c b/src/ioevent.c index 4b11e18..44d5c04 100644 --- a/src/ioevent.c +++ b/src/ioevent.c @@ -45,8 +45,8 @@ int kqueue_ev_convert(int16_t event, uint16_t flags) } #endif -int ioevent_init(IOEventPoller *ioevent, const int size, - const int timeout_ms, const int extra_events) +int ioevent_init(IOEventPoller *ioevent, const char *service_name, + const int size, const int timeout_ms, const int extra_events) { #if IOEVENT_USE_URING int result; @@ -57,6 +57,7 @@ int ioevent_init(IOEventPoller *ioevent, const int size, ioevent->iterator.count = 0; #endif + ioevent->service_name = service_name; ioevent->size = size; ioevent->extra_events = extra_events; diff --git a/src/ioevent.h b/src/ioevent.h index b82efae..19a517f 100644 --- a/src/ioevent.h +++ b/src/ioevent.h @@ -73,6 +73,7 @@ int kqueue_ev_convert(int16_t event, uint16_t flags); #endif typedef struct ioevent_puller { + const char *service_name; int size; //max events (fd) int extra_events; #if IOEVENT_USE_URING @@ -156,8 +157,8 @@ typedef struct ioevent_puller { extern "C" { #endif -int ioevent_init(IOEventPoller *ioevent, const int size, - const int timeout_ms, const int extra_events); +int ioevent_init(IOEventPoller *ioevent, const char *service_name, + const int size, const int timeout_ms, const int extra_events); void ioevent_destroy(IOEventPoller *ioevent); int ioevent_attach(IOEventPoller *ioevent, const int fd, diff --git a/src/ioevent_loop.c b/src/ioevent_loop.c index 60a0a9d..e062029 100644 --- a/src/ioevent_loop.c +++ b/src/ioevent_loop.c @@ -48,14 +48,21 @@ static int ioevent_process(IOEventPoller *ioevent) if (ioevent->cqe->flags & IORING_CQE_F_NOTIF) { #ifdef IORING_NOTIF_USAGE_ZC_COPIED if (!ioevent->send_zc_logged) { + struct fast_task_info *task; + + task = (struct fast_task_info *)pEntry; ioevent->send_zc_logged = true; if (ioevent->cqe->res & IORING_NOTIF_USAGE_ZC_COPIED) { - logWarning("file: "__FILE__", line: %d, " - "io_uring send_zc: memory copy " - "instead of zero copy!", __LINE__); + logWarning("file: "__FILE__", line: %d, %s " + "client %s:%u, io_uring send_zc: memory " + "copy instead of zero copy!", __LINE__, + ioevent->service_name, task->client_ip, + task->port); } else { - logInfo("file: "__FILE__", line: %d, " - "io_uring send_zc: zero copy OK.", __LINE__); + logInfo("file: "__FILE__", line: %d, %s " + "client %s:%u, io_uring send_zc: zero " + "copy OK.", __LINE__, ioevent->service_name, + task->client_ip, task->port); } } #endif diff --git a/src/multi_socket_client.c b/src/multi_socket_client.c index e122278..b365f58 100644 --- a/src/multi_socket_client.c +++ b/src/multi_socket_client.c @@ -65,8 +65,8 @@ int fast_multi_sock_client_init_ex(FastMultiSockClient *client, return EINVAL; } - if ((result=ioevent_init(&client->ioevent, entry_count, - timeout_ms, 0)) != 0) + if ((result=ioevent_init(&client->ioevent, "client", + entry_count, timeout_ms, 0)) != 0) { logError("file: "__FILE__", line: %d, " "ioevent_init fail, errno: %d, error info: %s",