Skip to content

Commit bdc57ec

Browse files
dhananjay-AMDPeter Zijlstra
authored andcommitted
perf/x86/rapl: Remove the global variable rapl_msrs
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: "Gautham R. Shenoy" <[email protected]> Reviewed-by: Zhang Rui <[email protected]> Tested-by: Zhang Rui <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent abf03d9 commit bdc57ec

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

arch/x86/events/rapl.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ static int rapl_pkg_hw_unit[NR_RAPL_PKG_DOMAINS] __read_mostly;
150150
static struct rapl_pmus *rapl_pmus_pkg;
151151
static unsigned int rapl_pkg_cntr_mask;
152152
static u64 rapl_timer_ms;
153-
static struct perf_msr *rapl_msrs;
154153
static struct rapl_model *rapl_model;
155154

156155
/*
@@ -382,7 +381,7 @@ static int rapl_pmu_event_init(struct perf_event *event)
382381
return -EINVAL;
383382

384383
event->pmu_private = rapl_pmu;
385-
event->hw.event_base = rapl_msrs[bit].msr;
384+
event->hw.event_base = rapl_model->rapl_pkg_msrs[bit].msr;
386385
event->hw.config = cfg;
387386
event->hw.idx = bit;
388387

@@ -811,9 +810,7 @@ static int __init rapl_pmu_init(void)
811810

812811
rapl_model = (struct rapl_model *) id->driver_data;
813812

814-
rapl_msrs = rapl_model->rapl_pkg_msrs;
815-
816-
rapl_pkg_cntr_mask = perf_msr_probe(rapl_msrs, PERF_RAPL_PKG_EVENTS_MAX,
813+
rapl_pkg_cntr_mask = perf_msr_probe(rapl_model->rapl_pkg_msrs, PERF_RAPL_PKG_EVENTS_MAX,
817814
false, (void *) &rapl_model->pkg_events);
818815

819816
ret = rapl_check_hw_unit();

0 commit comments

Comments
 (0)