Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118607
b: refs/heads/master
c: 7c64ade
h: refs/heads/master
i:
  118605: 6e13996
  118603: ce8eb6c
  118599: 38c149f
  118591: 261e0d0
v: v3
  • Loading branch information
Andi Kleen authored and Robert Richter committed Nov 7, 2008
1 parent 6a200bf commit 80aafcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 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: 99219b4f3e0772a11fc0d98213b00e89fee7b049
refs/heads/master: 7c64ade53a6f977d73f16243865c42ceae999aea
9 changes: 4 additions & 5 deletions trunk/arch/x86/oprofile/op_model_ppro.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ static int num_counters = 2;
static int counter_width = 32;

#define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0)
#define CTR_READ(l, h, msrs, c) do {rdmsr(msrs->counters[(c)].addr, (l), (h)); } while (0)
#define CTR_OVERFLOWED(n) (!((n) & (1U<<(counter_width-1))))
#define CTR_OVERFLOWED(n) (!((n) & (1ULL<<(counter_width-1))))

#define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0)
#define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls[(c)].addr), (l), (h)); } while (0)
Expand Down Expand Up @@ -124,14 +123,14 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
static int ppro_check_ctrs(struct pt_regs * const regs,
struct op_msrs const * const msrs)
{
unsigned int low, high;
u64 val;
int i;

for (i = 0 ; i < num_counters; ++i) {
if (!reset_value[i])
continue;
CTR_READ(low, high, msrs, i);
if (CTR_OVERFLOWED(low)) {
rdmsrl(msrs->counters[i].addr, val);
if (CTR_OVERFLOWED(val)) {
oprofile_add_sample(regs, i);
wrmsrl(msrs->counters[i].addr, -reset_value[i]);
}
Expand Down

0 comments on commit 80aafcf

Please sign in to comment.