callsite: support instruction pointer field
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-generate-io-struct.c
index 9be7e161a237f27c0e57eb8bf6d4edab6d72a09d..de9986113de508f36bfe66ac5950c6786da728ef 100644 (file)
@@ -2507,6 +2507,19 @@ int ctf_callsite_declaration_visit(FILE *fd, int depth, struct ctf_node *node,
                                goto error;
                        }
                        CTF_CALLSITE_SET_FIELD(callsite, line);
+               } else if (!strcmp(left, "ip")) {
+                       if (CTF_CALLSITE_FIELD_IS_SET(callsite, ip)) {
+                               fprintf(fd, "[error] %s: ip already declared in callsite declaration\n", __func__);
+                               ret = -EPERM;
+                               goto error;
+                       }
+                       ret = get_unary_unsigned(&node->u.ctf_expression.right, &callsite->ip);
+                       if (ret) {
+                               fprintf(fd, "[error] %s: unexpected unary expression for callsite ip\n", __func__);
+                               ret = -EINVAL;
+                               goto error;
+                       }
+                       CTF_CALLSITE_SET_FIELD(callsite, ip);
                } else {
                        fprintf(fd, "[warning] %s: attribute \"%s\" is unknown in callsite declaration.\n", __func__, left);
                }
This page took 0.023001 seconds and 4 git commands to generate.