Comment debug logs

This commit is contained in:
Quentin 2019-08-30 11:12:20 +02:00
parent f61148345e
commit 73c09bc4e9

View file

@ -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]);