Fix debug-info: handle event layouts of lttng-ust traces prior to 2.9
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 1 Jun 2017 19:16:18 +0000 (15:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 21:00:07 +0000 (17:00 -0400)
Traces produced by lttng-ust < 2.9 emitted errors on dl_open events, but
those are not errors, just missing information that we already handle.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/lttng-utils/copy.c
plugins/lttng-utils/debug-info.c

index 482f372ad2e7208099d3d520b3a65e9dbac2bc55..972cb36902cdcf32d1c5af85fe170f44e22679d3 100644 (file)
@@ -295,10 +295,11 @@ int get_payload_string_field_value(FILE *err,
        struct bt_ctf_field_type *field_type = NULL;
        int ret;
 
+       /*
+        * The field might not exist, no error here.
+        */
        field = get_payload_field(err, event, field_name);
        if (!field) {
-               fprintf(err, "[error] %s in %s:%d\n", __func__,
-                               __FILE__, __LINE__);
                goto error;
        }
 
index 24e0a9f1bdf6f4dbbb0ce2145d1b8b6f49cfdbc3..2ac4002f910e998997efea8f2ef41fa71a2a3385 100644 (file)
@@ -516,7 +516,6 @@ void handle_bin_info_event(FILE *err, struct debug_info *debug_info,
        if (ret) {
                fprintf(err, "[error] %s in %s:%d\n", __func__,
                                __FILE__, __LINE__);
-               ret = -1;
                goto end;
        }
 
@@ -525,16 +524,16 @@ void handle_bin_info_event(FILE *err, struct debug_info *debug_info,
        if (ret) {
                fprintf(err, "[error] %s in %s:%d\n", __func__,
                                __FILE__, __LINE__);
-               ret = -1;
                goto end;
        }
 
+       /*
+        * This field is not produced by the dlopen event emitted before
+        * lttng-ust 2.9.
+        */
        ret = get_payload_string_field_value(err,
                        event, "_path", &path);
-       if (ret) {
-               fprintf(err, "[error] %s in %s:%d\n", __func__,
-                               __FILE__, __LINE__);
-               ret = -1;
+       if (ret || !path) {
                goto end;
        }
 
@@ -564,10 +563,6 @@ void handle_bin_info_event(FILE *err, struct debug_info *debug_info,
                goto end;
        }
 
-       if (!path) {
-               goto end;
-       }
-
        if (memsz == 0) {
                /* Ignore VDSO. */
                goto end;
This page took 0.0257 seconds and 4 git commands to generate.