ROCm / omnitrace

Omnitrace: Application Profiling, Tracing, and Analysis
https://rocm.docs.amd.com/projects/omnitrace/en/latest/
MIT License
297 stars 27 forks source link

Handle get_omnitrace_is_preloaded() function called multiple times #405

Closed pranswarup closed 3 days ago

pranswarup commented 1 week ago

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.