Commit 9d9e8e0e authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Optimized schedules (don't create duplicate ones)

Small fixes to trace code.
parent 9634b339
......@@ -65,7 +65,11 @@ static void common_denom(struct timespec *common, struct timespec *int1, struct
i1 = int1->tv_sec * 1000000000 + int1->tv_nsec;
i2 = int2->tv_sec * 1000000000 + int2->tv_nsec;
b = base_interval.tv_sec * 1000000000 + base_interval.tv_nsec;
if (!b) {
memcpy(common, int1, sizeof(struct timespec));
return;
}
d1 = i1 / b;
d2 = i2 / b;
......
......@@ -325,8 +325,28 @@ int controller_block_sample_init(void)
// blocks[i]->name);
}
}
log_send(LOG_T_DEBUG, "Found %d calculate functions in %d blocks for subsample %d",
nr_calculates, nr_blocks, sub);
for (i = 0; i < sub; i++) {
for (j = 0; true; j++) {
if (!calculates[sub][j].block &&
!calculates[i][j].block) {
log_send(LOG_T_DEBUG,
"subsample %d is identical to subsample %d", sub, i);
free(calculates[sub]);
calculates[sub] = calculates[i];
i = sub;
break;
}
if (!calculates[sub][j].block ||
!calculates[i][j].block ||
calculates[sub][j].block != calculates[i][j].block) {
break;
}
}
}
if (i == sub)
log_send(LOG_T_DEBUG,
"Found %d calculate functions in %d blocks for subsample %d",
nr_calculates, nr_blocks, sub);
}
return 0;
......
......@@ -80,6 +80,10 @@ int main(int argc, char **argv)
goto err_init;
}
if (controller_time_process()) {
goto err_init;
}
controller_trace_server_start(CTRL_TRACE_PORT, 100);
/* Start command shell */
......@@ -97,10 +101,6 @@ int main(int argc, char **argv)
free(dot_filename);
/* Start 'sample' */
if (controller_time_process()) {
goto err_init;
}
if (controller_block_sample_init()) {
goto err_init;
......
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