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

Fix segmentation fault due tu previous commit

parent f9c04177
......@@ -263,9 +263,10 @@ static void do_tsn_task(struct thread_param *param, char *data, uint64_t next_tx
if (enable_histograms) {
rtt_us = param->stats.rtt / 1000;
if (rtt_us > MAX_HIST_VAL) {
if (rtt_us > MAX_HIST_VAL)
fprintf(stderr, "RTT value higher than MAX_HIST_VAL : %d ( > %d)\n", rtt_us, MAX_HIST_VAL);
}
else
histograms[0][rtt_us]++;
}
}
......
......@@ -173,14 +173,14 @@ static void fill_histograms(packet_info_t *packet_info, int64_t histograms[NB_HI
user_space_time /= 1000u;
kernel_space_time /= 1000u;
if (user_space_time > MAX_HIST_VAL) {
if (user_space_time > MAX_HIST_VAL)
fprintf(stderr, "user_space_time value too high: %" PRIu64 "us\n", user_space_time);
}
if (kernel_space_time > MAX_HIST_VAL) {
fprintf(stderr, "kernel_space_time value too high: %" PRIu64 "us\n", kernel_space_time);
}
else
histograms[0][user_space_time]++;
if (kernel_space_time > MAX_HIST_VAL)
fprintf(stderr, "kernel_space_time value too high: %" PRIu64 "us\n", kernel_space_time);
else
histograms[1][kernel_space_time]++;
}
......
......@@ -208,14 +208,14 @@ static void fill_histograms(packet_info_t *packet_info, int64_t histograms[NB_HI
user_space_time /= 1000u;
kernel_space_time /= 1000u;
if (user_space_time > MAX_HIST_VAL) {
if (user_space_time > MAX_HIST_VAL)
fprintf(stderr, "user_space_time value too high: %" PRIu64 "us\n", user_space_time);
}
if (kernel_space_time > MAX_HIST_VAL) {
fprintf(stderr, "kernel_space_time value too high: %" PRIu64 "us\n", kernel_space_time);
}
else
histograms[0][user_space_time]++;
if (kernel_space_time > MAX_HIST_VAL)
fprintf(stderr, "kernel_space_time value too high: %" PRIu64 "us\n", kernel_space_time);
else
histograms[1][kernel_space_time]++;
}
......
......@@ -157,6 +157,7 @@ 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)
fprintf(stderr, "jitter higher than MAX_HIST_VAL: %" PRIi64 "\n", dist_to_interval);
else
......
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