From 97d74fdf11771aeb90b63f280b74ab199ea3ecd2 Mon Sep 17 00:00:00 2001 From: Anthony Danalis Date: Thu, 29 Jun 2023 16:37:46 -0400 Subject: [PATCH] sde_lib: Allow group placeholders. 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. --- src/sde_lib/sde_lib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sde_lib/sde_lib.c b/src/sde_lib/sde_lib.c index 814a687fb..46df93376 100644 --- a/src/sde_lib/sde_lib.c +++ b/src/sde_lib/sde_lib.c @@ -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.