int ret = 0;
stream->metadata_fp_write =
- babeltrace_open_memstream(metadata_buf, size);
+ bt_open_memstream(metadata_buf, size);
if (!stream->metadata_fp_write) {
perror("Metadata open_memstream");
ret = -1;
metadata = viewer_stream->ctf_trace->metadata_stream;
metadata->ctf_trace->metadata_fp =
- babeltrace_fmemopen(metadata_buf,
+ bt_fmemopen(metadata_buf,
metadata->metadata_len, "rb");
if (!metadata->ctf_trace->metadata_fp) {
perror("Metadata fmemopen");
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((uint64_t) sizeof(rq));
cmd.cmd_version = htobe32(0);
}
} while (ret > 0 || !len_read);
- if (babeltrace_close_memstream(metadata_buf, &size,
+ if (bt_close_memstream(metadata_buf, &size,
metadata_stream->metadata_fp_write)) {
- perror("babeltrace_close_memstream");
+ perror("bt_close_memstream");
}
metadata_stream->metadata_fp_write = NULL;
cur_index->ts_real.timestamp_begin;
}
+ /*
+ * 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 end;
+ }
+
if (pos->packet_size == 0 || pos->offset == EOF) {
goto end;
}
goto end_free;
}
- trace->metadata_fp = babeltrace_fmemopen(metadata_buf,
+ trace->metadata_fp = bt_fmemopen(metadata_buf,
stream->metadata_len, "rb");
if (!trace->metadata_fp) {
perror("Metadata fmemopen");
goto end;
}
- fmt_write = bt_lookup_format(g_quark_from_static_string("text"));
+ fmt_write = bt_lookup_format(g_quark_from_string("text"));
if (!fmt_write) {
fprintf(stderr, "[error] ctf-text error\n");
goto end;