add output file redirection and debug verbose option
[lttngtop.git] / src / liblttng-live.c
index 117b851b436173cbf06b073c84811ddb94637bc0..d531882c58eabfcda3979f43349f8f354df28531 100644 (file)
@@ -424,8 +424,8 @@ int lttng_live_attach_session(struct lttng_live_ctx *ctx, uint64_t id)
                ret = 0;
                goto end;
        }
-       printf_verbose("Waiting for %" PRIu64 " streams:\n",
-               ctx->session->stream_count);
+       printf_verbose("Waiting for %u streams:\n",
+               be32toh(rp.streams_count));
        ctx->session->streams = g_new0(struct lttng_live_viewer_stream,
                        ctx->session->stream_count);
        for (i = 0; i < be32toh(rp.streams_count); i++) {
@@ -610,11 +610,14 @@ int get_data_packet(struct lttng_live_ctx *ctx,
                        goto end;
                }
                if (rp.flags & LTTNG_VIEWER_FLAG_NEW_STREAM) {
+                       printf_verbose("get_data_packet: new streams needed\n");
                        ret = ask_new_streams(ctx);
                        if (ret < 0)
                                goto error;
                        g_hash_table_foreach(ctx->session->ctf_traces, add_traces,
                                        ctx->bt_ctx);
+                       ret = 0;
+                       goto end;
                }
                fprintf(stderr, "[error] get_data_packet: error\n");
                ret = -1;
@@ -888,7 +891,7 @@ retry:
                break;
        case LTTNG_VIEWER_INDEX_RETRY:
                printf_verbose("get_next_index: retry\n");
-               sleep(1);
+               sleep(0.1);
                goto retry;
        case LTTNG_VIEWER_INDEX_HUP:
                printf_verbose("get_next_index: stream hung up\n");
@@ -1399,7 +1402,7 @@ void lttng_live_read(struct lttng_live_ctx *ctx)
                bt_ctf_iter_destroy(iter);
 #endif
                ret = check_requirements(ctx->bt_ctx);
-               if (ret < 0) {
+               if (ret < 0 && !valid_trace) {
                        fprintf(stderr, "[error] some mandatory contexts "
                                        "were missing, exiting.\n");
                        goto end;
This page took 0.022711 seconds and 4 git commands to generate.