[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200630154326.GT4781@hirez.programming.kicks-ass.net>
Date: Tue, 30 Jun 2020 17:43:26 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: kan.liang@...ux.intel.com
Cc: mingo@...hat.com, acme@...nel.org, tglx@...utronix.de,
bp@...en8.de, x86@...nel.org, linux-kernel@...r.kernel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...hat.com, namhyung@...nel.org, dave.hansen@...el.com,
yu-cheng.yu@...el.com, bigeasy@...utronix.de, gorcunov@...il.com,
hpa@...or.com, alexey.budankov@...ux.intel.com, eranian@...gle.com,
ak@...ux.intel.com, like.xu@...ux.intel.com,
yao.jin@...ux.intel.com, wei.w.wang@...el.com
Subject: Re: [PATCH V2 13/23] perf/x86/intel/lbr: Factor out
intel_pmu_store_lbr
On Fri, Jun 26, 2020 at 11:20:10AM -0700, kan.liang@...ux.intel.com wrote:
> -static inline u64 rdlbr_from(unsigned int idx)
> +static inline u64 rdlbr_from(unsigned int idx, struct lbr_entry *lbr)
> {
> u64 val;
>
> + if (lbr)
> + return lbr->from;
> +
> rdmsrl(x86_pmu.lbr_from + idx, val);
>
> return lbr_from_signext_quirk_rd(val);
> }
>
> -static inline u64 rdlbr_to(unsigned int idx)
> +static inline u64 rdlbr_to(unsigned int idx, struct lbr_entry *lbr)
> {
> u64 val;
>
> + if (lbr)
> + return lbr->to;
> +
> rdmsrl(x86_pmu.lbr_to + idx, val);
>
> return val;
> }
>
> -static inline u64 rdlbr_info(unsigned int idx)
> +static inline u64 rdlbr_info(unsigned int idx, struct lbr_entry *lbr)
> {
> u64 val;
>
> + if (lbr)
> + return lbr->info;
> +
> rdmsrl(x86_pmu.lbr_info + idx, val);
>
> return val;
These should probably be __always_inline, just to make sure the compiler
doesn't do anything stupid.
Powered by blists - more mailing lists