Skip to content

Commit

Permalink
sde_lib: Allow group placeholders.
Browse files Browse the repository at this point in the history
If reading a group has been requested from the application/tool layer
(though PAPI_event_name_to_code()) before the group is actually registered
by the library, we will create a placeholder for it. This change allows
the group registration to overwrite the placeholder.
  • Loading branch information
adanalis committed Jun 30, 2023
1 parent b92bbd0 commit 97d74fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sde_lib/sde_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,12 @@ papi_sde_add_counter_to_group(papi_handle_t handle, const char *event_name, cons

}else{
if( NULL == tmp_group->u.cntr_group.group_head ){
SDE_ERROR("papi_sde_add_counter_to_group(): Found an empty counter group: '%s'. This might indicate that a cleanup routine is not doing its job.", group_name);
if( CNTR_CLASS_PLACEHOLDER == tmp_group->cntr_class ){
tmp_group->cntr_class = CNTR_CLASS_GROUP;
}else{
SDE_ERROR("papi_sde_add_counter_to_group(): Found an empty counter group: '%s'. This might indicate that a cleanup routine is not doing its job.", group_name);
}

}

// make sure the caller is not trying to change the flags of the group after it has been created.
Expand Down

0 comments on commit 97d74fd

Please sign in to comment.