Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367221
b: refs/heads/master
c: c6ac1e6
h: refs/heads/master
i:
  367219: 7d6afd3
v: v3
  • Loading branch information
James Hogan committed Mar 15, 2013
1 parent 442dad2 commit c7d9ab9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db59932f62386cdfd8510c27a83118c5e915e9ea
refs/heads/master: c6ac1e6edacc7e1fb0405d61f95a797c6a712411
12 changes: 10 additions & 2 deletions trunk/arch/metag/kernel/perf/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ int metag_pmu_event_set_period(struct perf_event *event,
if (left > (s64)metag_pmu->max_period)
left = metag_pmu->max_period;

if (metag_pmu->write)
metag_pmu->write(idx, (u64)(-left) & MAX_PERIOD);
if (metag_pmu->write) {
local64_set(&hwc->prev_count, -(s32)left);
metag_pmu->write(idx, -left & MAX_PERIOD);
}

perf_event_update_userpage(event);

Expand Down Expand Up @@ -651,6 +653,12 @@ static void metag_pmu_enable_counter(struct hw_perf_event *event, int idx)
* set to a specific value that needs preserving.
*/
tmp |= metag_in32(PERF_COUNT(idx)) & 0x00ffffff;
else
/*
* Older cores reset the counter on write, so prev_count needs
* resetting too so we can calculate a correct delta.
*/
local64_set(&event->prev_count, 0);

metag_out32(tmp, PERF_COUNT(idx));
unlock:
Expand Down

0 comments on commit c7d9ab9

Please sign in to comment.