Re: [PATCH v3 bpf-next 1/3] perf: enable branch record for software events

From: Song Liu
Date: Tue Aug 31 2021 - 12:12:49 EST




> On Aug 31, 2021, at 8:24 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Mon, Aug 30, 2021 at 02:41:04PM -0700, Song Liu wrote:
>
>> diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
>> index ac6fd2dabf6a2..d28d0e12c112c 100644
>> --- a/arch/x86/events/intel/core.c
>> +++ b/arch/x86/events/intel/core.c
>> @@ -2155,9 +2155,9 @@ static void __intel_pmu_disable_all(void)
>>
>> static void intel_pmu_disable_all(void)
>> {
>> + intel_pmu_lbr_disable_all();
>> __intel_pmu_disable_all();
>> intel_pmu_pebs_disable_all();
>> - intel_pmu_lbr_disable_all();
>> }
>
> Hurmph... I'm not sure about that, I'd rather you sprinkle a few
> __always_inline to ensure no actual function is called while you disable
> things in the correct order.
>
> You now still have a hole vs PMI.

Hmm... I will move this back and try some inlining. It may require moving
some functions from ds.c/lbr.c to arch/x86/events/perf_event.h. But I guess
that is OK, as there are similar functions in the header.

Thanks,
Song