Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
if (sin->pos.offset == -EOF)
return -EOF;
if (sin->pos.offset == -EOF)
return -EOF;
+ /* Hide event payload struct brackets */
+ sout->depth = -1;
+
/* Read and print event header */
if (stream_class->event_header) {
generic_rw(&sin->pos.parent, &stream_class->event_header->p);
/* Read and print event header */
if (stream_class->event_header) {
generic_rw(&sin->pos.parent, &stream_class->event_header->p);
opt_output_format ? : "ctf");
if (!opt_input_format) {
opt_output_format ? : "ctf");
if (!opt_input_format) {
- fprintf(stdout, "Error: input format autodetection not implemented yet.\n\n");
+ fprintf(stdout, "[error] Input format autodetection not implemented yet.\n\n");
usage(stdout);
exit(EXIT_FAILURE);
}
fmt_read = bt_lookup_format(g_quark_from_static_string(opt_input_format));
if (!fmt_read) {
usage(stdout);
exit(EXIT_FAILURE);
}
fmt_read = bt_lookup_format(g_quark_from_static_string(opt_input_format));
if (!fmt_read) {
- fprintf(stdout, "Error: format \"%s\" is not supported.\n\n",
+ fprintf(stdout, "[error] Format \"%s\" is not supported.\n\n",
opt_input_format);
exit(EXIT_FAILURE);
}
opt_input_format);
exit(EXIT_FAILURE);
}
opt_output_format = "ctf";
fmt_write = bt_lookup_format(g_quark_from_static_string(opt_output_format));
if (!fmt_write) {
opt_output_format = "ctf";
fmt_write = bt_lookup_format(g_quark_from_static_string(opt_output_format));
if (!fmt_write) {
- fprintf(stdout, "Error: format \"%s\" is not supported.\n\n",
+ fprintf(stdout, "[error] format \"%s\" is not supported.\n\n",
opt_output_format);
exit(EXIT_FAILURE);
}
td_read = fmt_read->open_trace(opt_input_path, O_RDONLY);
if (!td_read) {
opt_output_format);
exit(EXIT_FAILURE);
}
td_read = fmt_read->open_trace(opt_input_path, O_RDONLY);
if (!td_read) {
- fprintf(stdout, "Error opening trace \"%s\" for reading.\n\n",
+ fprintf(stdout, "[error] opening trace \"%s\" for reading.\n\n",
opt_input_path);
goto error_td_read;
}
opt_input_path);
goto error_td_read;
}
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
if (!pos->dummy) {
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
if (!pos->dummy) {
- print_pos_tabs(pos);
- fprintf(pos->fp, "{\n");
+ if (pos->depth >= 0) {
+ print_pos_tabs(pos);
+ fprintf(pos->fp, "{\n");
+ }
pos->depth++;
}
struct_rw(ppos, definition);
if (!pos->dummy) {
pos->depth--;
pos->depth++;
}
struct_rw(ppos, definition);
if (!pos->dummy) {
pos->depth--;
- print_pos_tabs(pos);
- fprintf(pos->fp, "}\n");
+ if (pos->depth >= 0) {
+ print_pos_tabs(pos);
+ fprintf(pos->fp, "}\n");
+ }
#include <glib.h>
#include <errno.h>
#include <endian.h>
#include <glib.h>
#include <errno.h>
#include <endian.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/ctf/metadata.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <babeltrace/ctf/metadata.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
int ret = 0;
babeltrace_debug = 1;
int ret = 0;
babeltrace_debug = 1;
+ babeltrace_verbose = 1;
scanner = ctf_scanner_alloc(stdin);
if (!scanner) {
fprintf(stdout, "Error allocating scanner\n");
scanner = ctf_scanner_alloc(stdin);
if (!scanner) {
fprintf(stdout, "Error allocating scanner\n");
#include <inttypes.h>
#include <endian.h>
#include <errno.h>
#include <inttypes.h>
#include <endian.h>
#include <errno.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/list.h>
#include <babeltrace/types.h>
#include <babeltrace/ctf/metadata.h>
#include <babeltrace/list.h>
#include <babeltrace/types.h>
#include <babeltrace/ctf/metadata.h>
int ret = 0;
struct ctf_node *iter;
int ret = 0;
struct ctf_node *iter;
- fprintf(fd, "CTF visitor: metadata construction... ");
+ printf_verbose("CTF visitor: metadata construction... ");
trace->root_declaration_scope = new_declaration_scope(NULL);
trace->byte_order = byte_order;
trace->root_declaration_scope = new_declaration_scope(NULL);
trace->byte_order = byte_order;
(int) node->type);
return -EINVAL;
}
(int) node->type);
return -EINVAL;
}
- fprintf(fd, "done.\n");
+ printf_verbose("done.\n");
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
* take the safe route and recreate them at each validation, just in
* case the structure has changed.
*/
* take the safe route and recreate them at each validation, just in
* case the structure has changed.
*/
- fprintf(fd, "CTF visitor: parent links creation... ");
+ printf_verbose("CTF visitor: parent links creation... ");
ret = ctf_visitor_parent_links(fd, depth, node);
if (ret)
return ret;
ret = ctf_visitor_parent_links(fd, depth, node);
if (ret)
return ret;
- fprintf(fd, "done.\n");
- fprintf(fd, "CTF visitor: semantic check... ");
+ printf_verbose("done.\n");
+ printf_verbose("CTF visitor: semantic check... ");
ret = _ctf_visitor_semantic_check(fd, depth, node);
if (ret)
return ret;
ret = _ctf_visitor_semantic_check(fd, depth, node);
if (ret)
return ret;
- fprintf(fd, "done.\n");
+ printf_verbose("done.\n");
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include <babeltrace/babeltrace.h>
#include <babeltrace/ctf/types.h>
#include <babeltrace/babeltrace.h>
#include <babeltrace/ctf/types.h>
-int babeltrace_debug = 0;
+int babeltrace_debug, babeltrace_verbose;