Refactoring: tracepoint: allow explicit tracepoint instance provider name
[lttng-ust.git] / src / lib / lttng-ust / lttng-probes.c
index a0e9fffa134237ab7e67838ddeae8b028ba649bf..911c29178f1b5439b907beb73101dd1e0d3e95f0 100644 (file)
@@ -137,7 +137,8 @@ int check_provider_version(const struct lttng_ust_probe_desc *desc)
        /*
         * Check tracepoint provider version compatibility.
         */
-       if (desc->major <= LTTNG_UST_PROVIDER_MAJOR) {
+       if (desc->major <= LTTNG_UST_PROVIDER_MAJOR &&
+                       desc->major >= LTTNG_UST_PROVIDER_MAJOR_OLDEST_COMPATIBLE) {
                DBG("Provider \"%s\" accepted, version %u.%u is compatible "
                        "with LTTng UST provider version %u.%u.",
                        desc->provider_name, desc->major, desc->minor,
@@ -164,7 +165,7 @@ struct lttng_ust_registered_probe *lttng_ust_probe_register(const struct lttng_u
 {
        struct lttng_ust_registered_probe *reg_probe = NULL;
 
-       lttng_ust_fixup_tls();
+       lttng_ust_alloc_tls();
 
        /*
         * If version mismatch, don't register, but don't trigger assert
@@ -202,7 +203,7 @@ end:
 
 void lttng_ust_probe_unregister(struct lttng_ust_registered_probe *reg_probe)
 {
-       lttng_ust_fixup_tls();
+       lttng_ust_alloc_tls();
 
        if (!reg_probe)
                return;
@@ -326,7 +327,7 @@ int lttng_probes_get_field_list(struct lttng_ust_field_list *list)
                                probe_desc->event_desc[i];
                        int j;
 
-                       if (event_desc->nr_fields == 0) {
+                       if (event_desc->tp_class->nr_fields == 0) {
                                /* Events without fields. */
                                struct tp_field_list_entry *list_entry;
 
@@ -348,9 +349,9 @@ int lttng_probes_get_field_list(struct lttng_ust_field_list *list)
                                list_entry->field.nowrite = 1;
                        }
 
-                       for (j = 0; j < event_desc->nr_fields; j++) {
+                       for (j = 0; j < event_desc->tp_class->nr_fields; j++) {
                                const struct lttng_ust_event_field *event_field =
-                                       event_desc->fields[j];
+                                       event_desc->tp_class->fields[j];
                                struct tp_field_list_entry *list_entry;
 
                                /* Skip event if name is too long. */
This page took 0.025199 seconds and 4 git commands to generate.