Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350053
b: refs/heads/master
c: 0fbdad0
h: refs/heads/master
i:
  350051: 3e2b493
v: v3
  • Loading branch information
Jacob Shin authored and Ingo Molnar committed Feb 6, 2013
1 parent 89cdb59 commit 307e9dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 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: 4c1fd17a1cb32bc4f429c7a5ff9a91a3bffdb8fa
refs/heads/master: 0fbdad078a70ed72248c3d30fe32e45e83be00d1
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static inline void x86_assign_hw_event(struct perf_event *event,
} else {
hwc->config_base = x86_pmu_config_addr(hwc->idx);
hwc->event_base = x86_pmu_event_addr(hwc->idx);
hwc->event_base_rdpmc = hwc->idx;
hwc->event_base_rdpmc = x86_pmu_rdpmc_index(hwc->idx);
}
}

Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ struct x86_pmu {
unsigned eventsel;
unsigned perfctr;
int (*addr_offset)(int index, bool eventsel);
int (*rdpmc_index)(int index);
u64 (*event_map)(int);
int max_events;
int num_counters;
Expand Down Expand Up @@ -459,6 +460,11 @@ static inline unsigned int x86_pmu_event_addr(int index)
x86_pmu.addr_offset(index, false) : index);
}

static inline int x86_pmu_rdpmc_index(int index)
{
return x86_pmu.rdpmc_index ? x86_pmu.rdpmc_index(index) : index;
}

int x86_setup_perfctr(struct perf_event *event);

int x86_pmu_hw_config(struct perf_event *event);
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ static inline int amd_pmu_addr_offset(int index, bool eventsel)
return offset;
}

static inline int amd_pmu_rdpmc_index(int index)
{
return index;
}

static int amd_pmu_hw_config(struct perf_event *event)
{
int ret;
Expand Down Expand Up @@ -620,6 +625,7 @@ static __initconst const struct x86_pmu amd_pmu = {
.eventsel = MSR_K7_EVNTSEL0,
.perfctr = MSR_K7_PERFCTR0,
.addr_offset = amd_pmu_addr_offset,
.rdpmc_index = amd_pmu_rdpmc_index,
.event_map = amd_pmu_event_map,
.max_events = ARRAY_SIZE(amd_perfmon_event_map),
.num_counters = AMD64_NUM_COUNTERS,
Expand Down

0 comments on commit 307e9dd

Please sign in to comment.