Use structure size and version for event description extensibility
[libside.git] / src / tracer.c
index 8d18952058984aa8efd48287396ca378df2172bd..dc902aaac2523cdae19a3ce48af917823214a014 100644 (file)
@@ -1797,8 +1797,17 @@ void tracer_event_notification(enum side_tracer_notification notif,
                /* Skip NULL pointers */
                if (!event)
                        continue;
+               if (event->version != SIDE_ABI_VERSION) {
+                       printf("Error: event SIDE ABI version (%u) does not match the SIDE ABI version supported by the tracer (%u)\n",
+                               event->version, SIDE_ABI_VERSION);
+                               return;
+               }
                printf("provider: %s, event: %s\n",
                        side_ptr_get(event->provider_name), side_ptr_get(event->event_name));
+               if (event->struct_size != side_offsetofend(struct side_event_description, side_event_description_orig_abi_last)) {
+                       printf("Warning: Event %s.%s contains fields unknown to the tracer\n",
+                               side_ptr_get(event->provider_name), side_ptr_get(event->event_name));
+               }
                if (notif == SIDE_TRACER_NOTIFICATION_INSERT_EVENTS) {
                        if (event->nr_side_type_label > _NR_SIDE_TYPE_LABEL) {
                                printf("Warning: event %s:%s may contain unknown field types (%u unknown types)\n",
This page took 0.022838 seconds and 4 git commands to generate.