lkml.org 
[lkml]   [2023]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V4 4/7] perf/x86/intel: Support LBR event logging
On Wed, Oct 04, 2023 at 11:40:41AM -0700, kan.liang@linux.intel.com wrote:

> +static ssize_t branch_counter_width_show(struct device *cdev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + return snprintf(buf, PAGE_SIZE, "2\n");
> +}

> +#define ARCH_LBR_EVENT_LOG_WIDTH 2

I'm assuming this is the same '2' ? And having it hard-coded in two
locations is awesome..

> +#define ARCH_LBR_EVENT_LOG_MASK 0x3

Should probably be ((1<<2)-1)

As per that other email, the naming is confusing, should this not be:

ARCH_LBR_EVENT_COUNTER_BITS

or, since it's all local to lbr.c something shorter still, like:

LBR_COUNTER_BITS

hmm?

\
 
 \ /
  Last update: 2023-10-19 13:02    [W:0.221 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site