From: Jérémie Galarneau Date: Mon, 11 May 2015 21:37:59 +0000 (-0400) Subject: ir: validate sequence length fields and variant tags of event classes X-Git-Tag: v2.0.0-pre1~1240 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=2607921689d4f7978382dfcac5bc7b4e766a42f1;hp=d146339dfd3a1861da0959f40cd622373c966007 ir: validate sequence length fields and variant tags of event classes Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ir/stream-class.c b/formats/ctf/ir/stream-class.c index aba76cd1..72b07b84 100644 --- a/formats/ctf/ir/stream-class.c +++ b/formats/ctf/ir/stream-class.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -340,6 +341,20 @@ int bt_ctf_stream_class_add_event_class( goto end; } + /* + * Resolve the event's sequence length and variant tags if the + * stream is already associated with a trace. Otherwise, this + * validation will be performed once the stream is registered + * to a trace. + */ + if (stream_class->trace) { + ret = bt_ctf_event_class_resolve_types(event_class, + stream_class->trace, stream_class); + if (ret) { + goto end; + } + } + /* Only set an event id if none was explicitly set before */ event_id = bt_ctf_event_class_get_id(event_class); if (event_id < 0) {