From: Mathieu Desnoyers Date: Wed, 11 Apr 2012 21:24:25 +0000 (-0400) Subject: Fix: babeltrace should skip erroneous traces X-Git-Tag: v1.0.0-rc1~5 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=ca71827554747d1a4dabf9d82a7c4eacb6f908d5 Fix: babeltrace should skip erroneous traces When opening a trace collection, if one of the traces has an error, don't forbid opening the entire collection because of it: just print a warning and continue. Signed-off-by: Mathieu Desnoyers --- diff --git a/converter/babeltrace.c b/converter/babeltrace.c index a6c1f548..904c0150 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -383,10 +383,10 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, node->fts_accpath, format_str, packet_seek, NULL, NULL); if (trace_id < 0) { - fprintf(stderr, "[error] [Context] opening trace \"%s\" from %s " + fprintf(stderr, "[warning] [Context] opening trace \"%s\" from %s " "for reading.\n", node->fts_accpath, path); - ret = trace_id; - goto error; + /* Allow to skip erroneous traces. */ + continue; } g_array_append_val(trace_ids, trace_id); } diff --git a/lib/context.c b/lib/context.c index d3232fe9..d6b1ec8b 100644 --- a/lib/context.c +++ b/lib/context.c @@ -79,7 +79,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, if (path) { td = fmt->open_trace(path, O_RDONLY, packet_seek, NULL); if (!td) { - fprintf(stderr, "[error] [Context] Cannot open_trace of the format %s .\n\n", + fprintf(stderr, "[warning] [Context] Cannot open_trace of the format %s .\n\n", path); ret = -1; goto end;