Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging full path of loaded adapter #2335

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion source/common/linux/ur_lib_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
*
*/
#include <dlfcn.h>
#if __has_include(<link.h>)
#include <link.h>
#define ADD_FULL_PATH_LOG
#endif

#include "logger/ur_logger.hpp"
#include "ur_lib_loader.hpp"
Expand Down Expand Up @@ -50,7 +54,14 @@ LibLoader::loadAdapterLibrary(const char *name) {
logger::info("failed to load adapter '{}' with error: {}", name,
err ? err : "unknown error");
} else {
logger::info("loaded adapter 0x{} ({})", handle, name);
#if defined(ADD_FULL_PATH_LOG)
pbalcer marked this conversation as resolved.
Show resolved Hide resolved
struct link_map *dlinfo_map;
if (dlinfo(handle, RTLD_DI_LINKMAP, &dlinfo_map) == 0) {
logger::info("loaded adapter 0x{} ({}) from {}", handle, name,
dlinfo_map->l_name);
} else
#endif
logger::info("loaded adapter 0x{} ({})", handle, name);
}
return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(handle);
}
Expand Down
Loading