aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Cree <mcree@orcon.net.nz>2010-08-31 22:46:04 -0400
committerMatt Turner <mattst88@gmail.com>2010-08-31 22:46:04 -0400
commit7b598cdd03e35a4361f4ff7ebc630aa508c35be6 (patch)
tree0d1c9d755a577825bcc8152e914230c09af632c9 /arch
parent59b25ed91400ace98d6cf0d59b1cb6928ad5cd37 (diff)
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/perf_event.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c
index 51c39fa41693..85d8e4f58c83 100644
--- a/arch/alpha/kernel/perf_event.c
+++ b/arch/alpha/kernel/perf_event.c
@@ -241,20 +241,20 @@ static inline unsigned long alpha_read_pmc(int idx)
241static int alpha_perf_event_set_period(struct perf_event *event, 241static int alpha_perf_event_set_period(struct perf_event *event,
242 struct hw_perf_event *hwc, int idx) 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 long period = hwc->sample_period; 245 long period = hwc->sample_period;
246 int ret = 0; 246 int ret = 0;
247 247
248 if (unlikely(left <= -period)) { 248 if (unlikely(left <= -period)) {
249 left = period; 249 left = period;
250 atomic64_set(&hwc->period_left, left); 250 local64_set(&hwc->period_left, left);
251 hwc->last_period = period; 251 hwc->last_period = period;
252 ret = 1; 252 ret = 1;
253 } 253 }
254 254
255 if (unlikely(left <= 0)) { 255 if (unlikely(left <= 0)) {
256 left += period; 256 left += period;
257 atomic64_set(&hwc->period_left, left); 257 local64_set(&hwc->period_left, left);
258 hwc->last_period = period; 258 hwc->last_period = period;
259 ret = 1; 259 ret = 1;
260 } 260 }
@@ -269,7 +269,7 @@ static int alpha_perf_event_set_period(struct perf_event *event,
269 if (left > (long)alpha_pmu->pmc_max_period[idx]) 269 if (left > (long)alpha_pmu->pmc_max_period[idx])
270 left = alpha_pmu->pmc_max_period[idx]; 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 alpha_write_pmc(idx, (unsigned long)(-left)); 274 alpha_write_pmc(idx, (unsigned long)(-left));
275 275
@@ -300,10 +300,10 @@ static unsigned long alpha_perf_event_update(struct perf_event *event,
300 long delta; 300 long delta;
301 301
302again: 302again:
303 prev_raw_count = atomic64_read(&hwc->prev_count); 303 prev_raw_count = local64_read(&hwc->prev_count);
304 new_raw_count = alpha_read_pmc(idx); 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 new_raw_count) != prev_raw_count) 307 new_raw_count) != prev_raw_count)
308 goto again; 308 goto again;
309 309
@@ -316,8 +316,8 @@ again:
316 delta += alpha_pmu->pmc_max_period[idx] + 1; 316 delta += alpha_pmu->pmc_max_period[idx] + 1;
317 } 317 }
318 318
319 atomic64_add(delta, &event->count); 319 local64_add(delta, &event->count);
320 atomic64_sub(delta, &hwc->period_left); 320 local64_sub(delta, &hwc->period_left);
321 321
322 return new_raw_count; 322 return new_raw_count;
323} 323}
@@ -636,7 +636,7 @@ static int __hw_perf_event_init(struct perf_event *event)
636 if (!hwc->sample_period) { 636 if (!hwc->sample_period) {
637 hwc->sample_period = alpha_pmu->pmc_max_period[0]; 637 hwc->sample_period = alpha_pmu->pmc_max_period[0];
638 hwc->last_period = hwc->sample_period; 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 return 0; 642 return 0;