Commit d3329410 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Introduce display interval to enable tracing at high frequencies.

parent a9121c8a
......@@ -198,6 +198,7 @@ int main(int argc, char **argv)
double interval, history;
char *host;
int trace_nr, i, port, ret = 0;
int display_interval = 1;
starttime = time(NULL);
host = "localhost";
......@@ -326,6 +327,13 @@ int main(int argc, char **argv)
if (traces[i].value == NULL)
errx(1, "out of memory!");
}
double tmp_interval = interval;
while (tmp_interval < 0.2) {
tmp_interval *= 2;
display_interval *=2;
}
printf("Setting display interval %d\n", display_interval);
fdplot = popen("gnuplot -noraise", "w");
if (fdplot == NULL) {
......@@ -338,6 +346,7 @@ int main(int argc, char **argv)
samp_min = +INFINITY;
samp_max = -INFINITY;
int display_cnt = 0;
do {
fd_set fdrx;
......@@ -356,7 +365,11 @@ int main(int argc, char **argv)
}
if (doplot >= trace_nr) {
plot_values(traces, trace_nr);
display_cnt++;
if (display_cnt == display_interval) {
plot_values(traces, trace_nr);
display_cnt = 0;
}
doplot = 0;
samp_min = +INFINITY;
......
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