Skip to content

Commit

Permalink
Fixing OpenMP event annotation, including address whether the code wa…
Browse files Browse the repository at this point in the history
…s compiled with debug or not. Demangling now happens in apex_bfd.cpp, before line number or address is added to the symbol name.
  • Loading branch information
khuck committed Jun 16, 2022
1 parent 2d117ff commit f36123a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/apex/address_resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 << " [{" ;
Expand Down
24 changes: 24 additions & 0 deletions src/apex/apex_ompt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -1141,6 +1144,15 @@ extern "C" void apex_sync_region_wait (
case ompt_sync_region_reduction:
tmp_str = const_cast<char*>(reduction_str);
break;
case ompt_sync_region_barrier_implicit_workshare:
tmp_str = const_cast<char*>(barrier_implicit_workshare_str);
break;
case ompt_sync_region_barrier_implicit_parallel:
tmp_str = const_cast<char*>(barrier_implicit_parallel_str);
break;
case ompt_sync_region_barrier_teams:
tmp_str = const_cast<char*>(barrier_teams_str);
break;
default:
tmp_str = const_cast<char*>(unknown_str);
break;
Expand Down Expand Up @@ -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:
Expand All @@ -1332,6 +1347,15 @@ extern "C" void apex_ompt_sync_region (
case ompt_sync_region_reduction:
tmp_str = const_cast<char*>(reduction_str);
break;
case ompt_sync_region_barrier_implicit_workshare:
tmp_str = const_cast<char*>(barrier_implicit_workshare_str);
break;
case ompt_sync_region_barrier_implicit_parallel:
tmp_str = const_cast<char*>(barrier_implicit_parallel_str);
break;
case ompt_sync_region_barrier_teams:
tmp_str = const_cast<char*>(barrier_teams_str);
break;
default:
tmp_str = const_cast<char*>(unknown_str);
break;
Expand Down
15 changes: 11 additions & 4 deletions src/apex/task_identifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down

0 comments on commit f36123a

Please sign in to comment.