Session daemon should not send streams to consumer daemon
repeatedly when CPU hotplug is performed while doing kernel
tracing.
This causes the consumer daemon to have multiple file descriptors
on the same stream, and thus try to perform operations like reading
a sub-buffer and checking for data pending concurrently. This triggers
safety-net warnings in the kernel tracer.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
/* Send streams */
cds_list_for_each_entry(stream, &channel->stream_list.head, list) {
- if (!stream->fd) {
+ if (!stream->fd || stream->sent_to_consumer) {
continue;
}
if (ret < 0) {
goto error;
}
+ stream->sent_to_consumer = true;
}
error:
int fd;
int state;
int cpu;
+ bool sent_to_consumer;
/* Format is %s_%d respectively channel name and CPU number. */
char name[DEFAULT_STREAM_NAME_LEN];
uint64_t tracefile_size;