[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6c60815-e617-f26e-04a3-0749006ab540@linux.intel.com>
Date: Tue, 19 Dec 2017 15:10:04 -0500
From: "Liang, Kan" <kan.liang@...ux.intel.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...hat.com, acme@...nel.org, linux-kernel@...r.kernel.org,
tglx@...utronix.de, jolsa@...hat.com, eranian@...gle.com,
ak@...ux.intel.com
Subject: Re: [PATCH 4/4] perf/x86/intel: drain PEBS buffer in event read
On 12/19/2017 2:02 PM, Peter Zijlstra wrote:
> On Mon, Dec 18, 2017 at 03:34:51AM -0800, kan.liang@...ux.intel.com wrote:
>> --- a/arch/x86/events/intel/ds.c
>> +++ b/arch/x86/events/intel/ds.c
>> @@ -926,6 +926,16 @@ void intel_pmu_pebs_del(struct perf_event *event)
>> pebs_update_state(needed_cb, cpuc, event->ctx->pmu);
>> }
>>
>> +void intel_pmu_pebs_read(struct perf_event *event)
>> +{
>> + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
>> +
>> + if (pebs_needs_sched_cb(cpuc))
>> + return intel_pmu_drain_pebs_buffer();
>> +
>> + x86_perf_event_update(event, 0, 0);
>> +}
>
> This is completely broken.. what if @event isn't a pebs event, but we
> do have an auto-reloading pebs event configured?
>
precise_ip will be checked before intel_pmu_pebs_read is called.
So @event must be a pebs event.
@@ -2060,6 +2060,14 @@ static void intel_pmu_del_event(struct perf_event
*event)
intel_pmu_pebs_del(event);
}
+static void intel_pmu_read_event(struct perf_event *event)
+{
+ if (event->attr.precise_ip)
+ return intel_pmu_pebs_read(event);
+
+ x86_perf_event_update(event, 0, 0);
+}
Powered by blists - more mailing lists