@@ -2257,6 +2257,15 @@ static void intel_pebs_aliases_snb(struct perf_event *event)
22572257 }
22582258}
22592259
2260+ static unsigned long intel_pmu_free_running_flags (struct perf_event * event )
2261+ {
2262+ unsigned long flags = x86_pmu .free_running_flags ;
2263+
2264+ if (event -> attr .use_clockid )
2265+ flags &= ~PERF_SAMPLE_TIME ;
2266+ return flags ;
2267+ }
2268+
22602269static int intel_pmu_hw_config (struct perf_event * event )
22612270{
22622271 int ret = x86_pmu_hw_config (event );
@@ -2267,7 +2276,8 @@ static int intel_pmu_hw_config(struct perf_event *event)
22672276 if (event -> attr .precise_ip ) {
22682277 if (!event -> attr .freq ) {
22692278 event -> hw .flags |= PERF_X86_EVENT_AUTO_RELOAD ;
2270- if (!(event -> attr .sample_type & ~PEBS_FREERUNNING_FLAGS ))
2279+ if (!(event -> attr .sample_type &
2280+ ~intel_pmu_free_running_flags (event )))
22712281 event -> hw .flags |= PERF_X86_EVENT_FREERUNNING ;
22722282 }
22732283 if (x86_pmu .pebs_aliases )
@@ -2689,6 +2699,8 @@ static __initconst const struct x86_pmu core_pmu = {
26892699 .event_map = intel_pmu_event_map ,
26902700 .max_events = ARRAY_SIZE (intel_perfmon_event_map ),
26912701 .apic = 1 ,
2702+ .free_running_flags = PEBS_FREERUNNING_FLAGS ,
2703+
26922704 /*
26932705 * Intel PMCs cannot be accessed sanely above 32-bit width,
26942706 * so we install an artificial 1<<31 period regardless of
@@ -2727,6 +2739,7 @@ static __initconst const struct x86_pmu intel_pmu = {
27272739 .event_map = intel_pmu_event_map ,
27282740 .max_events = ARRAY_SIZE (intel_perfmon_event_map ),
27292741 .apic = 1 ,
2742+ .free_running_flags = PEBS_FREERUNNING_FLAGS ,
27302743 /*
27312744 * Intel PMCs cannot be accessed sanely above 32 bit width,
27322745 * so we install an artificial 1<<31 period regardless of
0 commit comments