From: Jérémie Galarneau Date: Fri, 22 Jul 2016 15:41:35 +0000 (-0400) Subject: Use lttng-ust's new load event to track library mappings X-Git-Tag: v2.0.0-pre1~924 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=46d8a85a760c53f3c4419e5ef6b3e3f300fbcbc6 Use lttng-ust's new load event to track library mappings Signed-off-by: Jérémie Galarneau --- diff --git a/lib/debug-info.c b/lib/debug-info.c index aa19ce40..53d1eab2 100644 --- a/lib/debug-info.c +++ b/lib/debug-info.c @@ -59,20 +59,22 @@ struct debug_info { GQuark q_statedump_build_id; GQuark q_statedump_start; GQuark q_dl_open; + GQuark q_lib_load; }; static int debug_info_init(struct debug_info *info) { - info->q_statedump_bin_info = g_quark_from_string( + info->q_statedump_bin_info = g_quark_from_static_string( "lttng_ust_statedump:bin_info"); - info->q_statedump_debug_link = g_quark_from_string( + info->q_statedump_debug_link = g_quark_from_static_string( "lttng_ust_statedump:debug_link)"); - info->q_statedump_build_id = g_quark_from_string( + info->q_statedump_build_id = g_quark_from_static_string( "lttng_ust_statedump:build_id"); - info->q_statedump_start = g_quark_from_string( + info->q_statedump_start = g_quark_from_static_string( "lttng_ust_statedump:start"); - info->q_dl_open = g_quark_from_string("lttng_ust_dl:dlopen"); + info->q_dl_open = g_quark_from_static_string("lttng_ust_dl:dlopen"); + info->q_lib_load = g_quark_from_static_string("lttng_ust_lib:load"); return bin_info_init(); } @@ -784,7 +786,17 @@ void debug_info_handle_event(struct debug_info *debug_info, if (event_class->name == debug_info->q_statedump_bin_info) { /* State dump */ handle_statedump_bin_info_event(debug_info, event); - } else if (event_class->name == debug_info->q_dl_open) { + } else if (event_class->name == debug_info->q_dl_open || + event_class->name == debug_info->q_lib_load) { + /* + * dl_open and lib_load events are both checked for since + * only dl_open was produced as of lttng-ust 2.8. + * + * lib_load, which is produced from lttng-ust 2.9+, is a lot + * more reliable since it will be emitted when other functions + * of the dlopen family are called (e.g. dlmopen) and when + * library are transitively loaded. + */ handle_dlopen_event(debug_info, event); } else if (event_class->name == debug_info->q_statedump_start) { /* Start state dump */