X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Ftrace-collection.c;h=b854c97440422b009ce12111d54f136f94431515;hb=ccde9b25397f3e74c60bfbcb9f77008299a44cc9;hp=4f1379c5a43d73cb4e0bcae9053339bf533f7802;hpb=71dd417a2b700c2315ef9919104572df1bc83f7a;p=babeltrace.git diff --git a/lib/trace-collection.c b/lib/trace-collection.c index 4f1379c5..b854c974 100644 --- a/lib/trace-collection.c +++ b/lib/trace-collection.c @@ -155,18 +155,12 @@ static void clock_add(gpointer key, gpointer value, gpointer user_data) * correlate this trace with at least one other clock in the trace and * convert the index from cycles to real time. */ -int trace_collection_add(struct trace_collection *tc, - struct trace_descriptor *td) +int bt_trace_collection_add(struct trace_collection *tc, + struct bt_trace_descriptor *trace) { - struct ctf_trace *trace; - - if (!tc || !td) + if (!tc || !trace) return -EINVAL; - trace = container_of(td, struct ctf_trace, parent); - g_ptr_array_add(tc->array, td); - trace->collection = tc; - if (tc->array->len > 1) { struct clock_match clock_match = { .clocks = tc->clocks, @@ -187,6 +181,9 @@ int trace_collection_add(struct trace_collection *tc, } } + g_ptr_array_add(tc->array, trace); + trace->collection = tc; + { struct clock_match clock_match = { .clocks = tc->clocks, @@ -208,8 +205,8 @@ error: return -EPERM; } -int trace_collection_remove(struct trace_collection *tc, - struct trace_descriptor *td) +int bt_trace_collection_remove(struct trace_collection *tc, + struct bt_trace_descriptor *td) { if (!tc || !td) return -EINVAL; @@ -222,7 +219,7 @@ int trace_collection_remove(struct trace_collection *tc, } -void init_trace_collection(struct trace_collection *tc) +void bt_init_trace_collection(struct trace_collection *tc) { assert(tc); tc->array = g_ptr_array_new(); @@ -234,10 +231,10 @@ void init_trace_collection(struct trace_collection *tc) } /* - * finalize_trace_collection() closes the opened traces for read + * bt_finalize_trace_collection() closes the opened traces for read * and free the memory allocated for trace collection */ -void finalize_trace_collection(struct trace_collection *tc) +void bt_finalize_trace_collection(struct trace_collection *tc) { assert(tc); g_ptr_array_free(tc->array, TRUE);