X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=2965f496f2fc7a0ae51d55519975cf5257e00f7a;hb=8b8dc96e023c365461d2407a3bf2220779bc7d05;hp=8608b5a1b68c95115b4d499215baed1076ea441e;hpb=f8370579c39fce61e32be29bd3c6ba8e3b762211;p=babeltrace.git diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 8608b5a1..2965f496 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include #include @@ -76,6 +78,12 @@ struct trace_descriptor *ctf_open_mmap_trace( void (*packet_seek)(struct stream_pos *pos, size_t index, int whence), FILE *metadata_fp); +static +void ctf_set_context(struct trace_descriptor *descriptor, + struct bt_context *ctx); +static +void ctf_set_handle(struct trace_descriptor *descriptor, + struct bt_trace_handle *handle); static void ctf_close_trace(struct trace_descriptor *descriptor); @@ -109,6 +117,8 @@ struct format ctf_format = { .open_trace = ctf_open_trace, .open_mmap_trace = ctf_open_mmap_trace, .close_trace = ctf_close_trace, + .set_context = ctf_set_context, + .set_handle = ctf_set_handle, }; /* @@ -1610,6 +1620,26 @@ void ctf_close_trace(struct trace_descriptor *tdp) g_free(td); } +static +void ctf_set_context(struct trace_descriptor *descriptor, + struct bt_context *ctx) +{ + struct ctf_trace *td = container_of(descriptor, struct ctf_trace, + parent); + + td->ctx = ctx; +} + +static +void ctf_set_handle(struct trace_descriptor *descriptor, + struct bt_trace_handle *handle) +{ + struct ctf_trace *td = container_of(descriptor, struct ctf_trace, + parent); + + td->handle = handle; +} + void __attribute__((constructor)) ctf_init(void) { int ret;