pmc: Branch history flag
Introduce the branch history hook in the hwpmc interface to enable
collecting branch histories alongside any event. Branch history
interfaces exist on several architectures including LBR on Intel/AMD,
BRBE on ARM, and payload to implement a unified interface for LBR on
Intel and AMD, and POWER's BHRB.
Most of these interfaces trigger alongside the performance counter and
allow us to collect a more precise backtrace. As these branch histories
can be very large this interface uses callback to allow the hwpmc
implementation to fill in the callstack after it's been allocated. The
data should be embedded as a multipart payload inside the callchain.
To use this with pmcstat I have introduced a new '-B' flag, in the pmc
tool there will be a few uses of this including extracting data for PGO.
The following AMD changes will enable this for AMD's LBR.
Sponsored by: Netflix