.SH "BUGS"
.PP
-No known bugs at this point.
+The lttng-live plugin does not honor the the "--output" command line
+option.
If you encounter any issues or usability problem, please report it on
our mailing list <lttng-dev@lists.lttng.org> to help improve this
for (i = 0; i < session_list->len; i++) {
relay_session = g_ptr_array_index(session_list, i);
- fprintf(stdout, "%s/host/%s/%s (timer = %u, "
+ fprintf(LTTNG_LIVE_OUTPUT_FP, "%s/host/%s/%s (timer = %u, "
"%u stream(s), %u client(s) connected)\n",
path, relay_session->hostname,
relay_session->name, relay_session->timer,
ret = -1;
goto end;
}
+
+ /*
+ * Flush the output between attempts to grab a packet, thus
+ * ensuring we flush at least at the periodical timer period.
+ * This ensures the output remains reactive for interactive users and
+ * that the output is flushed when redirected to a file by the shell.
+ */
+ if (fflush(LTTNG_LIVE_OUTPUT_FP) < 0) {
+ perror("fflush");
+ goto error;
+ }
+
cmd.cmd = htobe32(LTTNG_VIEWER_GET_PACKET);
cmd.data_size = htobe64(sizeof(rq));
cmd.cmd_version = htobe32(0);
pos->parent.rw_table = NULL;
pos->parent.event_cb = NULL;
pos->parent.trace = &pos->trace_descriptor;
+ /*
+ * Since we do *everything* in this function, we are skipping
+ * the output plugin handling that is part of Babeltrace 1.x.
+ * Therefore, don't expect the --output cmd line option to work.
+ * This limits the output of lttng-live to stderr and stdout.
+ */
if (lttng_live_open_trace_read(path) < 0) {
goto error;
}
#define LTTNG_LIVE_MAJOR 2
#define LTTNG_LIVE_MINOR 4
+/*
+ * The lttng-live output file pointer is currently hardcoded to stdout,
+ * and is expected to be hardcoded to this by fflush() performed between
+ * each packet.
+ */
+#define LTTNG_LIVE_OUTPUT_FP stdout
+
struct lttng_live_ctx {
char traced_hostname[MAXNAMLEN];
char session_name[MAXNAMLEN];