Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
d3329410
Commit
d3329410
authored
Aug 10, 2016
by
Jeroen Vreeken
Browse files
Introduce display interval to enable tracing at high frequencies.
parent
a9121c8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/trace/trace_view.c
View file @
d3329410
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment