kchan = trace_kernel_get_channel_by_name(attr->name,
session->kernel_session);
if (kchan == NULL) {
+ if (session->snapshot.nb_output > 0 ||
+ session->snapshot_mode) {
+ /* Enforce mmap output for snapshot sessions. */
+ attr->attr.output = LTTNG_EVENT_MMAP;
+ }
ret = channel_kernel_create(session->kernel_session, attr, wpipe);
if (attr->name[0] != '\0') {
session->kernel_session->has_non_default_channel = 1;
goto error;
}
+ if (ret == LTTNG_OK && attr->attr.output != LTTNG_EVENT_MMAP) {
+ session->has_non_mmap_channel = true;
+ }
error:
rcu_read_unlock();
end:
goto error;
}
+ if (session->has_non_mmap_channel) {
+ ret = LTTNG_ERR_SNAPSHOT_UNSUPPORTED;
+ goto error;
+ }
+
/* Only one output is allowed until we have the "tee" feature. */
if (session->snapshot.nb_output == 1) {
ret = LTTNG_ERR_SNAPSHOT_OUTPUT_EXIST;
goto end;
}
- if (session->live_timer || session->snapshot_mode ||
- !session->output_traces) {
+ if (session->live_timer || !session->output_traces) {
cmd_ret = LTTNG_ERR_ROTATION_NOT_AVAILABLE;
goto end;
}
DBG("Cmd rotate set schedule session %s", session->name);
- if (session->live_timer || session->snapshot_mode ||
- !session->output_traces) {
+ if (session->live_timer || !session->output_traces) {
DBG("Failing ROTATION_SET_SCHEDULE command as the rotation feature is not available for this session");
ret = LTTNG_ERR_ROTATION_NOT_AVAILABLE;
goto end;