2 * ctf-visitor-semantic-validator.c
4 * Common Trace Format Metadata Semantic Validator.
6 * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 #define BT_COMP_LOG_SELF_COMP (log_cfg->self_comp)
28 #define BT_LOG_OUTPUT_LEVEL (log_cfg->log_level)
29 #define BT_LOG_TAG "PLUGIN/CTF/META/SEMANTIC-VALIDATOR-VISITOR"
30 #include "logging/comp-logging.h"
36 #include "common/assert.h"
40 #include "common/list.h"
45 #define _bt_list_first_entry(ptr, type, member) \
46 bt_list_entry((ptr)->next, type, member)
49 int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
50 struct meta_log_config
*log_cfg
);
53 int ctf_visitor_unary_expression(int depth
, struct ctf_node
*node
,
54 struct meta_log_config
*log_cfg
)
56 struct ctf_node
*iter
;
57 int is_ctf_exp
= 0, is_ctf_exp_left
= 0;
59 switch (node
->parent
->type
) {
60 case NODE_CTF_EXPRESSION
:
62 bt_list_for_each_entry(iter
, &node
->parent
->u
.ctf_expression
.left
,
67 * We are a left child of a ctf expression.
68 * We are only allowed to be a string.
70 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
71 _BT_COMP_LOGE_LINENO(node
->lineno
,
72 "Left child of a CTF expression is only allowed to be a string.");
78 /* Right child of a ctf expression can be any type of unary exp. */
80 case NODE_TYPE_DECLARATOR
:
82 * We are the length of a type declarator.
84 switch (node
->u
.unary_expression
.type
) {
85 case UNARY_UNSIGNED_CONSTANT
:
89 _BT_COMP_LOGE_LINENO(node
->lineno
,
90 "Children of field class declarator and `enum` can only be unsigned numeric constants or references to fields (e.g., `a.b.c`).");
97 * We are the size of a struct align attribute.
99 switch (node
->u
.unary_expression
.type
) {
100 case UNARY_UNSIGNED_CONSTANT
:
103 _BT_COMP_LOGE_LINENO(node
->lineno
,
104 "Structure alignment attribute can only be an unsigned numeric constant.");
109 case NODE_ENUMERATOR
:
110 /* The enumerator's parent has validated its validity already. */
113 case NODE_UNARY_EXPRESSION
:
115 * We disallow nested unary expressions and "sbrac" unary
118 _BT_COMP_LOGE_LINENO(node
->lineno
,
119 "Nested unary expressions not allowed (`()` and `[]`).");
130 case NODE_TYPEALIAS_TARGET
:
131 case NODE_TYPEALIAS_ALIAS
:
133 case NODE_TYPE_SPECIFIER
:
135 case NODE_FLOATING_POINT
:
139 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
145 switch (node
->u
.unary_expression
.link
) {
146 case UNARY_LINK_UNKNOWN
:
147 /* We don't allow empty link except on the first node of the list */
148 if (is_ctf_exp
&& _bt_list_first_entry(is_ctf_exp_left
?
149 &node
->parent
->u
.ctf_expression
.left
:
150 &node
->parent
->u
.ctf_expression
.right
,
153 _BT_COMP_LOGE_LINENO(node
->lineno
,
154 "Empty link is not allowed except on first node of unary expression (need to separate nodes with `.` or `->`).");
159 case UNARY_ARROWLINK
:
160 /* We only allow -> and . links between children of ctf_expression. */
161 if (node
->parent
->type
!= NODE_CTF_EXPRESSION
) {
162 _BT_COMP_LOGE_LINENO(node
->lineno
,
163 "Links `.` and `->` are only allowed as children of CTF expression.");
167 * Only strings can be separated linked by . or ->.
168 * This includes "", '' and non-quoted identifiers.
170 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
171 _BT_COMP_LOGE_LINENO(node
->lineno
,
172 "Links `.` and `->` are only allowed to separate strings and identifiers.");
175 /* We don't allow link on the first node of the list */
176 if (is_ctf_exp
&& _bt_list_first_entry(is_ctf_exp_left
?
177 &node
->parent
->u
.ctf_expression
.left
:
178 &node
->parent
->u
.ctf_expression
.right
,
181 _BT_COMP_LOGE_LINENO(node
->lineno
,
182 "Links `.` and `->` are not allowed before first node of the unary expression list.");
186 case UNARY_DOTDOTDOT
:
187 /* We only allow ... link between children of enumerator. */
188 if (node
->parent
->type
!= NODE_ENUMERATOR
) {
189 _BT_COMP_LOGE_LINENO(node
->lineno
,
190 "Link `...` is only allowed within enumerator.");
193 /* We don't allow link on the first node of the list */
194 if (_bt_list_first_entry(&node
->parent
->u
.enumerator
.values
,
197 _BT_COMP_LOGE_LINENO(node
->lineno
,
198 "Link `...` is not allowed on the first node of the unary expression list.");
203 _BT_COMP_LOGE_LINENO(node
->lineno
,
204 "Unknown expression link type: type=%d",
205 node
->u
.unary_expression
.link
);
211 _BT_COMP_LOGE_LINENO(node
->lineno
,
212 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
213 node_type(node
), node_type(node
->parent
));
214 return -EINVAL
; /* Incoherent structure */
217 _BT_COMP_LOGE_LINENO(node
->lineno
,
218 "Semantic error: node-type=%s, parent-node-type=%s",
219 node_type(node
), node_type(node
->parent
));
220 return -EPERM
; /* Structure not allowed */
224 int ctf_visitor_field_class_specifier_list(int depth
, struct ctf_node
*node
,
225 struct meta_log_config
*log_cfg
)
227 switch (node
->parent
->type
) {
228 case NODE_CTF_EXPRESSION
:
229 case NODE_TYPE_DECLARATOR
:
231 case NODE_TYPEALIAS_TARGET
:
232 case NODE_TYPEALIAS_ALIAS
:
234 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
244 case NODE_UNARY_EXPRESSION
:
246 case NODE_TYPE_SPECIFIER
:
247 case NODE_TYPE_SPECIFIER_LIST
:
249 case NODE_FLOATING_POINT
:
252 case NODE_ENUMERATOR
:
260 _BT_COMP_LOGE_LINENO(node
->lineno
,
261 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
262 node_type(node
), node_type(node
->parent
));
263 return -EINVAL
; /* Incoherent structure */
267 int ctf_visitor_field_class_specifier(int depth
, struct ctf_node
*node
,
268 struct meta_log_config
*log_cfg
)
270 switch (node
->parent
->type
) {
271 case NODE_TYPE_SPECIFIER_LIST
:
274 case NODE_CTF_EXPRESSION
:
275 case NODE_TYPE_DECLARATOR
:
277 case NODE_TYPEALIAS_TARGET
:
278 case NODE_TYPEALIAS_ALIAS
:
280 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
288 case NODE_UNARY_EXPRESSION
:
290 case NODE_TYPE_SPECIFIER
:
292 case NODE_FLOATING_POINT
:
295 case NODE_ENUMERATOR
:
303 _BT_COMP_LOGE_LINENO(node
->lineno
,
304 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
305 node_type(node
), node_type(node
->parent
));
306 return -EINVAL
; /* Incoherent structure */
310 int ctf_visitor_field_class_declarator(int depth
, struct ctf_node
*node
,
311 struct meta_log_config
*log_cfg
)
314 struct ctf_node
*iter
;
318 switch (node
->parent
->type
) {
319 case NODE_TYPE_DECLARATOR
:
321 * A nested field class declarator is not allowed to
324 if (!bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
327 case NODE_TYPEALIAS_TARGET
:
329 case NODE_TYPEALIAS_ALIAS
:
331 * Only accept alias name containing:
333 * - identifier * (any number of pointers)
334 * NOT accepting alias names containing [] (would otherwise
335 * cause semantic clash for later declarations of
336 * arrays/sequences of elements, where elements could be
337 * arrays/sequences themselves (if allowed in field class alias).
338 * NOT accepting alias with identifier. The declarator should
339 * be either empty or contain pointer(s).
341 if (node
->u
.field_class_declarator
.type
== TYPEDEC_NESTED
)
343 bt_list_for_each_entry(iter
, &node
->parent
->u
.field_class_alias_name
.field_class_specifier_list
->u
.field_class_specifier_list
.head
,
345 switch (iter
->u
.field_class_specifier
.type
) {
346 case TYPESPEC_FLOATING_POINT
:
347 case TYPESPEC_INTEGER
:
348 case TYPESPEC_STRING
:
349 case TYPESPEC_STRUCT
:
350 case TYPESPEC_VARIANT
:
352 if (bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
359 if (node
->u
.field_class_declarator
.type
== TYPEDEC_ID
&&
360 node
->u
.field_class_declarator
.u
.id
)
364 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
374 case NODE_CTF_EXPRESSION
:
375 case NODE_UNARY_EXPRESSION
:
377 case NODE_TYPE_SPECIFIER
:
379 case NODE_FLOATING_POINT
:
382 case NODE_ENUMERATOR
:
390 bt_list_for_each_entry(iter
, &node
->u
.field_class_declarator
.pointers
,
392 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
397 switch (node
->u
.field_class_declarator
.type
) {
402 if (node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
) {
403 ret
= _ctf_visitor_semantic_check(depth
+ 1,
404 node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
,
409 if (!node
->u
.field_class_declarator
.u
.nested
.abstract_array
) {
410 bt_list_for_each_entry(iter
, &node
->u
.field_class_declarator
.u
.nested
.length
,
412 if (iter
->type
!= NODE_UNARY_EXPRESSION
) {
413 _BT_COMP_LOGE_LINENO(node
->lineno
,
414 "Expecting unary expression as length: node-type=%s",
418 ret
= _ctf_visitor_semantic_check(depth
+ 1,
424 if (node
->parent
->type
== NODE_TYPEALIAS_TARGET
) {
425 _BT_COMP_LOGE_LINENO(node
->lineno
,
426 "Abstract array declarator not permitted as target of field class alias.");
430 if (node
->u
.field_class_declarator
.bitfield_len
) {
431 ret
= _ctf_visitor_semantic_check(depth
+ 1,
432 node
->u
.field_class_declarator
.bitfield_len
,
439 case TYPEDEC_UNKNOWN
:
441 _BT_COMP_LOGE_LINENO(node
->lineno
,
442 "Unknown field class declarator: type=%d",
443 node
->u
.field_class_declarator
.type
);
450 _BT_COMP_LOGE_LINENO(node
->lineno
,
451 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
452 node_type(node
), node_type(node
->parent
));
453 return -EINVAL
; /* Incoherent structure */
456 _BT_COMP_LOGE_LINENO(node
->lineno
,
457 "Semantic error: node-type=%s, parent-node-type=%s",
458 node_type(node
), node_type(node
->parent
));
459 return -EPERM
; /* Structure not allowed */
463 int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
464 struct meta_log_config
*log_cfg
)
467 struct ctf_node
*iter
;
472 switch (node
->type
) {
474 bt_list_for_each_entry(iter
, &node
->u
.root
.declaration_list
, siblings
) {
475 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
480 bt_list_for_each_entry(iter
, &node
->u
.root
.trace
, siblings
) {
481 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
486 bt_list_for_each_entry(iter
, &node
->u
.root
.stream
, siblings
) {
487 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
492 bt_list_for_each_entry(iter
, &node
->u
.root
.event
, siblings
) {
493 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
501 switch (node
->parent
->type
) {
508 bt_list_for_each_entry(iter
, &node
->u
.event
.declaration_list
, siblings
) {
509 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
516 switch (node
->parent
->type
) {
523 bt_list_for_each_entry(iter
, &node
->u
.stream
.declaration_list
, siblings
) {
524 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
531 switch (node
->parent
->type
) {
538 bt_list_for_each_entry(iter
, &node
->u
.env
.declaration_list
, siblings
) {
539 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
546 switch (node
->parent
->type
) {
553 bt_list_for_each_entry(iter
, &node
->u
.trace
.declaration_list
, siblings
) {
554 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
561 switch (node
->parent
->type
) {
568 bt_list_for_each_entry(iter
, &node
->u
.clock
.declaration_list
, siblings
) {
569 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
576 switch (node
->parent
->type
) {
583 bt_list_for_each_entry(iter
, &node
->u
.callsite
.declaration_list
, siblings
) {
584 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
591 case NODE_CTF_EXPRESSION
:
592 switch (node
->parent
->type
) {
600 case NODE_FLOATING_POINT
:
605 case NODE_CTF_EXPRESSION
:
606 case NODE_UNARY_EXPRESSION
:
608 case NODE_TYPEALIAS_TARGET
:
609 case NODE_TYPEALIAS_ALIAS
:
610 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
612 case NODE_TYPE_SPECIFIER
:
613 case NODE_TYPE_SPECIFIER_LIST
:
615 case NODE_TYPE_DECLARATOR
:
616 case NODE_ENUMERATOR
:
625 bt_list_for_each_entry(iter
, &node
->u
.ctf_expression
.left
, siblings
) {
626 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
631 bt_list_for_each_entry(iter
, &node
->u
.ctf_expression
.right
, siblings
) {
632 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
639 case NODE_UNARY_EXPRESSION
:
640 return ctf_visitor_unary_expression(depth
, node
, log_cfg
);
643 switch (node
->parent
->type
) {
652 case NODE_CTF_EXPRESSION
:
653 case NODE_UNARY_EXPRESSION
:
655 case NODE_TYPEALIAS_TARGET
:
656 case NODE_TYPEALIAS_ALIAS
:
658 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
659 case NODE_TYPE_SPECIFIER
:
660 case NODE_TYPE_SPECIFIER_LIST
:
662 case NODE_TYPE_DECLARATOR
:
663 case NODE_FLOATING_POINT
:
666 case NODE_ENUMERATOR
:
676 ret
= _ctf_visitor_semantic_check(depth
+ 1,
677 node
->u
.field_class_def
.field_class_specifier_list
,
681 bt_list_for_each_entry(iter
, &node
->u
.field_class_def
.field_class_declarators
, siblings
) {
682 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
689 case NODE_TYPEALIAS_TARGET
:
693 switch (node
->parent
->type
) {
701 ret
= _ctf_visitor_semantic_check(depth
+ 1,
702 node
->u
.field_class_alias_target
.field_class_specifier_list
,
707 bt_list_for_each_entry(iter
, &node
->u
.field_class_alias_target
.field_class_declarators
, siblings
) {
708 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
714 if (nr_declarators
> 1) {
715 _BT_COMP_LOGE_LINENO(node
->lineno
,
716 "Too many declarators in field class alias's name (maximum is 1): count=%d",
723 case NODE_TYPEALIAS_ALIAS
:
727 switch (node
->parent
->type
) {
735 ret
= _ctf_visitor_semantic_check(depth
+ 1,
736 node
->u
.field_class_alias_name
.field_class_specifier_list
,
741 bt_list_for_each_entry(iter
, &node
->u
.field_class_alias_name
.field_class_declarators
, siblings
) {
742 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
748 if (nr_declarators
> 1) {
749 _BT_COMP_LOGE_LINENO(node
->lineno
,
750 "Too many declarators in field class alias's name (maximum is 1): count=%d",
758 switch (node
->parent
->type
) {
767 case NODE_CTF_EXPRESSION
:
768 case NODE_UNARY_EXPRESSION
:
770 case NODE_TYPEALIAS_TARGET
:
771 case NODE_TYPEALIAS_ALIAS
:
773 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
774 case NODE_TYPE_SPECIFIER
:
775 case NODE_TYPE_SPECIFIER_LIST
:
777 case NODE_TYPE_DECLARATOR
:
778 case NODE_FLOATING_POINT
:
781 case NODE_ENUMERATOR
:
790 ret
= _ctf_visitor_semantic_check(depth
+ 1,
791 node
->u
.field_class_alias
.target
, log_cfg
);
794 ret
= _ctf_visitor_semantic_check(depth
+ 1,
795 node
->u
.field_class_alias
.alias
, log_cfg
);
800 case NODE_TYPE_SPECIFIER_LIST
:
801 ret
= ctf_visitor_field_class_specifier_list(depth
, node
,
806 case NODE_TYPE_SPECIFIER
:
807 ret
= ctf_visitor_field_class_specifier(depth
, node
,
813 switch (node
->parent
->type
) {
814 case NODE_TYPE_DECLARATOR
:
820 case NODE_TYPE_DECLARATOR
:
821 ret
= ctf_visitor_field_class_declarator(depth
, node
,
827 case NODE_FLOATING_POINT
:
828 switch (node
->parent
->type
) {
829 case NODE_TYPE_SPECIFIER
:
834 case NODE_UNARY_EXPRESSION
:
837 bt_list_for_each_entry(iter
, &node
->u
.floating_point
.expressions
, siblings
) {
838 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
845 switch (node
->parent
->type
) {
846 case NODE_TYPE_SPECIFIER
:
853 bt_list_for_each_entry(iter
, &node
->u
.integer
.expressions
, siblings
) {
854 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
861 switch (node
->parent
->type
) {
862 case NODE_TYPE_SPECIFIER
:
867 case NODE_UNARY_EXPRESSION
:
871 bt_list_for_each_entry(iter
, &node
->u
.string
.expressions
, siblings
) {
872 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
878 case NODE_ENUMERATOR
:
879 switch (node
->parent
->type
) {
886 * Enumerators are only allows to contain:
887 * numeric unary expression
888 * or num. unary exp. ... num. unary exp
893 bt_list_for_each_entry(iter
, &node
->u
.enumerator
.values
,
896 case 0: if (iter
->type
!= NODE_UNARY_EXPRESSION
897 || (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
898 && iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
)
899 || iter
->u
.unary_expression
.link
!= UNARY_LINK_UNKNOWN
) {
900 _BT_COMP_LOGE_LINENO(iter
->lineno
,
901 "First unary expression of enumerator is unexpected.");
905 case 1: if (iter
->type
!= NODE_UNARY_EXPRESSION
906 || (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
907 && iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
)
908 || iter
->u
.unary_expression
.link
!= UNARY_DOTDOTDOT
) {
909 _BT_COMP_LOGE_LINENO(iter
->lineno
,
910 "Second unary expression of enumerator is unexpected.");
920 bt_list_for_each_entry(iter
, &node
->u
.enumerator
.values
, siblings
) {
921 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
928 switch (node
->parent
->type
) {
929 case NODE_TYPE_SPECIFIER
:
934 case NODE_UNARY_EXPRESSION
:
939 ret
= _ctf_visitor_semantic_check(depth
+ 1,
940 node
->u
._enum
.container_field_class
, log_cfg
);
944 bt_list_for_each_entry(iter
, &node
->u
._enum
.enumerator_list
, siblings
) {
945 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
952 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
953 switch (node
->parent
->type
) {
960 ret
= _ctf_visitor_semantic_check(depth
+ 1,
961 node
->u
.struct_or_variant_declaration
.field_class_specifier_list
,
965 bt_list_for_each_entry(iter
, &node
->u
.struct_or_variant_declaration
.field_class_declarators
, siblings
) {
966 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
973 switch (node
->parent
->type
) {
974 case NODE_TYPE_SPECIFIER
:
979 case NODE_UNARY_EXPRESSION
:
982 bt_list_for_each_entry(iter
, &node
->u
.variant
.declaration_list
, siblings
) {
983 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
991 switch (node
->parent
->type
) {
992 case NODE_TYPE_SPECIFIER
:
997 case NODE_UNARY_EXPRESSION
:
1000 bt_list_for_each_entry(iter
, &node
->u
._struct
.declaration_list
, siblings
) {
1001 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
1010 _BT_COMP_LOGE_LINENO(node
->lineno
,
1011 "Unknown node type: type=%d", node
->type
);
1017 _BT_COMP_LOGE_LINENO(node
->lineno
,
1018 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
1019 node_type(node
), node_type(node
->parent
));
1020 return -EINVAL
; /* Incoherent structure */
1023 _BT_COMP_LOGE_LINENO(node
->lineno
,
1024 "Semantic error: node-type=%s, parent-node-type=%s",
1025 node_type(node
), node_type(node
->parent
));
1026 return -EPERM
; /* Structure not allowed */
1029 int ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
1030 struct meta_log_config
*log_cfg
)
1035 * First make sure we create the parent links for all children. Let's
1036 * take the safe route and recreate them at each validation, just in
1037 * case the structure has changed.
1039 ret
= ctf_visitor_parent_links(depth
, node
, log_cfg
);
1041 _BT_COMP_LOGE_LINENO(node
->lineno
,
1042 "Cannot create parent links in metadata's AST: "
1047 ret
= _ctf_visitor_semantic_check(depth
, node
, log_cfg
);
1049 _BT_COMP_LOGE_LINENO(node
->lineno
,
1050 "Cannot check metadata's AST semantics: "