From 8f5e0acfb5fc67c0b239a93ca3cc69cd36b79b75 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 29 Sep 2017 16:50:32 -0400 Subject: [PATCH] remove debug Signed-off-by: Julien Desfossez --- src/bin/lttng-relayd/main.c | 9 ------- src/bin/lttng-relayd/session.c | 1 - src/bin/lttng-sessiond/cmd.c | 1 - src/bin/lttng-sessiond/consumer.c | 7 ------ src/bin/lttng-sessiond/main.c | 2 -- src/bin/lttng-sessiond/rotate.c | 11 --------- src/bin/lttng-sessiond/rotation-thread.c | 2 -- src/bin/lttng-sessiond/sessiond-timer.c | 4 --- src/bin/lttng/commands/rotate.c | 1 - src/common/consumer/consumer.c | 26 -------------------- src/common/kernel-consumer/kernel-consumer.c | 1 - src/lib/lttng-ctl/rotate.c | 2 -- 12 files changed, 67 deletions(-) diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index bbd4abae6..998eac404 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1102,7 +1102,6 @@ static int relay_create_session(struct lttcomm_relayd_hdr *recv_hdr, 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) { @@ -1588,8 +1587,6 @@ int check_rotate_stream(struct relay_stream *stream) 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) { @@ -1602,7 +1599,6 @@ int check_rotate_stream(struct relay_stream *stream) /* 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); @@ -2402,9 +2398,6 @@ static int relay_rotate_rename(struct lttcomm_relayd_hdr *recv_hdr, 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"); @@ -2467,7 +2460,6 @@ int relay_rotate_pending(struct lttcomm_relayd_hdr *recv_hdr, 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"); @@ -2530,7 +2522,6 @@ int relay_rotate_pending(struct lttcomm_relayd_hdr *recv_hdr, 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); diff --git a/src/bin/lttng-relayd/session.c b/src/bin/lttng-relayd/session.c index 69aba7b4c..3ea8e50d6 100644 --- a/src/bin/lttng-relayd/session.c +++ b/src/bin/lttng-relayd/session.c @@ -54,7 +54,6 @@ struct relay_session *session_create(const char *session_name, 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; diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 5d0704d1d..0eba587c1 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4223,7 +4223,6 @@ int cmd_rotate_session(struct ltt_session *session, 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 diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 9cc035013..db10ec7f0 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -1611,7 +1611,6 @@ int consumer_rotate_channel(struct consumer_socket *socket, uint64_t key, 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; @@ -1619,25 +1618,19 @@ int consumer_rotate_channel(struct consumer_socket *socket, uint64_t 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; diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 5f1398973..dd4f93f76 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4270,7 +4270,6 @@ error_add_context: ret = cmd_rotate_session(cmd_ctx->session, &rotate_return); if (ret < 0) { ret = -ret; - fprintf(stderr, "cmd ret: %d\n", ret); goto error; } @@ -4328,7 +4327,6 @@ 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); diff --git a/src/bin/lttng-sessiond/rotate.c b/src/bin/lttng-sessiond/rotate.c index c8b6bc648..5dc3bea63 100644 --- a/src/bin/lttng-sessiond/rotate.c +++ b/src/bin/lttng-sessiond/rotate.c @@ -223,9 +223,6 @@ int rename_complete_chunk(struct ltt_session *session, time_t ts) 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); @@ -243,9 +240,6 @@ int rename_complete_chunk(struct ltt_session *session, time_t ts) } } 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); @@ -263,11 +257,6 @@ int rename_complete_chunk(struct ltt_session *session, time_t ts) 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); diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index b37fb5bd3..b3cf8b7c1 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -405,7 +405,6 @@ int rotate_pending_relay_timer(struct ltt_session *session) * 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; @@ -430,7 +429,6 @@ int rotate_timer(struct ltt_session *session) 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; diff --git a/src/bin/lttng-sessiond/sessiond-timer.c b/src/bin/lttng-sessiond/sessiond-timer.c index 62d701e8e..94e5dc768 100644 --- a/src/bin/lttng-sessiond/sessiond-timer.c +++ b/src/bin/lttng-sessiond/sessiond-timer.c @@ -357,19 +357,15 @@ void *sessiond_timer_thread(void *data) } 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); diff --git a/src/bin/lttng/commands/rotate.c b/src/bin/lttng/commands/rotate.c index 9248e52a4..0184e0147 100644 --- a/src/bin/lttng/commands/rotate.c +++ b/src/bin/lttng/commands/rotate.c @@ -335,7 +335,6 @@ int cmd_rotate(int argc, const char **argv) } } - 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); diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 2bfcef37a..079a9b6f3 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -2298,7 +2298,6 @@ int rotate_notify_sessiond(struct lttng_consumer_local_data *ctx, { int ret; - fprintf(stderr, "Notif send\n"); do { ret = write(ctx->channel_rotate_pipe, &key, sizeof(key)); } while (ret == -1 && errno == EINTR); @@ -2308,7 +2307,6 @@ int rotate_notify_sessiond(struct lttng_consumer_local_data *ctx, DBG("Sent channel rotation notification for channel key %" PRIu64, key); } - fprintf(stderr, "Notif done\n"); return ret; } @@ -2352,7 +2350,6 @@ int consumer_post_rotation(struct lttng_consumer_stream *stream, 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); } @@ -2382,7 +2379,6 @@ int handle_rotate_wakeup_pipe(struct lttng_consumer_local_data *ctx, } 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) { @@ -2550,7 +2546,6 @@ restart: } } 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. @@ -2822,7 +2817,6 @@ void *consumer_thread_data_poll(void *data) /* 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) { @@ -3521,7 +3515,6 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, 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); @@ -4105,18 +4098,11 @@ int lttng_consumer_rotate_channel(uint64_t key, char *path, 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); @@ -4155,8 +4141,6 @@ int lttng_consumer_stream_is_rotate_ready(struct lttng_consumer_stream *stream) } if (stream->rotate_ready) { - fprintf(stderr, "Rotate position reached for stream %lu\n", - stream->key); ret = 1; goto end; } @@ -4177,15 +4161,11 @@ int lttng_consumer_stream_is_rotate_ready(struct lttng_consumer_stream *stream) 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: @@ -4216,8 +4196,6 @@ int rotate_local_stream(struct lttng_consumer_local_data *ctx, 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); @@ -4363,10 +4341,8 @@ int lttng_consumer_rotate_ready_streams(uint64_t key, } 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; } @@ -4379,13 +4355,11 @@ int lttng_consumer_rotate_ready_streams(uint64_t key, 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; diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index 539543ee9..11ce63333 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -1642,7 +1642,6 @@ ssize_t lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream, ret = err; goto error; } - fprintf(stderr, "consumer read stream %lu done\n", stream->key); /* Write index if needed. */ if (!write_index) { diff --git a/src/lib/lttng-ctl/rotate.c b/src/lib/lttng-ctl/rotate.c index 7682fe458..146187733 100644 --- a/src/lib/lttng-ctl/rotate.c +++ b/src/lib/lttng-ctl/rotate.c @@ -153,7 +153,6 @@ int lttng_rotate_session(struct lttng_rotate_session_attr *attr, 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; @@ -249,7 +248,6 @@ int lttng_rotate_setup(struct lttng_rotate_session_attr *attr) lsm.u.rotate_setup.size = attr->size; ret = lttng_ctl_ask_sessiond(&lsm, NULL); - fprintf(stderr, "SETUP RET: %d\n", ret); end: return ret; -- 2.34.1