remove debug rotate
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 29 Sep 2017 20:50:32 +0000 (16:50 -0400)
committerJulien Desfossez <jdesfossez@efficios.com>
Fri, 29 Sep 2017 20:50:32 +0000 (16:50 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
12 files changed:
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/session.c
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/rotate.c
src/bin/lttng-sessiond/rotation-thread.c
src/bin/lttng-sessiond/sessiond-timer.c
src/bin/lttng/commands/rotate.c
src/common/consumer/consumer.c
src/common/kernel-consumer/kernel-consumer.c
src/lib/lttng-ctl/rotate.c

index bbd4abae633af702ac59a53c958dabcb2c23ccf2..998eac404925e58c8603d36aee261330d0b3627d 100644 (file)
@@ -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);
index 69aba7b4c3591d6a3779b99212c42994c83f0ae3..3ea8e50d6f9aaf60d64789069636c9ea13736e50 100644 (file)
@@ -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;
index 5d0704d1d0817c18b4400a510c6bae97ea5bd0fc..0eba587c133adb20841343840d6902aa075a21bc 100644 (file)
@@ -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
index 9cc0350130915feda11e375a32e95e5efcbb2c94..db10ec7f05063b06b080d3484413dbeb0714dc78 100644 (file)
@@ -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;
index 5f139897309fd29012a3a45823e498fa5ed89a72..dd4f93f76b221005dc1a92bea4d23101ca43a56b 100644 (file)
@@ -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);
index c8b6bc64806b7c58ccf6fda7bea41ff08702f145..5dc3bea63adf12b18e77e242b36d9cecf40b3123 100644 (file)
@@ -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);
index b37fb5bd381aacbed546e6d942c62b747ea870c4..b3cf8b7c120d2d1b78794cffc167af15a17454ad 100644 (file)
@@ -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;
index 62d701e8e0c74ab07bd65ce647cb0b2149c8c309..94e5dc76889344018d6d4ae74adb030144673dd8 100644 (file)
@@ -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);
index 9248e52a4e61124fb2ce960a2c16b0bf993bd811..0184e014784c6b344aae39ef718ef689ea072027 100644 (file)
@@ -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);
index 2bfcef37ae674aedec8bc2b889d074654df70aaf..079a9b6f3cd858f557e46d77d7417774aac64ee1 100644 (file)
@@ -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;
index 539543ee929b5c2a60a32ade301e090b0734e564..11ce633337b9e3bed9125f3b5fdaf87019a60c54 100644 (file)
@@ -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) {
index 7682fe4581078897ea516836c978c4f8cb8f1b9e..1461877338482e5d73244c14f292d2b41a4dc8a8 100644 (file)
@@ -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;
This page took 0.035809 seconds and 5 git commands to generate.