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