From f36123a3675170ec7c36412cf7ad08d17d54574d Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Thu, 16 Jun 2022 08:58:09 -0700 Subject: [PATCH] Fixing OpenMP event annotation, including address whether the code was compiled with debug or not. Demangling now happens in apex_bfd.cpp, before line number or address is added to the symbol name. --- src/apex/address_resolution.cpp | 4 +++- src/apex/apex_ompt.cpp | 24 ++++++++++++++++++++++++ src/apex/task_identifier.cpp | 15 +++++++++++---- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/apex/address_resolution.cpp b/src/apex/address_resolution.cpp index 6e16ddbb..64bd3391 100644 --- a/src/apex/address_resolution.cpp +++ b/src/apex/address_resolution.cpp @@ -79,7 +79,9 @@ namespace apex { if (node->info.demangled) { location << node->info.demangled ; } else if (node->info.funcname) { - location << node->info.funcname ; + std::string mangled(node->info.funcname); + std::string demangled = demangle(mangled); + location << demangled ; } if (apex_options::use_source_location()) { location << " [{" ; diff --git a/src/apex/apex_ompt.cpp b/src/apex/apex_ompt.cpp index f282fa2b..11c37e2d 100644 --- a/src/apex/apex_ompt.cpp +++ b/src/apex/apex_ompt.cpp @@ -1118,6 +1118,9 @@ extern "C" void apex_sync_region_wait ( static const char * task_wait_str = "Task Wait"; static const char * task_group_str = "Task Group Wait"; static const char * reduction_str = "Reduction Wait"; + static const char * barrier_implicit_workshare_str = "Barrier Implicit Workshare Wait"; + static const char * barrier_implicit_parallel_str = "Barrier Implicit Parallel Wait"; + static const char * barrier_teams_str = "Barrier Teams Wait"; static const char * unknown_str = "Unknown Wait"; switch (kind) { case ompt_sync_region_barrier: @@ -1141,6 +1144,15 @@ extern "C" void apex_sync_region_wait ( case ompt_sync_region_reduction: tmp_str = const_cast(reduction_str); break; + case ompt_sync_region_barrier_implicit_workshare: + tmp_str = const_cast(barrier_implicit_workshare_str); + break; + case ompt_sync_region_barrier_implicit_parallel: + tmp_str = const_cast(barrier_implicit_parallel_str); + break; + case ompt_sync_region_barrier_teams: + tmp_str = const_cast(barrier_teams_str); + break; default: tmp_str = const_cast(unknown_str); break; @@ -1309,6 +1321,9 @@ extern "C" void apex_ompt_sync_region ( static const char * task_str = "Task"; static const char * task_group_str = "Task Group"; static const char * reduction_str = "Reduction"; + static const char * barrier_implicit_workshare_str = "Barrier Implicit Workshare"; + static const char * barrier_implicit_parallel_str = "Barrier Implicit Parallel"; + static const char * barrier_teams_str = "Barrier Teams"; static const char * unknown_str = "Unknown"; switch (kind) { case ompt_sync_region_barrier: @@ -1332,6 +1347,15 @@ extern "C" void apex_ompt_sync_region ( case ompt_sync_region_reduction: tmp_str = const_cast(reduction_str); break; + case ompt_sync_region_barrier_implicit_workshare: + tmp_str = const_cast(barrier_implicit_workshare_str); + break; + case ompt_sync_region_barrier_implicit_parallel: + tmp_str = const_cast(barrier_implicit_parallel_str); + break; + case ompt_sync_region_barrier_teams: + tmp_str = const_cast(barrier_teams_str); + break; default: tmp_str = const_cast(unknown_str); break; diff --git a/src/apex/task_identifier.cpp b/src/apex/task_identifier.cpp index 557c2547..5b1595fe 100644 --- a/src/apex/task_identifier.cpp +++ b/src/apex/task_identifier.cpp @@ -161,13 +161,20 @@ std::mutex bfd_mutex; std::string s("OpenMP "); if (retval.rfind(s, 0) == 0) { // found an OpenMP timer, so keep the address - REGEX_NAMESPACE::regex old_address("UNRESOLVED ADDR"); - retval = REGEX_NAMESPACE::regex_replace(retval, old_address, - (demangle(*tmp))); + // ...unless it's already there + if (tmp->find(addr_str) != std::string::npos) { + REGEX_NAMESPACE::regex old_address("UNRESOLVED ADDR " + addr_str); + retval = REGEX_NAMESPACE::regex_replace(retval, old_address, + (*tmp)); + } else { + REGEX_NAMESPACE::regex old_address("UNRESOLVED ADDR"); + retval = REGEX_NAMESPACE::regex_replace(retval, old_address, + (*tmp)); + } } else { REGEX_NAMESPACE::regex old_address("UNRESOLVED ADDR " + addr_str); retval = REGEX_NAMESPACE::regex_replace(retval, old_address, - (demangle(*tmp))); + (*tmp)); } } }