Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327338
b: refs/heads/master
c: b4f061a
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Aug 19, 2012
1 parent 6c0ac07 commit 77441aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 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: 5ab968413515e17788003c522f7ca40a07fae900
refs/heads/master: b4f061a4b8cbf947de4fa816a1cfc53960da218e
20 changes: 14 additions & 6 deletions trunk/arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,27 +623,35 @@ static u64 nop_for_index(int idx)
static inline void sparc_pmu_enable_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc, int idx)
{
u64 val, mask = mask_for_index(idx);
int pcr_index = 0;

val = cpuc->pcr[0];
if (sparc_pmu->num_pcrs > 1)
pcr_index = idx;

val = cpuc->pcr[pcr_index];
val &= ~mask;
val |= hwc->config;
cpuc->pcr[0] = val;
cpuc->pcr[pcr_index] = val;

pcr_ops->write_pcr(0, cpuc->pcr[0]);
pcr_ops->write_pcr(pcr_index, cpuc->pcr[pcr_index]);
}

static inline void sparc_pmu_disable_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc, int idx)
{
u64 mask = mask_for_index(idx);
u64 nop = nop_for_index(idx);
int pcr_index = 0;
u64 val;

val = cpuc->pcr[0];
if (sparc_pmu->num_pcrs > 1)
pcr_index = idx;

val = cpuc->pcr[pcr_index];
val &= ~mask;
val |= nop;
cpuc->pcr[0] = val;
cpuc->pcr[pcr_index] = val;

pcr_ops->write_pcr(0, cpuc->pcr[0]);
pcr_ops->write_pcr(pcr_index, cpuc->pcr[pcr_index]);
}

static u64 sparc_perf_event_update(struct perf_event *event,
Expand Down

0 comments on commit 77441aa

Please sign in to comment.