Add nr_side_type_label and nr_side_attr_type event description fields
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Nov 2023 20:28:11 +0000 (15:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Nov 2023 20:28:11 +0000 (15:28 -0500)
Allow tracers to discover whether they know about all field types
present when the event instrumentation was compiled.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/side/trace.h

index fc51ec617691c296046e716825ffc2f00742be8a..3a90b35c73a1b0d0f4b1ac882b9feb16511921ff 100644 (file)
@@ -175,6 +175,8 @@ enum side_type_label {
        SIDE_TYPE_DYNAMIC_STRUCT_VISITOR,
        SIDE_TYPE_DYNAMIC_VLA,
        SIDE_TYPE_DYNAMIC_VLA_VISITOR,
+
+       _NR_SIDE_TYPE_LABEL,    /* Last entry. */
 };
 
 enum side_attr_type {
@@ -193,6 +195,8 @@ enum side_attr_type {
        SIDE_ATTR_TYPE_FLOAT_BINARY64,
        SIDE_ATTR_TYPE_FLOAT_BINARY128,
        SIDE_ATTR_TYPE_STRING,
+
+       _NR_SIDE_ATTR_TYPE,     /* Last entry. */
 };
 
 enum side_loglevel {
@@ -715,6 +719,8 @@ struct side_event_description {
        side_ptr_t(const struct side_attr) attr;
        uint64_t flags;
        uint32_t version;
+       uint16_t nr_side_type_label;
+       uint16_t nr_side_attr_type;
        side_enum_t(enum side_loglevel, uint32_t) loglevel;
        uint32_t nr_fields;
        uint32_t nr_attr;
@@ -1878,6 +1884,8 @@ struct side_event_state {
                .attr = SIDE_PTR_INIT(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
                .flags = (_flags), \
                .version = 0, \
+               .nr_side_type_label = _NR_SIDE_TYPE_LABEL, \
+               .nr_side_attr_type = _NR_SIDE_ATTR_TYPE, \
                .loglevel = SIDE_ENUM_INIT(_loglevel), \
                .nr_fields = SIDE_ARRAY_SIZE(SIDE_PARAM(_fields)), \
                .nr_attr = SIDE_ARRAY_SIZE(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
This page took 0.02386 seconds and 4 git commands to generate.