[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zx+hI+8sRPRBvv8v@BLRRASHENOY1.amd.com>
Date: Mon, 28 Oct 2024 20:05:15 +0530
From: "Gautham R. Shenoy" <gautham.shenoy@....com>
To: Dhananjay Ugwekar <Dhananjay.Ugwekar@....com>
Cc: peterz@...radead.org, mingo@...hat.com, rui.zhang@...el.com,
acme@...nel.org, namhyung@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
irogers@...gle.com, adrian.hunter@...el.com,
kan.liang@...ux.intel.com, tglx@...utronix.de, bp@...en8.de,
dave.hansen@...ux.intel.com, ananth.narayan@....com,
kprateek.nayak@....com, ravi.bangoria@....com, x86@...nel.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 08/10] perf/x86/rapl: Remove the global variable
rapl_msrs
On Fri, Oct 25, 2024 at 11:13:46AM +0000, Dhananjay Ugwekar wrote:
> Prepare for the addition of RAPL core energy counter support.
>
> After making the rapl_model struct global, the rapl_msrs global
> variable isn't needed, so remove it.
>
> Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@....com>
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@....com>
--
Thanks and Regards
gautham.
> ---
> arch/x86/events/rapl.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c
> index ae8b450caa9b..e80b62cf9abc 100644
> --- a/arch/x86/events/rapl.c
> +++ b/arch/x86/events/rapl.c
> @@ -150,7 +150,6 @@ static int rapl_pkg_hw_unit[NR_RAPL_PKG_DOMAINS] __read_mostly;
> static struct rapl_pmus *rapl_pmus_pkg;
> static unsigned int rapl_pkg_cntr_mask;
> static u64 rapl_timer_ms;
> -static struct perf_msr *rapl_msrs;
> static struct rapl_model *rapl_model;
>
> /*
> @@ -376,7 +375,7 @@ static int rapl_pmu_event_init(struct perf_event *event)
> return -EINVAL;
>
> event->pmu_private = rapl_pmu;
> - event->hw.event_base = rapl_msrs[bit].msr;
> + event->hw.event_base = rapl_model->rapl_pkg_msrs[bit].msr;
> event->hw.config = cfg;
> event->hw.idx = bit;
>
> @@ -805,9 +804,7 @@ static int __init rapl_pmu_init(void)
>
> rapl_model = (struct rapl_model *) id->driver_data;
>
> - rapl_msrs = rapl_model->rapl_pkg_msrs;
> -
> - rapl_pkg_cntr_mask = perf_msr_probe(rapl_msrs, PERF_RAPL_PKG_EVENTS_MAX,
> + rapl_pkg_cntr_mask = perf_msr_probe(rapl_model->rapl_pkg_msrs, PERF_RAPL_PKG_EVENTS_MAX,
> false, (void *) &rapl_model->pkg_events);
>
> ret = rapl_check_hw_unit();
> --
> 2.34.1
>
Powered by blists - more mailing lists