Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245428
b: refs/heads/master
c: c8e5910
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Apr 19, 2011
1 parent 05f969c commit ac68e74
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: 68d2cf25d39324c54b5e42de7915c623a0917abe
refs/heads/master: c8e5910edf8bbe2e5c6c35a4ef2a578cc7893b25
15 changes: 11 additions & 4 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <asm/nmi.h>
#include <asm/compat.h>
#include <asm/smp.h>
#include <asm/alternative.h>

#if 0
#undef wrmsrl
Expand Down Expand Up @@ -363,12 +364,18 @@ x86_perf_event_update(struct perf_event *event)
return new_raw_count;
}

/* using X86_FEATURE_PERFCTR_CORE to later implement ALTERNATIVE() here */
static inline int x86_pmu_addr_offset(int index)
{
if (boot_cpu_has(X86_FEATURE_PERFCTR_CORE))
return index << 1;
return index;
int offset;

/* offset = X86_FEATURE_PERFCTR_CORE ? index << 1 : index */
alternative_io(ASM_NOP2,
"shll $1, %%eax",
X86_FEATURE_PERFCTR_CORE,
"=a" (offset),
"a" (index));

return offset;
}

static inline unsigned int x86_pmu_config_addr(int index)
Expand Down

0 comments on commit ac68e74

Please sign in to comment.