Commit 7b598cdd03e35a4361f4ff7ebc630aa508c35be6

Authored by Michael Cree
Committed by Matt Turner
1 parent 59b25ed914

alpha: convert perf_event to use local_t

Updates the Alpha perf_event code to match the changes
recently made to the core perf_event code in commit
e78505958cf123048fb48cb56b79cebb8edd15fb.

Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Signed-off-by: Matt Turner <mattst88@gmail.com>

Showing 1 changed file with 9 additions and 9 deletions Side-by-side Diff

arch/alpha/kernel/perf_event.c
... ... @@ -241,20 +241,20 @@
241 241 static int alpha_perf_event_set_period(struct perf_event *event,
242 242 struct hw_perf_event *hwc, int idx)
243 243 {
244   - long left = atomic64_read(&hwc->period_left);
  244 + long left = local64_read(&hwc->period_left);
245 245 long period = hwc->sample_period;
246 246 int ret = 0;
247 247  
248 248 if (unlikely(left <= -period)) {
249 249 left = period;
250   - atomic64_set(&hwc->period_left, left);
  250 + local64_set(&hwc->period_left, left);
251 251 hwc->last_period = period;
252 252 ret = 1;
253 253 }
254 254  
255 255 if (unlikely(left <= 0)) {
256 256 left += period;
257   - atomic64_set(&hwc->period_left, left);
  257 + local64_set(&hwc->period_left, left);
258 258 hwc->last_period = period;
259 259 ret = 1;
260 260 }
... ... @@ -269,7 +269,7 @@
269 269 if (left > (long)alpha_pmu->pmc_max_period[idx])
270 270 left = alpha_pmu->pmc_max_period[idx];
271 271  
272   - atomic64_set(&hwc->prev_count, (unsigned long)(-left));
  272 + local64_set(&hwc->prev_count, (unsigned long)(-left));
273 273  
274 274 alpha_write_pmc(idx, (unsigned long)(-left));
275 275  
276 276  
... ... @@ -300,10 +300,10 @@
300 300 long delta;
301 301  
302 302 again:
303   - prev_raw_count = atomic64_read(&hwc->prev_count);
  303 + prev_raw_count = local64_read(&hwc->prev_count);
304 304 new_raw_count = alpha_read_pmc(idx);
305 305  
306   - if (atomic64_cmpxchg(&hwc->prev_count, prev_raw_count,
  306 + if (local64_cmpxchg(&hwc->prev_count, prev_raw_count,
307 307 new_raw_count) != prev_raw_count)
308 308 goto again;
309 309  
... ... @@ -316,8 +316,8 @@
316 316 delta += alpha_pmu->pmc_max_period[idx] + 1;
317 317 }
318 318  
319   - atomic64_add(delta, &event->count);
320   - atomic64_sub(delta, &hwc->period_left);
  319 + local64_add(delta, &event->count);
  320 + local64_sub(delta, &hwc->period_left);
321 321  
322 322 return new_raw_count;
323 323 }
... ... @@ -636,7 +636,7 @@
636 636 if (!hwc->sample_period) {
637 637 hwc->sample_period = alpha_pmu->pmc_max_period[0];
638 638 hwc->last_period = hwc->sample_period;
639   - atomic64_set(&hwc->period_left, hwc->sample_period);
  639 + local64_set(&hwc->period_left, hwc->sample_period);
640 640 }
641 641  
642 642 return 0;