get_omnitrace_is_preloaded() is called multiple times likely before the LD_PRELOAD environment variable is set to false in the code. The updated function sets a new environment variable once it finds that libomnitrace-dl.so has been loaded. Subsequent calls do not check for that libomnitrace-dl.so has been loaded after seeing that the OMNITRACE_DL_IS_PRELOADED environment variable is set to true. I have tested this code, and it runs fine, generating the trace results.
get_omnitrace_is_preloaded() is called multiple times likely before the LD_PRELOAD environment variable is set to false in the code. The updated function sets a new environment variable once it finds that libomnitrace-dl.so has been loaded. Subsequent calls do not check for that libomnitrace-dl.so has been loaded after seeing that the OMNITRACE_DL_IS_PRELOADED environment variable is set to true. I have tested this code, and it runs fine, generating the trace results.