Fix path to post-processing merge script (#187)

- Path to merge script not found unless user explicitly sources "share/rocprofiler-systems/setup-env.sh" to setup PATHs.
- Instead, let's derive the path when the application loads and use it when executing the helper script
- Rename script to rocprof-sys-merge-output.sh.
- Change install folder to <prefix>/libexec/rocprofiler-systems based on dev-ops feedback.
- Updated PATH variable in the modulefile and source scrtipt.
- For SWDEV-528101
This commit is contained in:
David Galiffi authored and GitHub committed 2025-05-02 16:52:54 -04:00
1 orang tua ff109912c2
melakukan adc66956b0
10 files changed
+103 -26

No files matched your search

+15
Melihat File
@@ -246,6 +246,7 @@ prepare_environment_for_run(std::vector<char*>& _env)
join(":", LIBPTHREAD_SO,
get_realpath(get_internal_libpath("librocprof-sys-dl.so"))),
true);
update_env(_env, "ROCPROFSYS_SCRIPT_DIR", get_internal_script_path());
}
}
@@ -259,6 +260,20 @@ get_internal_libpath(const std::string& _lib)
return rocprofsys::common::join("/", _dir, "..", "lib", _lib);
}
std::string
get_internal_script_path(void)
{
auto _exe = std::string_view{ realpath("/proc/self/exe", nullptr) };
auto _pos = _exe.find_last_of('/');
auto _dir = std::string{ "./" };
if(_pos != std::string_view::npos) _dir = _exe.substr(0, _pos);
auto _script_dir = get_realpath(
rocprofsys::common::join("/", _dir, "..", "libexec", "rocprofiler-systems"));
return _script_dir;
}
void
print_updated_environment(std::vector<char*> _env, std::string_view _prefix)
{