From: Philippe Proulx Date: Thu, 27 Jun 2019 02:46:08 +0000 (-0400) Subject: lib: rename `BABELTRACE_NO_DLCLOSE` -> `LIBBABELTRACE2_NO_DLCLOSE` X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=16b7b5e7f6ce858dcc2033f379f7ed78118ebbe2 lib: rename `BABELTRACE_NO_DLCLOSE` -> `LIBBABELTRACE2_NO_DLCLOSE` I feel like this environment variable is more about the library than about the project as a whole, like `LIBBABELTRACE2_INIT_LOG_LEVEL`. Signed-off-by: Philippe Proulx Change-Id: I19e5229fc64d54f2a4ff23ef36647ba78917b619 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1554 Tested-by: jenkins --- diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index f821e7c8..fbda663a 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -1459,7 +1459,7 @@ loads libbabeltrace2, use: ---- $ G_SLICE=always-malloc G_DEBUG=gc-friendly PYTHONMALLOC=malloc \ - BABELTRACE_NO_DLCLOSE=1 valgrind --leak-check=full \ + LIBBABELTRACE2_NO_DLCLOSE=1 valgrind --leak-check=full \ --suppressions=/path/to/babeltrace/extras/valgrind/popt.supp app ---- @@ -1468,6 +1468,6 @@ $ G_SLICE=always-malloc G_DEBUG=gc-friendly PYTHONMALLOC=malloc \ the Python plugin provider (Valgrind will probably show a lot of errors which originate from the Python interpreter anyway). -`BABELTRACE_NO_DLCLOSE=1` makes libbabeltrace2 not close the shared +`LIBBABELTRACE2_NO_DLCLOSE=1` makes libbabeltrace2 not close the shared libraries (plugins) which it loads. You need this to see the appropriate backtrace when Valgrind shows errors. diff --git a/src/lib/plugin/plugin-so.c b/src/lib/plugin/plugin-so.c index 42b1df6c..43055ac3 100644 --- a/src/lib/plugin/plugin-so.c +++ b/src/lib/plugin/plugin-so.c @@ -142,10 +142,10 @@ void bt_plugin_so_shared_lib_handle_destroy(struct bt_object *obj) /* * Valgrind shows incomplete stack traces when * dynamically loaded libraries are closed before it - * finishes. Use the BABELTRACE_NO_DLCLOSE in a debug + * finishes. Use the LIBBABELTRACE2_NO_DLCLOSE in a debug * build to avoid this. */ - const char *var = getenv("BABELTRACE_NO_DLCLOSE"); + const char *var = getenv("LIBBABELTRACE2_NO_DLCLOSE"); if (!var || strcmp(var, "1") != 0) { #endif @@ -159,7 +159,7 @@ void bt_plugin_so_shared_lib_handle_destroy(struct bt_object *obj) shared_lib_handle->module = NULL; #ifndef BT_DEBUG_MODE } else { - BT_LOGI("Not closing GModule because `BABELTRACE_NO_DLCLOSE=1`: " + BT_LOGI("Not closing GModule because `LIBBABELTRACE2_NO_DLCLOSE=1`: " "path=\"%s\"", path); } #endif