Skip to content

Commit

Permalink
sparc64: Fix maybe_change_configuration() PCR setting.
Browse files Browse the repository at this point in the history
Need to mask out the existing event bits before OR'ing in
the new ones.

Noticed by Peter Zijlstra.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 23, 2010
1 parent 0d0659c commit b7d45c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ static u64 maybe_change_configuration(struct cpu_hw_events *cpuc, u64 pcr)
cpuc->current_idx[i] = idx;

enc = perf_event_get_enc(cpuc->events[i]);
pcr &= ~mask_for_index(idx);
pcr |= event_encoding(enc, idx);
}
out:
Expand Down

0 comments on commit b7d45c3

Please sign in to comment.