Skip to content

Commit

Permalink
Update OMPT
Browse files Browse the repository at this point in the history
- only update file maps once per-thread in codeptr_ra_resolver
  • Loading branch information
jrmadsen committed Oct 30, 2024
1 parent 548a4c9 commit cf9a58e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions source/lib/omnitrace/library/ompt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,12 @@ tool_initialize(ompt_function_lookup_t lookup, int initial_device_num,

if(!codeptr_ra) return _generate_key(_key, _args);

static thread_local auto _once = std::once_flag{};
std::call_once(_once, []() { ::tim::unwind::update_file_maps(); });

auto _info = ::omnitrace::binary::lookup_ipaddr_entry<false>(
reinterpret_cast<uintptr_t>(codeptr_ra));

if(!_info)
{
::tim::unwind::update_file_maps();
_info = ::omnitrace::binary::lookup_ipaddr_entry<false>(
reinterpret_cast<uintptr_t>(codeptr_ra));
}

if(_info)
{
_ctx_info.func = tim::demangle(_info->name);
Expand Down

0 comments on commit cf9a58e

Please sign in to comment.