]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] fix oprofile multiple counters
authorJohn Levon <levon@movementarian.org>
Tue, 29 Oct 2002 13:16:02 +0000 (05:16 -0800)
committerAnton Blanchard <anton@samba.org>
Tue, 29 Oct 2002 13:16:02 +0000 (05:16 -0800)
This ensures we deal properly with multiple perfctr overflow interrupts
under high load.

arch/i386/oprofile/op_model_athlon.c
arch/i386/oprofile/op_model_ppro.c

index 9d0b71c3d0474571d420738c0f01c10d31a6e3d9..b4aabede5531c29247220b1ab9aa33878332fe31 100644 (file)
@@ -95,17 +95,16 @@ static int athlon_check_ctrs(unsigned int const cpu,
                              struct pt_regs * const regs)
 {
        unsigned int low, high;
-       int handled = 0;
        int i;
        for (i = 0 ; i < NUM_COUNTERS; ++i) {
                CTR_READ(low, high, msrs, i);
                if (CTR_OVERFLOWED(low)) {
                        oprofile_add_sample(regs->eip, i, cpu);
                        CTR_WRITE(reset_value[i], msrs, i);
-                       handled = 1;
+                       return 1;
                }
        }
-       return handled;
+       return 0;
 }
 
  
index 9252e01bef1eb92ddbc29f20191d9456b638739e..0f00c4d1e92480ebf36636ce9092557c206afd60 100644 (file)
@@ -90,17 +90,16 @@ static int ppro_check_ctrs(unsigned int const cpu,
 {
        unsigned int low, high;
        int i;
-       int handled = 0;
  
        for (i = 0 ; i < NUM_COUNTERS; ++i) {
                CTR_READ(low, high, msrs, i);
                if (CTR_OVERFLOWED(low)) {
                        oprofile_add_sample(regs->eip, i, cpu);
                        CTR_WRITE(reset_value[i], msrs, i);
-                       handled = 1;
+                       return 1;
                }
        }
-       return handled;
+       return 0;
 }