From 1e5997be3bb556cc6131ad117d214e4a9e80527b Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 23 Nov 2023 15:28:11 -0500 Subject: [PATCH] Add nr_side_type_label and nr_side_attr_type event description fields Allow tracers to discover whether they know about all field types present when the event instrumentation was compiled. Signed-off-by: Mathieu Desnoyers --- include/side/trace.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/side/trace.h b/include/side/trace.h index fc51ec6..3a90b35 100644 --- a/include/side/trace.h +++ b/include/side/trace.h @@ -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())), \ -- 2.34.1