ctx = bt_context_create();
- ret = bt_context_add_traces(ctx, opt_input_path,
+ ret = bt_context_add_traces_recursive(ctx, opt_input_path,
opt_input_format);
if (ret) {
fprintf(stderr, "[error] opening trace \"%s\" for reading.\n\n",
*
* Open a trace
*
- * Return the trace handle id of the opened trace
+ * Return: 0 on success, nonzero on failure.
*/
int bt_context_add_trace(struct bt_context *ctx, const char *path,
const char *format);
/*
- * bt_context_add_traces: Open a trace recursively
+ * bt_context_add_traces_recursive: Open a trace recursively
*
* Find each trace present in the subdirectory starting from the given
* path, and add them to the context.
*
* Return: 0 on success, nonzero on failure.
*/
-int bt_context_add_traces(struct bt_context *ctx, const char *path,
+int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path,
const char *format);
/*
td = fmt->open_trace(path, O_RDONLY,
ctf_move_pos_slow, NULL);
if (!td) {
- fprintf(stdout, "[error] [Context] Cannot Open_trace of the format %s .\n\n",
+ fprintf(stdout, "[error] [Context] Cannot open_trace of the format %s .\n\n",
path);
- return 0;
+ return -1;
}
/* Create an handle for the trace */
if (handle < 0) {
fprintf(stdout, "[error] [Context] Creating trace handle %s .\n\n",
path);
- return 0;
+ return -1;
}
handle->format = fmt;
handle->td = td;
(gpointer) (unsigned long) handle->id,
handle);
trace_collection_add(ctx->tc, td);
- return handle->id;
+ return 0;
}
/*
* Unable to open toplevel: failure.
* Unable to open some subdirectory or file: warn and continue;
*/
-int bt_context_add_traces(struct bt_context *ctx, const char *path,
+int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path,
const char *format_str)
{
FTS *tree;