Add name parameter to uasync_set_timeout for timer identification in dumps
This commit is contained in:
1 parent
3c0b5f501a
commit
d74ab1c1c6
28 files changed
+102
-93
No files matched your search
+3
-3
@@ -158,7 +158,7 @@ static void dummynet_process_queue(struct dummynet* dn, int dir_idx) {
|
||||
if (sarg) {
|
||||
sarg->dn = dn;
|
||||
sarg->dir_idx = dir_idx;
|
||||
dir->shaper_timer = uasync_set_timeout(dn->ua, delay_tb, sarg, dummynet_shaper_callback);
|
||||
dir->shaper_timer = uasync_set_timeout(dn->ua, delay_tb, sarg, dummynet_shaper_callback, "dummynet_shaper");
|
||||
if (dir->shaper_timer) {
|
||||
dir->shaper_timer_set++;
|
||||
} else {
|
||||
@@ -270,7 +270,7 @@ static void dummynet_read_callback(socket_t sock, void* user_arg) {
|
||||
targ->dn = dn;
|
||||
targ->entry = entry;
|
||||
|
||||
void* timer = uasync_set_timeout(dn->ua, delay_tb, targ, dummynet_delay_callback);
|
||||
void* timer = uasync_set_timeout(dn->ua, delay_tb, targ, dummynet_delay_callback, "dummynet_delay");
|
||||
if (!timer) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_DUMMYNET, "Failed to set delay timer");
|
||||
dir->stats.dropped++;
|
||||
@@ -326,7 +326,7 @@ static void dummynet_delay_callback(void* user_arg) {
|
||||
if (sarg) {
|
||||
sarg->dn = dn;
|
||||
sarg->dir_idx = dir_idx;
|
||||
dir->shaper_timer = uasync_set_timeout(dn->ua, 0, sarg, dummynet_shaper_callback);
|
||||
dir->shaper_timer = uasync_set_timeout(dn->ua, 0, sarg, dummynet_shaper_callback, "dummynet_shaper0");
|
||||
} else {
|
||||
dir->shaper_pending = 0;
|
||||
}
|
||||
|
||||
+3
-3
@@ -606,7 +606,7 @@ static void ack_timeout_check(struct ETCP_CONN* etcp) {
|
||||
// shedule timer
|
||||
int64_t next_timeout=timeout - elapsed;
|
||||
if (next_timeout<0) next_timeout=0;
|
||||
etcp->retrans_timer = uasync_set_timeout(etcp->instance->ua, next_timeout+10, etcp, ack_timeout_cb);
|
||||
etcp->retrans_timer = uasync_set_timeout(etcp->instance->ua, next_timeout+10, etcp, ack_timeout_cb, "etcp_retrans");
|
||||
DEBUG_TRACE(DEBUG_CATEGORY_ETCP, "[%s] retransmission timer set for %llu units", etcp->log_name, next_timeout);
|
||||
return;
|
||||
}
|
||||
@@ -670,7 +670,7 @@ static void ack_response_timer_cb(void* arg) {// проверяем неотпр
|
||||
if (etcp->ack_q->count==0) return;// нечего отправлять
|
||||
etcp_conn_process_send_queue(etcp);// проталкиваем (она же должна отправлять только ack если больше ничего нет)
|
||||
// если ack все еще заняты - обновляем таймаут
|
||||
if (etcp->ack_q->count) etcp->ack_resp_timer = uasync_set_timeout(etcp->instance->ua, ACK_DELAY_TB, etcp, ack_response_timer_cb);
|
||||
if (etcp->ack_q->count) etcp->ack_resp_timer = uasync_set_timeout(etcp->instance->ua, ACK_DELAY_TB, etcp, ack_response_timer_cb, "etcp_ack_resp");
|
||||
// else etcp->ack_resp_timer=NULL;
|
||||
}
|
||||
|
||||
@@ -1152,7 +1152,7 @@ void etcp_conn_input(struct ETCP_DGRAM* pkt) {
|
||||
|
||||
queue_data_put_with_index(etcp->ack_q, (struct ll_entry*)p, 0, 4);
|
||||
if (etcp->ack_resp_timer == NULL) {
|
||||
etcp->ack_resp_timer = uasync_set_timeout(etcp->instance->ua, ACK_DELAY_TB, etcp, ack_response_timer_cb);
|
||||
etcp->ack_resp_timer = uasync_set_timeout(etcp->instance->ua, ACK_DELAY_TB, etcp, ack_response_timer_cb, "etcp_ack_resp");
|
||||
DEBUG_TRACE(DEBUG_CATEGORY_ETCP, "[%s] set ack_timer for delayed ACK send", etcp->log_name);
|
||||
}
|
||||
if (((int32_t)(etcp->last_delivered_id-seq)<0) && (queue_find_data_by_index(etcp->recv_q, &seq, 4)==NULL)) {// проверяем есть ли пакет с этим seq
|
||||
|
||||
@@ -144,7 +144,7 @@ static void etcp_link_init_timer_cbk(void* arg) {
|
||||
link->init_timeout += link->init_timeout/4 +1;
|
||||
if (link->init_timeout > INIT_TIMEOUT_MAX) link->init_timeout = INIT_TIMEOUT_MAX;
|
||||
}
|
||||
link->init_timer = uasync_set_timeout(link->etcp->instance->ua, link->init_timeout, link, etcp_link_init_timer_cbk);
|
||||
link->init_timer = uasync_set_timeout(link->etcp->instance->ua, link->init_timeout, link, etcp_link_init_timer_cbk, "link_init");
|
||||
|
||||
if (link->link_state == 1) etcp_link_send_init(link,1);// init (with etcp reset)
|
||||
else etcp_link_send_init(link,0);// no etcp reset (reinit)
|
||||
@@ -154,7 +154,7 @@ void etcp_link_restart_init_timer(struct ETCP_LINK* link) {
|
||||
DEBUG_TRACE(DEBUG_CATEGORY_CONNECTION, "");
|
||||
if (link->init_timer) uasync_cancel_timeout(link->etcp->instance->ua, link->init_timer);
|
||||
link->init_timeout = INIT_TIMEOUT_INITIAL;
|
||||
link->init_timer = uasync_set_timeout(link->etcp->instance->ua, link->init_timeout, link, etcp_link_init_timer_cbk);
|
||||
link->init_timer = uasync_set_timeout(link->etcp->instance->ua, link->init_timeout, link, etcp_link_init_timer_cbk, "link_init");
|
||||
}
|
||||
|
||||
void etcp_link_enter_init(struct ETCP_LINK* link) {//
|
||||
@@ -231,7 +231,7 @@ static void start_keepalive_timer(struct ETCP_LINK* link) {
|
||||
}
|
||||
|
||||
if (link->keepalive_timer == NULL) {
|
||||
link->keepalive_timer = uasync_set_timeout(link->etcp->instance->ua, link->keepalive_interval * 10, link, keepalive_timer_cb);
|
||||
link->keepalive_timer = uasync_set_timeout(link->etcp->instance->ua, link->keepalive_interval * 10, link, keepalive_timer_cb, "link_keepalive");
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_CONNECTION, "[%s] Keepalive timer started on link %p (interval=%d ms)", link->etcp->log_name, link, link->keepalive_interval);
|
||||
}
|
||||
}
|
||||
@@ -286,7 +286,7 @@ static void keepalive_timer_cb(void* arg) {
|
||||
link->pkt_sent_since_keepalive = 0;
|
||||
|
||||
restart_timer:
|
||||
link->keepalive_timer = uasync_set_timeout(link->etcp->instance->ua, link->keepalive_interval * 10, link, keepalive_timer_cb);
|
||||
link->keepalive_timer = uasync_set_timeout(link->etcp->instance->ua, link->keepalive_interval * 10, link, keepalive_timer_cb, "link_keepalive");
|
||||
}
|
||||
|
||||
static uint32_t sockaddr_hash(struct sockaddr_storage* addr) {
|
||||
@@ -766,7 +766,8 @@ void start_stats_timer(struct ETCP_LINK* link) {
|
||||
link->etcp->instance->ua,
|
||||
tb,
|
||||
link,
|
||||
link_stats_timer_cb
|
||||
link_stats_timer_cb,
|
||||
"link_stats"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1039,7 +1040,7 @@ int etcp_send_ping_to_socket(struct UTUN_INSTANCE* instance, struct ETCP_SOCKET*
|
||||
while (last->next) last = last->next;
|
||||
last->next = ctx;
|
||||
}
|
||||
ctx->timeout_timer = uasync_set_timeout(instance->ua, timeout_ms * 10, ctx, ping_timeout_cbk);
|
||||
ctx->timeout_timer = uasync_set_timeout(instance->ua, timeout_ms * 10, ctx, ping_timeout_cbk, "ping_timeout");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_BGP, "ping sent nonce=%016llx timeout=%d ulen=%zu",
|
||||
(unsigned long long)ctx->nonce, timeout_ms, user_data_len);
|
||||
return 0;
|
||||
|
||||
@@ -136,7 +136,7 @@ void etcp_loadbalancer_send(struct ETCP_DGRAM* dgram) {
|
||||
uint64_t now_tb=get_time_tb();
|
||||
if (link->shaper_load_time_tb >= now_tb + SHAPER_BURST_DELAY_TB) {
|
||||
uint64_t wait_tb = link->shaper_load_time_tb - now_tb;
|
||||
link->shaper_timer = uasync_set_timeout(link->etcp->instance->ua, wait_tb, link, shaper_timer_cb);
|
||||
link->shaper_timer = uasync_set_timeout(link->etcp->instance->ua, wait_tb, link, shaper_timer_cb, "shaper");
|
||||
if (link->shaper_timer == NULL) DEBUG_ERROR(DEBUG_CATEGORY_TIMERS, "Filed to allocate timer");
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "[%s] scheduled shaper timer (wait_tb=%llu) BW=%d pkt_size=%d", etcp->log_name, (unsigned long long)wait_tb, link->bandwidth, pkt_size);
|
||||
}
|
||||
|
||||
+2
-2
@@ -117,7 +117,7 @@ int route_ping_send_req(struct ROUTE_BGP* bgp, struct ETCP_CONN* to_conn, uint64
|
||||
pending->next = bgp->ping_pending;
|
||||
bgp->ping_pending = pending;
|
||||
|
||||
pending->timeout_timer = uasync_set_timeout(bgp->instance->ua, wait_timeout_ms * 10, pending, route_ping_pending_timeout);
|
||||
pending->timeout_timer = uasync_set_timeout(bgp->instance->ua, wait_timeout_ms * 10, pending, route_ping_pending_timeout, "route_ping");
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_BGP, "request_id=%016llx node=%016llx count=%u interval=%u timeout=%u wait=%u",
|
||||
(unsigned long long)pending->request_id, (unsigned long long)node_id,
|
||||
@@ -220,7 +220,7 @@ int route_ping_send_req_addr(struct ROUTE_BGP* bgp, struct ETCP_CONN* to_conn, u
|
||||
pending->next = bgp->ping_pending;
|
||||
bgp->ping_pending = pending;
|
||||
|
||||
pending->timeout_timer = uasync_set_timeout(bgp->instance->ua, wait_timeout_ms * 10, pending, route_ping_pending_timeout);
|
||||
pending->timeout_timer = uasync_set_timeout(bgp->instance->ua, wait_timeout_ms * 10, pending, route_ping_pending_timeout, "route_ping");
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_BGP, "request_id=%016llx node=%016llx ip=%s port=%u pubkey=%s",
|
||||
(unsigned long long)pending->request_id, (unsigned long long)node_id,
|
||||
|
||||
+1
-1
@@ -258,7 +258,7 @@ static void signal_handler(int sig) {
|
||||
|
||||
void test_tmr(void* arg) {
|
||||
struct UASYNC* ua = (struct UASYNC*)arg;
|
||||
uasync_set_timeout(ua, 10000, ua, test_tmr);
|
||||
uasync_set_timeout(ua, 10000, ua, test_tmr, "utun_test");
|
||||
// DEBUG_INFO(DEBUG_CATEGORY_ETCP, "tick ...");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user