From 65db8b88c5e445815d7e76f27b987c3b0b533374 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Thu, 1 Jun 2017 15:16:18 -0400 Subject: [PATCH] Fix debug-info: handle event layouts of lttng-ust traces prior to 2.9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jérémie Galarneau --- plugins/lttng-utils/copy.c | 5 +++-- plugins/lttng-utils/debug-info.c | 15 +++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/plugins/lttng-utils/copy.c b/plugins/lttng-utils/copy.c index 482f372a..972cb369 100644 --- a/plugins/lttng-utils/copy.c +++ b/plugins/lttng-utils/copy.c @@ -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; } diff --git a/plugins/lttng-utils/debug-info.c b/plugins/lttng-utils/debug-info.c index 24e0a9f1..2ac4002f 100644 --- a/plugins/lttng-utils/debug-info.c +++ b/plugins/lttng-utils/debug-info.c @@ -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; -- 2.34.1