Hi Ilpo, On 11/7/2023 1:33 AM, Ilpo Järvinen wrote: > man perf_event_open() says this: > > "If type is PERF_TYPE_RAW, then a custom "raw" config value is needed. > Most CPUs support events that are not covered by the "generalized" > events. These are implementation defined; see your CPU manual (for ex- > ample the Intel Volume 3B documentation or the AMD BIOS and Kernel De- > veloper Guide). The libpfm4 library can be used to translate from the > name in the architectural manuals to the raw hex value perf_event_open() > expects in this field." > > ...I've not come across libpfm myself either but to me it looks libpfm > bridges between those architecture specific tables and perf_event_open(). > That is, it could provide the binary value necessary in constructing the > perf_event_attr struct. > > I think this is probably the function which maps string -> > perf_event_attr: > > https://man7.org/linux/man-pages/man3/pfm_get_os_event_encoding.3.html > This sounds promising. If this works out I think that it would be ideal if the L2 CAT test is not blocked by absence of libpfm. That is, the resctrl tests should not fail to build if libpfm is not present but instead L2 CAT just turns into a simple functional test. To accomplish this it looks like tools/build/Makefile.feature can be helpful and already has a check for libpfm. Reinette