Skip to content

Commit f51536f

Browse files
perf_event: Verify that if papi_native_avail shows an event with a pmu i.e. perf:: that a user has to adhere to this when adding the event.
1 parent ff0c5e4 commit f51536f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/perf_event/pe_libpfm4_events.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ static struct native_event_t *allocate_native_event(
308308
return NULL;
309309
}
310310

311+
if ((event_table->default_pmu.name) && (strcmp(pinfo.name, event_table->default_pmu.name)) != 0 && (strcmp(pinfo.name, pmu_name) != 0)) {
312+
SUBDBG("EXIT: The provided event %s lacks the necessary pmu prefix %s.\n", name, pinfo.name);
313+
return NULL;
314+
}
315+
311316
ntv_evt->allocated_name=strdup(name);
312317
ntv_evt->mask_string=strdup(masks);
313318
ntv_evt->component=cidx;

0 commit comments

Comments
 (0)