Commit 059bcc69 authored by Joanne Hugé's avatar Joanne Hugé

WIP

parent cd3e853f
......@@ -65,31 +65,26 @@ static void *timerthread(void *p) {
for (stat->nb_cycles = 0;; stat->nb_cycles++) {
if (param->max_cycles && (stat->nb_cycles >= param->max_cycles)) break;
if (param->enable_tracing) tracemark("Time measure start\n");
clock_gettime(CLOCK_ID, &previous);
clock_gettime(CLOCK_ID, &current);
if (param->enable_tracing) tracemark("Time measure end");
diff = calcdiff_ns(current, previous);
sprintf(time_measured_string,
"Diff measured: %" PRIu64
", Current (%ld, %ld), Previous (%ld, %ld)\n",
diff, current.tv_sec, current.tv_nsec, previous.tv_sec,
previous.tv_nsec);
if (param->enable_tracing && (diff > param->latency_threshold)) {
if (param->enable_tracing) tracemark(time_measured_string);
sprintf(time_measured_string, "Diff measured: %" PRIu64 "\n", diff);
tracemark(time_measured_string);
tracing(0);
stat->max_res = max(stat->max_res, diff);
stat->min_res = min(stat->min_res, diff);
stat->max_res = max(stat->max_res, diff);
stat->min_res = min(stat->min_res, diff);
if (param->enable_tracing && (diff > param->latency_threshold)) {
tracing(0);
break;
}
stat->max_res = max(stat->max_res, diff);
stat->min_res = min(stat->min_res, diff);
usleep(param->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