lkml.org 
[lkml]   [2019]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/9] perf/x86/intel: Support hardware TopDown metrics
On Tue, May 21, 2019 at 02:40:50PM -0700, kan.liang@linux.intel.com wrote:
> @@ -3287,6 +3304,13 @@ static int core_pmu_hw_config(struct perf_event *event)
> return intel_pmu_bts_config(event);
> }
>
> +#define EVENT_CODE(e) (e->attr.config & INTEL_ARCH_EVENT_MASK)
> +#define is_slots_event(e) (EVENT_CODE(e) == 0x0400)
> +#define is_perf_metrics_event(e) \
> + (((EVENT_CODE(e) & 0xff) == 0xff) && \
> + (EVENT_CODE(e) >= 0x01ff) && \
> + (EVENT_CODE(e) <= 0x04ff))
> +

That is horrific.. (e & INTEL_ARCH_EVENT_MASK) & 0xff is just daft,
that should be: (e & ARCH_PERFMON_EVENTSEL_EVENT).

Also, we already have fake events for event=0, see FIXED2, why are we
now using event=0xff ?

\
 
 \ /
  Last update: 2019-05-28 15:45    [W:0.168 / U:2.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site