type-serializer: check is cpu id is out of bound.
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 10 Feb 2011 21:11:02 +0000 (16:11 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 10 Feb 2011 21:11:02 +0000 (16:11 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libust/type-serializer.c

index 2c278dfe0f2a9222503e2b20caf80c0119b9e273..dcaea1ef029664bbb22218b84ea663378af0c91d 100644 (file)
@@ -82,6 +82,14 @@ void _ltt_specialized_trace(const struct marker *mdata, void *probe_data,
                if (!chan->active)
                        continue;
 
+               /* If a new cpu was plugged since the trace was started, we did
+                * not add it to the trace, and therefore we write the event to
+                * cpu 0.
+                */
+               if(cpu >= chan->n_cpus) {
+                       cpu = 0;
+               }
+
                /* reserve space : header and data */
                ret = ltt_reserve_slot(chan, trace, data_size, largest_align,
                                       cpu, &buf, &slot_size, &buf_offset, &tsc,
This page took 0.024535 seconds and 4 git commands to generate.