From 45807148b2641aa049f821a7c71c4c7246c7692e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 23 Apr 2013 09:25:30 -0400 Subject: [PATCH] Move bt_context to bt_trace_descriptor Signed-off-by: Mathieu Desnoyers --- formats/ctf/ctf.c | 2 +- formats/ctf/events.c | 4 ++-- include/babeltrace/ctf-ir/metadata.h | 1 - include/babeltrace/format-internal.h | 2 ++ 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index c3249a01..d24f1cb7 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -2093,7 +2093,7 @@ void ctf_set_context(struct bt_trace_descriptor *descriptor, struct ctf_trace *td = container_of(descriptor, struct ctf_trace, parent); - td->ctx = ctx; + td->parent.ctx = ctx; } static diff --git a/formats/ctf/events.c b/formats/ctf/events.c index 3cf3b88f..1c4813da 100644 --- a/formats/ctf/events.c +++ b/formats/ctf/events.c @@ -289,8 +289,8 @@ struct bt_context *bt_ctf_event_get_context(const struct bt_ctf_event *ctf_event cfs = container_of(event->stream, const struct ctf_file_stream, parent); trace = cfs->parent.stream_class->trace; - if (trace->ctx) - ret = trace->ctx; + if (trace->parent.ctx) + ret = trace->parent.ctx; return ret; } diff --git a/include/babeltrace/ctf-ir/metadata.h b/include/babeltrace/ctf-ir/metadata.h index e4ab593e..482a8f02 100644 --- a/include/babeltrace/ctf-ir/metadata.h +++ b/include/babeltrace/ctf-ir/metadata.h @@ -218,7 +218,6 @@ struct ctf_trace { /* Heap of streams, ordered to always get the lowest timestamp */ struct ptr_heap *stream_heap; - struct bt_context *ctx; struct bt_trace_handle *handle; }; diff --git a/include/babeltrace/format-internal.h b/include/babeltrace/format-internal.h index 281fd1d9..a6509389 100644 --- a/include/babeltrace/format-internal.h +++ b/include/babeltrace/format-internal.h @@ -30,6 +30,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { @@ -38,6 +39,7 @@ extern "C" { /* Parent trace descriptor */ struct bt_trace_descriptor { char path[PATH_MAX]; /* trace path */ + struct bt_context *ctx; }; #ifdef __cplusplus -- 2.34.1