Commit 82c1e2ba authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Don't send timestamps every second on traces with multi second intervals.

parent e3b97f36
......@@ -328,6 +328,11 @@ static void server_timestamp(struct trace *trace,
trace_packet_timestamp_set(pkt, timestamp);
for (i = 0; i < priv->nr_clients; i++) {
if (priv->clients[i]->interval_type ==
TRACE_INTERVAL_TYPE_INTERVAL &&
priv->clients[i]->interval.tv_sec &&
timestamp->tv_sec % priv->clients[i]->interval.tv_sec)
continue;
trace_packet_write(priv->clients[i], pkt);
if (check_client(priv, i)) {
server_interval_check(trace);
......
......@@ -205,6 +205,10 @@ static void *controller_trace_handle(void *arg)
t.tv_nsec = trace_hdl[i].nsec;
sendval = !timespec_mod(&t, &trace_hdl[i].trace.interval);
/* No need to send time every second if values are send
less than once a second */
if (&trace_hdl[i].trace.interval.tv_sec)
sendtime = sendval;
} else if (trace_hdl[i].type == TRACE_INTERVAL_TYPE_CHANGED) {
uint32_t bufval = 0;
uint32_t last = 0;
......
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