@@ -258,7 +258,7 @@ int metag_pmu_event_set_period(struct perf_event *event,
258
258
259
259
static void metag_pmu_start (struct perf_event * event , int flags )
260
260
{
261
- struct cpu_hw_events * cpuc = & __get_cpu_var ( cpu_hw_events );
261
+ struct cpu_hw_events * cpuc = this_cpu_ptr ( & cpu_hw_events );
262
262
struct hw_perf_event * hwc = & event -> hw ;
263
263
int idx = hwc -> idx ;
264
264
@@ -306,7 +306,7 @@ static void metag_pmu_stop(struct perf_event *event, int flags)
306
306
307
307
static int metag_pmu_add (struct perf_event * event , int flags )
308
308
{
309
- struct cpu_hw_events * cpuc = & __get_cpu_var ( cpu_hw_events );
309
+ struct cpu_hw_events * cpuc = this_cpu_ptr ( & cpu_hw_events );
310
310
struct hw_perf_event * hwc = & event -> hw ;
311
311
int idx = 0 , ret = 0 ;
312
312
@@ -348,7 +348,7 @@ static int metag_pmu_add(struct perf_event *event, int flags)
348
348
349
349
static void metag_pmu_del (struct perf_event * event , int flags )
350
350
{
351
- struct cpu_hw_events * cpuc = & __get_cpu_var ( cpu_hw_events );
351
+ struct cpu_hw_events * cpuc = this_cpu_ptr ( & cpu_hw_events );
352
352
struct hw_perf_event * hwc = & event -> hw ;
353
353
int idx = hwc -> idx ;
354
354
@@ -597,7 +597,7 @@ static int _hw_perf_event_init(struct perf_event *event)
597
597
598
598
static void metag_pmu_enable_counter (struct hw_perf_event * event , int idx )
599
599
{
600
- struct cpu_hw_events * events = & __get_cpu_var ( cpu_hw_events );
600
+ struct cpu_hw_events * events = this_cpu_ptr ( & cpu_hw_events );
601
601
unsigned int config = event -> config ;
602
602
unsigned int tmp = config & 0xf0 ;
603
603
unsigned long flags ;
@@ -670,7 +670,7 @@ static void metag_pmu_enable_counter(struct hw_perf_event *event, int idx)
670
670
671
671
static void metag_pmu_disable_counter (struct hw_perf_event * event , int idx )
672
672
{
673
- struct cpu_hw_events * events = & __get_cpu_var ( cpu_hw_events );
673
+ struct cpu_hw_events * events = this_cpu_ptr ( & cpu_hw_events );
674
674
unsigned int tmp = 0 ;
675
675
unsigned long flags ;
676
676
@@ -718,7 +718,7 @@ static u64 metag_pmu_read_counter(int idx)
718
718
719
719
static void metag_pmu_write_counter (int idx , u32 val )
720
720
{
721
- struct cpu_hw_events * events = & __get_cpu_var ( cpu_hw_events );
721
+ struct cpu_hw_events * events = this_cpu_ptr ( & cpu_hw_events );
722
722
u32 tmp = 0 ;
723
723
unsigned long flags ;
724
724
@@ -751,7 +751,7 @@ static int metag_pmu_event_map(int idx)
751
751
static irqreturn_t metag_pmu_counter_overflow (int irq , void * dev )
752
752
{
753
753
int idx = (int )dev ;
754
- struct cpu_hw_events * cpuhw = & __get_cpu_var ( cpu_hw_events );
754
+ struct cpu_hw_events * cpuhw = this_cpu_ptr ( & cpu_hw_events );
755
755
struct perf_event * event = cpuhw -> events [idx ];
756
756
struct hw_perf_event * hwc = & event -> hw ;
757
757
struct pt_regs * regs = get_irq_regs ();
0 commit comments