That gave me exactly what I needed, thanks for the tip.
Both the list code and the code that adds events to event sets in papi seems to be working now with the PFM_OS_PERF_EVENT_EXT mode set.
I still have a couple of things that need to be fixed but so far things are looking pretty good. And at this point there are no changes to libpfm4.
My todo list has one other thing that may affect libpfm4. I would like be able to create an event list which includes the counter register constraints for the events and/or umasks (when there are constraints). I see the information already exists in the libpfm4 event tables, but I see no way to get the information back from libpfm4. Perhaps these values could be added as a new field in the information structures returned from the pfm_get_event_info and pfm_get_attr_info function calls.
It would be nice if the user could see the counter constraints without having to go find the intel/amd/??? manuals. I understand that the counter constraints are actually enforced by the kernel and not libpfm4 but being able to provide this information to the user would help them determine which events can be used together. With the newer kinds of hardware, counter constraints are becoming more common so I think additional help for the user in this area is a good idea.