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

WIP

parent 1d1b8e4e
......@@ -47,6 +47,7 @@ static void *timerthread(void *p) {
struct timespec previous, current;
struct sched_param priority;
uint64_t diff;
char time_measured_string[255];
thread_param_t *param = (thread_param_t *)p;
thread_stat_t *stat = &param->stat;
......@@ -72,15 +73,23 @@ static void *timerthread(void *p) {
clock_gettime(CLOCK_ID, &current);
if(param->enable_tracing)
tracemark("Time measure end\n");
tracemark("Time measure end");
diff = calcdiff_ns(current, previous);
sprintf(time_measured_string, "Diff measured: %" PRIu64 "\n", diff);
if(param->enable_tracing)
tracemark(time_measured_string);
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);
if( param->enable_tracing && (diff > param->latency_threshold) ) break;
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