Skip to contentSkip to conversation

fix oprofile multiple counters

PATCH New John Levon 1 participant 1 message Oct 30, 2002

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 fix oprofile multiple counters

Linus, the below ensures we deal properly with multiple perfctr overflow interrupts under high load.

Please apply

thanks
john

arch/i386/oprofile/op_model_athlon.c +2 -3
diff -Naur -X dontdiff linux-linus/arch/i386/oprofile/op_model_athlon.c linux/arch/i386/oprofile/op_model_athlon.c
@@ -95,17 +95,16 @@
 			      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;
 }
 
  
arch/i386/oprofile/op_model_ppro.c +2 -3
diff -Naur -X dontdiff linux-linus/arch/i386/oprofile/op_model_ppro.c linux/arch/i386/oprofile/op_model_ppro.c
@@ -90,17 +90,16 @@
 {
 	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;
 }