Merge branch 'oprofile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'oprofile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
oprofile: Fix p6 counter overflow check
Cell OProfile: Incorrect local array size in activate spu profiling function
Revert "Cell OProfile: Incorrect local array size in activate spu profiling function"
oprofile: fix memory ordering
Cell OProfile: Incorrect local array size in activate spu profiling function
Change UTF8 chars in Kconfig help text about Oprofile AMD barcelona

+8 -9
+1 -1
arch/Kconfig
··· 21 Instruction-Based Sampling (IBS) is a new profiling 22 technique that provides rich, precise program performance 23 information. IBS is introduced by AMD Family10h processors 24 - (AMD Opteron Quad-Core processor “Barcelona”) to overcome 25 the limitations of conventional performance counter 26 sampling. 27
··· 21 Instruction-Based Sampling (IBS) is a new profiling 22 technique that provides rich, precise program performance 23 information. IBS is introduced by AMD Family10h processors 24 + (AMD Opteron Quad-Core processor "Barcelona") to overcome 25 the limitations of conventional performance counter 26 sampling. 27
+4 -5
arch/x86/oprofile/op_model_ppro.c
··· 27 static int counter_width = 32; 28 29 #define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) 30 - #define CTR_READ(l, h, msrs, c) do {rdmsr(msrs->counters[(c)].addr, (l), (h)); } while (0) 31 - #define CTR_OVERFLOWED(n) (!((n) & (1U<<(counter_width-1)))) 32 33 #define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) 34 #define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls[(c)].addr), (l), (h)); } while (0) ··· 123 static int ppro_check_ctrs(struct pt_regs * const regs, 124 struct op_msrs const * const msrs) 125 { 126 - unsigned int low, high; 127 int i; 128 129 for (i = 0 ; i < num_counters; ++i) { 130 if (!reset_value[i]) 131 continue; 132 - CTR_READ(low, high, msrs, i); 133 - if (CTR_OVERFLOWED(low)) { 134 oprofile_add_sample(regs, i); 135 wrmsrl(msrs->counters[i].addr, -reset_value[i]); 136 }
··· 27 static int counter_width = 32; 28 29 #define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) 30 + #define CTR_OVERFLOWED(n) (!((n) & (1ULL<<(counter_width-1)))) 31 32 #define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) 33 #define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls[(c)].addr), (l), (h)); } while (0) ··· 124 static int ppro_check_ctrs(struct pt_regs * const regs, 125 struct op_msrs const * const msrs) 126 { 127 + u64 val; 128 int i; 129 130 for (i = 0 ; i < num_counters; ++i) { 131 if (!reset_value[i]) 132 continue; 133 + rdmsrl(msrs->counters[i].addr, val); 134 + if (CTR_OVERFLOWED(val)) { 135 oprofile_add_sample(regs, i); 136 wrmsrl(msrs->counters[i].addr, -reset_value[i]); 137 }
+3 -3
drivers/oprofile/event_buffer.c
··· 105 if (!capable(CAP_SYS_ADMIN)) 106 return -EPERM; 107 108 - if (test_and_set_bit(0, &buffer_opened)) 109 return -EBUSY; 110 111 /* Register as a user of dcookies ··· 129 fail: 130 dcookie_unregister(file->private_data); 131 out: 132 - clear_bit(0, &buffer_opened); 133 return err; 134 } 135 ··· 141 dcookie_unregister(file->private_data); 142 buffer_pos = 0; 143 atomic_set(&buffer_ready, 0); 144 - clear_bit(0, &buffer_opened); 145 return 0; 146 } 147
··· 105 if (!capable(CAP_SYS_ADMIN)) 106 return -EPERM; 107 108 + if (test_and_set_bit_lock(0, &buffer_opened)) 109 return -EBUSY; 110 111 /* Register as a user of dcookies ··· 129 fail: 130 dcookie_unregister(file->private_data); 131 out: 132 + __clear_bit_unlock(0, &buffer_opened); 133 return err; 134 } 135 ··· 141 dcookie_unregister(file->private_data); 142 buffer_pos = 0; 143 atomic_set(&buffer_ready, 0); 144 + __clear_bit_unlock(0, &buffer_opened); 145 return 0; 146 } 147