Linux's perf has a bunch of generic, built-in events. For instance,
'cycles' or 'cpu-cycles' is translated to whatever arch-specific codes
are needed.

Those generic events have a special type, e.g. PERF_TYPE_HARDWARE, that
are part of the perf data ABI. The generic HW events also happen to
correspond to x86's architectural counters.

Users can now specify the same generic events as perf with Akaros, at
least for the basic hardware counters. The infrastructure is there if
we want to expand to other types and configs.

To some extent, this is set of event parsing functionality similar to
and somewhat parallel to libpfm4. The difference is that libpfm4 has
access to all sorts of special counters for particular machines, while
these ones are supported on all machines. You can still use either pfm
event strings or these generics. For instance, the following event
strings are equivalent on most Intel machines: