Commit 8538dc65 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Fix sending of multiple values at once.

parent 11d9a98c
......@@ -159,9 +159,12 @@ static void *controller_trace_handle(void *arg)
if (rd_pos >= wr_pos)
len = trace_hdl[i].ctrace.len - rd_pos;
else
else {
len = wr_pos - rd_pos;
if (len < 2)
continue;
}
pkt = trace_packet_new();
for (j = 0; j < len; j++) {
......@@ -170,10 +173,12 @@ static void *controller_trace_handle(void *arg)
if (pos == trace_hdl[i].ctrace.timestamp_pos) {
struct timespec t;
trace_packet_write(&trace_hdl[i].trace, pkt);
trace_packet_put(pkt);
if (pkt->len) {
trace_packet_write(&trace_hdl[i].trace, pkt);
trace_packet_put(pkt);
pkt = trace_packet_new();
pkt = trace_packet_new();
}
t.tv_sec = trace_hdl[i].ctrace.timestamp;
t.tv_nsec = 0;
......@@ -195,7 +200,7 @@ static void *controller_trace_handle(void *arg)
trace_hdl[i].ctrace.rd_pos += len;
if (trace_hdl[i].ctrace.rd_pos >= trace_hdl[i].ctrace.len)
trace_hdl[i].ctrace.rd_pos = 0;
trace_hdl[i].ctrace.rd_pos %= trace_hdl[i].ctrace.len;
}
}
......
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