lkml.org 
[lkml]   [2022]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 03/14] perf/x86/amd: add AMD Fam19h Branch Sampling support
On Wed, Dec 29, 2021 at 1:54 AM Like Xu <like.xu.linux@gmail.com> wrote:
>
> Hi Stephane,
>
> On 11/12/2021 5:02 am, Stephane Eranian wrote:
> > + * The BRS counter could be any counter, but there is no constraint on Fam19h,
> > + * therefore all counters are equal and thus we pick the first one: PMC0
>
> Are you assuming that no other counters can be enabled (guaranteed by the
> patched perf context) when BRS is enabled ? Otherwise the hard-coding of
> PMC0 may destroy scheduling freedom. Can we relax this condition?
>
You can use the other counters for any events. The BRS hardware is
programmed to watch PMC0. If
you activate BRS the event in PMC0 is the one triggering BRS capture.
When you do:
$ perf record -b -e cpu/branch-brs/,cycles ....

Given how perf record operates, it will force branch sampling on the two events.
And because branch sampling is coupled with PMC0, you will get multiplexing.
If you wanted to say use branch sampling on branch-brs, but not on
cycles, you would
not be able to do it with perf record, though the syscall interface supports it.

On AMD, there are no event constraints, so forcing events using BRS
on PMC0 does not prevent
other events from being scheduled.

Hope this helps.

\
 
 \ /
  Last update: 2022-01-04 00:25    [W:0.058 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site