From 73c09bc4e9223208c89a337f8caa372b4a44d0a0 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 30 Aug 2019 11:12:20 +0200 Subject: [PATCH] Comment debug logs --- src/algo_thunder.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/algo_thunder.c b/src/algo_thunder.c index 40d273b..c483bb8 100644 --- a/src/algo_thunder.c +++ b/src/algo_thunder.c @@ -182,7 +182,7 @@ int is_in_order(struct thunder_ctx* thunderc, uint8_t link_id) { for (int i = 0; i < thunderc->total_links; i++) { uint64_t expected = link_id >= i ? ref : ref - 1; if (thunderc->received_pkts_on_link[i] > expected) { - printf("link_id=%d, i=%d, pkt_i=%ld, pkt_i_expected=%ld, pkt_link_id=%ld\n", link_id, i, thunderc->received_pkts_on_link[i], expected, ref); + //printf("link_id=%d, i=%d, pkt_i=%ld, pkt_i_expected=%ld, pkt_link_id=%ld\n", link_id, i, thunderc->received_pkts_on_link[i], expected, ref); return 0; } } @@ -210,7 +210,7 @@ void classify(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct b // 1. Update link info int link_id = url_get_port_int(fdinfo->url) - 7500; thunderc->received_pkts_on_link[link_id]++; - printf("Received %ld packets on link %d\n", thunderc->received_pkts_on_link[link_id], link_id); + //printf("Received %ld packets on link %d\n", thunderc->received_pkts_on_link[link_id], link_id); struct link_info *li = &ap->fmt.content.link_monitoring_thunder.links_status; uint64_t mili_sec = compute_delta (&thunderc->prev_rcv_link_time, UINT16_MAX); @@ -221,7 +221,7 @@ void classify(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct b // 2. Disable links that have received packets too late if (is_in_order (thunderc, link_id)) { - printf("Local: "); + /*printf("Local: "); for (int i = 0; i < thunderc->total_links; i++) { printf("%ld ", thunderc->rcv_delta_t_per_link[i]); } @@ -230,7 +230,7 @@ void classify(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct b for (int i = 0; i < thunderc->total_links; i++) { printf("%d ", li[i].delta_t); } - printf("\n"); + printf("\n");*/ for (int i = 0; i < thunderc->total_links; i++) { if (ALLOWED_JITTER_MS >= li[i].delta_t) continue; @@ -239,7 +239,7 @@ void classify(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct b struct block_info *bi = malloc(sizeof(struct block_info)); bi->i = i; bi->app_ctx = app_ctx; bi->missing = thunderc->received_pkts_on_link[i]+1; - printf(" Packet Too Late - Blocked link %d (expected: at least %dms ago, received: %ldms ago)\n", i, li[i].delta_t - ALLOWED_JITTER_MS, thunderc->rcv_delta_t_per_link[i]); + //printf(" Packet Too Late - Blocked link %d (expected: at least %dms ago, received: %ldms ago)\n", i, li[i].delta_t - ALLOWED_JITTER_MS, thunderc->rcv_delta_t_per_link[i]); on_block(ctx, bi); } } @@ -256,12 +256,12 @@ void classify(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct b if (timeout <= 0) { on_block(ctx, bi); - printf(" Missing Packet - Blocked link %d (expected: %ld, seen: %ld)\n", i, expected, thunderc->received_pkts_on_link[i]); + //printf(" Missing Packet - Blocked link %d (expected: %ld, seen: %ld)\n", i, expected, thunderc->received_pkts_on_link[i]); continue; } set_timeout (ctx, timeout, bi, on_block); - printf(" Missing Packet - Triggered timeout for link %d in %ldms (expected: %ld, seen: %ld)\n", i, timeout, expected, thunderc->received_pkts_on_link[i]); + //printf(" Missing Packet - Triggered timeout for link %d in %ldms (expected: %ld, seen: %ld)\n", i, timeout, expected, thunderc->received_pkts_on_link[i]); if (ctx->verbose > 1) { fprintf(stderr, " [algo_thunder] Set timeout on link %d of %ld ms (packets expected: %ld, seen: %ld)\n", i, timeout, expected, thunderc->received_pkts_on_link[i]);