Commit f9c04177 authored by Joanne Hugé's avatar Joanne Hugé

Don't exit when a value is higher than the maximum histogram value

parent 9612d1e6
......@@ -265,7 +265,6 @@ static void do_tsn_task(struct thread_param *param, char *data, uint64_t next_tx
rtt_us = param->stats.rtt / 1000;
if (rtt_us > MAX_HIST_VAL) {
fprintf(stderr, "RTT value higher than MAX_HIST_VAL : %d ( > %d)\n", rtt_us, MAX_HIST_VAL);
exit(EXIT_FAILURE);
}
histograms[0][rtt_us]++;
}
......
......@@ -175,11 +175,9 @@ static void fill_histograms(packet_info_t *packet_info, int64_t histograms[NB_HI
if (user_space_time > MAX_HIST_VAL) {
fprintf(stderr, "user_space_time value too high: %" PRIu64 "us\n", user_space_time);
exit(EXIT_FAILURE);
}
if (kernel_space_time > MAX_HIST_VAL) {
fprintf(stderr, "kernel_space_time value too high: %" PRIu64 "us\n", kernel_space_time);
exit(EXIT_FAILURE);
}
histograms[0][user_space_time]++;
......
......@@ -210,11 +210,9 @@ static void fill_histograms(packet_info_t *packet_info, int64_t histograms[NB_HI
if (user_space_time > MAX_HIST_VAL) {
fprintf(stderr, "user_space_time value too high: %" PRIu64 "us\n", user_space_time);
exit(EXIT_FAILURE);
}
if (kernel_space_time > MAX_HIST_VAL) {
fprintf(stderr, "kernel_space_time value too high: %" PRIu64 "us\n", kernel_space_time);
exit(EXIT_FAILURE);
}
histograms[0][user_space_time]++;
......
......@@ -157,12 +157,10 @@ static void *packet_receiving_thread(void *p) {
if (enable_histograms) {
dist_to_interval = (((int64_t)diff) - param->interval) / 1000;
dist_to_interval += MAX_HIST_VAL / 2;
if (dist_to_interval > ((int)MAX_HIST_VAL) || dist_to_interval < 0) {
if (dist_to_interval > ((int)MAX_HIST_VAL) || dist_to_interval < 0)
fprintf(stderr, "jitter higher than MAX_HIST_VAL: %" PRIi64 "\n", dist_to_interval);
exit(EXIT_FAILURE);
} else {
else
histograms[2][dist_to_interval]++;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment