Fix: babeltrace should skip erroneous traces
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 11 Apr 2012 21:24:25 +0000 (17:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 11 Apr 2012 21:24:25 +0000 (17:24 -0400)
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 <mathieu.desnoyers@efficios.com>
converter/babeltrace.c
lib/context.c

index a6c1f548677127f44691c2dd28e68982222a74a2..904c0150868630c47e60820a4e359635b6bf9588 100644 (file)
@@ -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);
                }
index d3232fe9720878f6f1b9cde0ebe27b1f5a7072ea..d6b1ec8b6ba71f48e5ffe9428baf3a89f8cc42df 100644 (file)
@@ -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;
This page took 0.034329 seconds and 4 git commands to generate.