goto send_reply;
}
- fprintf(stderr, "name: %s\n", session_name);
session = session_create(session_name, hostname, live_timer,
snapshot, conn->major, conn->minor);
if (!session) {
if (stream->prev_seq < stream->rotate_at_seq_num) {
DBG("Stream %" PRIu64 " no yet ready for rotation",
stream->stream_handle);
- fprintf(stderr, "Stream %" PRIu64 " no yet ready for rotation\n",
- stream->stream_handle);
ret = 0;
goto end;
} else if (stream->prev_seq > stream->rotate_at_seq_num) {
/* TODO */
} else {
DBG("Stream %" PRIu64 " ready for rotation", stream->stream_handle);
- fprintf(stderr, "Stream %" PRIu64 " ready for rotation\n", stream->stream_handle);
}
ret = do_rotate_stream(stream);
goto end;
}
- fprintf(stderr, "Renaming %s to %s/\n", stream_info.current_path,
- stream_info.new_path);
-
old = create_output_path(stream_info.current_path);
if (!old) {
ERR("Failed to create current output path");
uint32_t rotate_pending;
DBG("Rotate pending command received");
- fprintf(stderr, "Rotate pending command received\n");
if (!session || conn->version_check_done == 0) {
ERR("Trying to check for data before version check");
rcu_read_unlock();
send_reply:
- fprintf(stderr, "Rotate pending done: %d\n", rotate_pending);
memset(&reply, 0, sizeof(reply));
reply.ret_code = htobe32(rotate_pending);
ret = conn->sock->ops->sendmsg(conn->sock, &reply, sizeof(reply), 0);
sizeof(session->hostname))) {
goto error;
}
- fprintf(stderr, "hostname; %s\n", hostname);
session->ctf_traces_ht = lttng_ht_new(0, LTTNG_HT_TYPE_STRING);
if (!session->ctf_traces_ht) {
goto error;
snprintf(session->rotation_chunk.current_rotate_path,
PATH_MAX, "%s",
base_path);
- fprintf(stderr, "b: %s\n", base_path);
} else {
/*
* The currently active tracing path is now the folder we
DBG("Consumer rotate channel key %" PRIu64, key);
- fprintf(stderr, "rotate socket %p\n", socket);
memset(&msg, 0, sizeof(msg));
msg.cmd_type = LTTNG_CONSUMER_ROTATE_CHANNEL;
msg.u.rotate_channel.key = key;
msg.u.rotate_channel.new_chunk_id = new_chunk_id;
if (output->type == CONSUMER_DST_NET) {
- fprintf(stderr, "BASE: %s\n", output->dst.net.base_dir);
- fprintf(stderr, "CHUNK: %s\n", output->chunk_path);
msg.u.rotate_channel.relayd_id = output->net_seq_index;
snprintf(msg.u.rotate_channel.pathname, PATH_MAX, "%s%s%s",
output->dst.net.base_dir,
output->chunk_path, app_pathname);
- fprintf(stderr, "SENDING: %s\n", msg.u.rotate_channel.pathname);
*rotate_pending_relay = true;
} else {
msg.u.rotate_channel.relayd_id = (uint64_t) -1ULL;
snprintf(msg.u.rotate_channel.pathname, PATH_MAX, "%s%s%s",
output->dst.session_root_path,
output->chunk_path, app_pathname);
- fprintf(stderr, "rotate to %s\n",
- msg.u.rotate_channel.pathname);
}
health_code_update();
- fprintf(stderr, "send %d\n", LTTNG_CONSUMER_ROTATE_CHANNEL);
ret = consumer_send_msg(socket, &msg);
if (ret < 0) {
goto error;
ret = cmd_rotate_session(cmd_ctx->session, &rotate_return);
if (ret < 0) {
ret = -ret;
- fprintf(stderr, "cmd ret: %d\n", ret);
goto error;
}
}
/* Set return code */
cmd_ctx->llm->ret_code = ret;
- fprintf(stderr, "llm ret: %d\n", ret);
setup_error:
if (cmd_ctx->session) {
session_unlock(cmd_ctx->session);
datetime, session->rotate_count);
if (session->kernel_session) {
- fprintf(stderr, "rename %s/kernel to %s\n",
- session->rotation_chunk.current_rotate_path,
- new_path);
ret = rename_first_chunk(session,
session->kernel_session->consumer,
new_path);
}
}
if (session->ust_session) {
- fprintf(stderr, "rename %s/ust to %s\n",
- session->rotation_chunk.current_rotate_path,
- new_path);
ret = rename_first_chunk(session,
session->ust_session->consumer,
new_path);
snprintf(new_path, PATH_MAX, "%s%s-%" PRIu64,
session->rotation_chunk.current_rotate_path,
datetime, session->rotate_count);
-
- fprintf(stderr, "rename %s to %s\n",
- session->rotation_chunk.current_rotate_path,
- new_path);
-
ret = session_rename_chunk(session,
session->rotation_chunk.current_rotate_path,
new_path);
* Allow the timer thread to send other notifications when needed.
*/
session->rotate_pending_relay_check_in_progress = false;
- fprintf(stderr, "RET PENDING: %d\n", ret);
ret = 0;
ret = cmd_rotate_session(session, NULL);
session_unlock(session);
- fprintf(stderr, "RET ROTATE TIMER: %d\n", ret);
if (ret == -LTTNG_ERR_ROTATE_PENDING) {
ret = 0;
goto end;
}
continue;
} else if (signr == LTTNG_SESSIOND_SIG_TEARDOWN) {
- fprintf(stderr, "TEARDOWN\n");
cmm_smp_mb();
CMM_STORE_SHARED(timer_signal.qs_done, 1);
cmm_smp_mb();
DBG("Signal timer metadata thread teardown");
} else if (signr == LTTNG_SESSIOND_SIG_EXIT) {
- fprintf(stderr, "KILL\n");
goto end;
} else if (signr == LTTNG_SESSIOND_SIG_ROTATE_PENDING) {
- fprintf(stderr, "PENDING TIMER\n");
relay_rotation_pending_timer(ctx, info.si_signo, &info);
} else if (signr == LTTNG_SESSIOND_SIG_ROTATE_TIMER) {
- fprintf(stderr, "ROTATE TIMER\n");
rotate_timer(ctx, info.si_signo, &info);
} else {
ERR("Unexpected signal %d\n", info.si_signo);
}
}
- fprintf(stderr, "T: %lu, S: %lu\n", timer, size);
/* No config options, just rotate the session now */
if (timer == 0 && size == 0) {
command_ret = rotate_tracing(session_name);
{
int ret;
- fprintf(stderr, "Notif send\n");
do {
ret = write(ctx->channel_rotate_pipe, &key, sizeof(key));
} while (ret == -1 && errno == EINTR);
DBG("Sent channel rotation notification for channel key %"
PRIu64, key);
}
- fprintf(stderr, "Notif done\n");
return ret;
}
abort();
}
- fprintf(stderr, "nr_pending: %lu\n", stream->chan->nr_stream_rotate_pending);
if (--stream->chan->nr_stream_rotate_pending == 0) {
ret = rotate_notify_sessiond(ctx, stream->chan->key);
}
}
pthread_mutex_lock(&stream->lock);
- fprintf(stderr, "Rotate wakeup pipe, stream %lu\n", stream->key);
ret = lttng_consumer_rotate_stream(ctx, stream);
pthread_mutex_unlock(&stream->lock);
if (ret < 0) {
}
} else if (revents & (LPOLLERR | LPOLLHUP)) {
DBG("Metadata rotate pipe hung up");
- fprintf(stderr, "Metadata rotate pipe hung up");
/*
* Remove the pipe from the poll set and continue the loop
* since their might be data to consume.
/* Handle consumer_data_rotate_pipe. */
if (pollfd[nb_fd + 2].revents & (POLLIN | POLLPRI)) {
- fprintf(stderr, "data wakeup pipe\n");
ret = handle_rotate_wakeup_pipe(ctx,
ctx->consumer_data_rotate_pipe);
if (ret < 0) {
pthread_cond_broadcast(&stream->metadata_rdv);
pthread_mutex_unlock(&stream->metadata_rdv_lock);
}
- fprintf(stderr, "rotated: %d\n", stream->rotated);
pthread_mutex_unlock(&stream->lock);
rotate_ret = consumer_post_rotation(stream, ctx);
ERR("Produced snapshot position");
goto end_unlock;
}
- fprintf(stderr, "Stream %lu should rotate after %lu to %s\n",
- stream->key, stream->rotate_position,
- channel->pathname);
lttng_consumer_get_consumed_snapshot(stream,
&consumed_pos);
- fprintf(stderr, "consumed %lu\n", consumed_pos);
if (consumed_pos == stream->rotate_position) {
stream->rotate_ready = 1;
- fprintf(stderr, "Stream %lu ready to rotate to %s\n",
- stream->key, channel->pathname);
}
- fprintf(stderr, "before increasinc nr_pending: %lu\n", channel->nr_stream_rotate_pending);
channel->nr_stream_rotate_pending++;
ret = consumer_flush_buffer(stream, 1);
}
if (stream->rotate_ready) {
- fprintf(stderr, "Rotate position reached for stream %lu\n",
- stream->key);
ret = 1;
goto end;
}
goto end;
}
- fprintf(stderr, "packet %lu, pos %lu\n", stream->key, consumed_pos);
/* Rotate position not reached yet. */
if ((long) (consumed_pos - stream->rotate_position) < 0) {
ret = 0;
goto end;
}
- fprintf(stderr, "Rotate position %lu (expected %lu) reached for stream %lu\n",
- consumed_pos, stream->rotate_position,
- stream->key);
ret = 1;
end:
goto error;
}
- fprintf(stderr, "Rotating stream %lu to %s/%s\n", stream->key,
- stream->channel_ro_pathname, stream->name);
ret = utils_create_stream_file(stream->channel_ro_pathname, stream->name,
stream->channel_ro_tracefile_size, stream->tracefile_count_current,
stream->uid, stream->gid, NULL);
}
if (channel->metadata_stream) {
- fprintf(stderr, "M\n");
stream_pipe = ctx->consumer_metadata_rotate_pipe;
} else {
- fprintf(stderr, "D\n");
stream_pipe = ctx->consumer_data_rotate_pipe;
}
if (stream->rotate_ready == 0) {
continue;
}
- fprintf(stderr, "send stream %lu on wakeup pipe\n", stream->key);
ret = lttng_pipe_write(stream_pipe, &stream, sizeof(stream));
if (ret < 0) {
ERR("Failed to wakeup consumer rotate pipe");
goto end;
}
- fprintf(stderr, "done sending stream %lu on wakeup pipe\n", stream->key);
}
ret = 0;
ret = err;
goto error;
}
- fprintf(stderr, "consumer read stream %lu done\n", stream->key);
/* Write index if needed. */
if (!write_index) {
sizeof(lsm.session.name));
ret = lttng_ctl_ask_sessiond(&lsm, (void **) &rotate_return);
- fprintf(stderr, "RET: %d\n", ret);
if (ret < 0) {
*rotate_handle = NULL;
goto end;
lsm.u.rotate_setup.size = attr->size;
ret = lttng_ctl_ask_sessiond(&lsm, NULL);
- fprintf(stderr, "SETUP RET: %d\n", ret);
end:
return ret;