Initialization fixes (#154)

- Remove tooling initialization from rocprofiler_configure:
when rocprofiler configure is called from __hip_module_ctor
(which in turn is called as a global constructor when loading shared
libraries or before main in a hip program), initializing tooling
in it can cause problems because it is too early to do some of the tasks
that it involves (e.g. opening shared libraries, creating threads).
Instead, we rely on rocprofsys_main to initialize tooling later.

- Skip rocprofiler_configure if ROCPROFSYS_PRELOAD is not set since
preload is required for tooling (such as perfetto, which is used by
the rocprofiler callbacks) to be initialized.

- Revert RCCL initialization changes: These are no longer needed since rocprofsys_init_tooling_hidden will not
be called from rocprofiler_configure

- Force rocprofiler_configure in rocprofsys_init_tooling_hidden if it hasn't been
called through __hip_module_ctor global constructor

[ROCm/rocprofiler-systems commit: 0e535daa93]
This commit is contained in:
Sohaib Nadeem
2025-04-21 17:04:24 -04:00
committed by GitHub
parent 17ed9dd925
commit 160edff37f
4 changed files with 30 additions and 41 deletions
@@ -122,7 +122,7 @@ rocprofsys_init_library(void)
extern "C" void
rocprofsys_init_tooling(void)
{
rocprofsys_init_tooling_hidden(true);
rocprofsys_init_tooling_hidden();
}
extern "C" void