diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-26 17:28:17 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-26 17:28:17 -0500 |
| commit | d2f30c73aba19be828c759edcd21140390cd06e4 (patch) | |
| tree | b9bad75b11e21680f8f9443f0143d62be23cae78 | |
| parent | 1b065fdff1c950d96e4c571abe873a9a8aaa6d51 (diff) | |
| parent | 02a9d03772aa1ff33a26180a2da0bfb191240eda (diff) | |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf symbols: Remove incorrect open-coded container_of()
perf record: Handle restrictive permissions in /proc/{kallsyms,modules}
x86/kprobes: Prevent kprobes to probe on save_args()
irq_work: Drop cmpxchg() result
perf: Fix owner-list vs exit
x86, hw_nmi: Move backtrace_mask declaration under ARCH_HAS_NMI_WATCHDOG
tracing: Fix recursive user stack trace
perf,hw_breakpoint: Initialize hardware api earlier
x86: Ignore trap bits on single step exceptions
tracing: Force arch_local_irq_* notrace for paravirt
tracing: Fix module use of trace_bprintk()
| -rw-r--r-- | arch/x86/include/asm/paravirt.h | 10 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/hw_nmi.c | 7 | ||||
| -rw-r--r-- | arch/x86/kernel/entry_64.S | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/hw_breakpoint.c | 4 | ||||
| -rw-r--r-- | include/linux/hw_breakpoint.h | 4 | ||||
| -rw-r--r-- | kernel/hw_breakpoint.c | 3 | ||||
| -rw-r--r-- | kernel/irq_work.c | 4 | ||||
| -rw-r--r-- | kernel/module.c | 12 | ||||
| -rw-r--r-- | kernel/perf_event.c | 69 | ||||
| -rw-r--r-- | kernel/trace/trace.c | 19 | ||||
| -rw-r--r-- | tools/perf/builtin-record.c | 17 | ||||
| -rw-r--r-- | tools/perf/util/symbol.c | 4 |
12 files changed, 123 insertions, 32 deletions
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 18e3b8a8709f..ef9975812c77 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
| @@ -824,27 +824,27 @@ static __always_inline void arch_spin_unlock(struct arch_spinlock *lock) | |||
| 824 | #define __PV_IS_CALLEE_SAVE(func) \ | 824 | #define __PV_IS_CALLEE_SAVE(func) \ |
| 825 | ((struct paravirt_callee_save) { func }) | 825 | ((struct paravirt_callee_save) { func }) |
| 826 | 826 | ||
| 827 | static inline unsigned long arch_local_save_flags(void) | 827 | static inline notrace unsigned long arch_local_save_flags(void) |
| 828 | { | 828 | { |
| 829 | return PVOP_CALLEE0(unsigned long, pv_irq_ops.save_fl); | 829 | return PVOP_CALLEE0(unsigned long, pv_irq_ops.save_fl); |
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | static inline void arch_local_irq_restore(unsigned long f) | 832 | static inline notrace void arch_local_irq_restore(unsigned long f) |
| 833 | { | 833 | { |
| 834 | PVOP_VCALLEE1(pv_irq_ops.restore_fl, f); | 834 | PVOP_VCALLEE1(pv_irq_ops.restore_fl, f); |
| 835 | } | 835 | } |
| 836 | 836 | ||
| 837 | static inline void arch_local_irq_disable(void) | 837 | static inline notrace void arch_local_irq_disable(void) |
| 838 | { | 838 | { |
| 839 | PVOP_VCALLEE0(pv_irq_ops.irq_disable); | 839 | PVOP_VCALLEE0(pv_irq_ops.irq_disable); |
| 840 | } | 840 | } |
| 841 | 841 | ||
| 842 | static inline void arch_local_irq_enable(void) | 842 | static inline notrace void arch_local_irq_enable(void) |
| 843 | { | 843 | { |
| 844 | PVOP_VCALLEE0(pv_irq_ops.irq_enable); | 844 | PVOP_VCALLEE0(pv_irq_ops.irq_enable); |
| 845 | } | 845 | } |
| 846 | 846 | ||
| 847 | static inline unsigned long arch_local_irq_save(void) | 847 | static inline notrace unsigned long arch_local_irq_save(void) |
| 848 | { | 848 | { |
| 849 | unsigned long f; | 849 | unsigned long f; |
| 850 | 850 | ||
diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c index cefd6942f0e9..62f6e1e55b90 100644 --- a/arch/x86/kernel/apic/hw_nmi.c +++ b/arch/x86/kernel/apic/hw_nmi.c | |||
| @@ -17,15 +17,16 @@ | |||
| 17 | #include <linux/nmi.h> | 17 | #include <linux/nmi.h> |
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | 19 | ||
| 20 | /* For reliability, we're prepared to waste bits here. */ | ||
| 21 | static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly; | ||
| 22 | |||
| 23 | u64 hw_nmi_get_sample_period(void) | 20 | u64 hw_nmi_get_sample_period(void) |
| 24 | { | 21 | { |
| 25 | return (u64)(cpu_khz) * 1000 * 60; | 22 | return (u64)(cpu_khz) * 1000 * 60; |
| 26 | } | 23 | } |
| 27 | 24 | ||
| 28 | #ifdef ARCH_HAS_NMI_WATCHDOG | 25 | #ifdef ARCH_HAS_NMI_WATCHDOG |
| 26 | |||
| 27 | /* For reliability, we're prepared to waste bits here. */ | ||
| 28 | static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly; | ||
| 29 | |||
| 29 | void arch_trigger_all_cpu_backtrace(void) | 30 | void arch_trigger_all_cpu_backtrace(void) |
| 30 | { | 31 | { |
| 31 | int i; | 32 | int i; |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index fe2690d71c0c..e3ba417e8697 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
| @@ -295,6 +295,7 @@ ENDPROC(native_usergs_sysret64) | |||
| 295 | .endm | 295 | .endm |
| 296 | 296 | ||
| 297 | /* save partial stack frame */ | 297 | /* save partial stack frame */ |
| 298 | .pushsection .kprobes.text, "ax" | ||
| 298 | ENTRY(save_args) | 299 | ENTRY(save_args) |
| 299 | XCPT_FRAME | 300 | XCPT_FRAME |
| 300 | cld | 301 | cld |
| @@ -334,6 +335,7 @@ ENTRY(save_args) | |||
| 334 | ret | 335 | ret |
| 335 | CFI_ENDPROC | 336 | CFI_ENDPROC |
| 336 | END(save_args) | 337 | END(save_args) |
| 338 | .popsection | ||
| 337 | 339 | ||
| 338 | ENTRY(save_rest) | 340 | ENTRY(save_rest) |
| 339 | PARTIAL_FRAME 1 REST_SKIP+8 | 341 | PARTIAL_FRAME 1 REST_SKIP+8 |
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index ff15c9dcc25d..42c594254507 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c | |||
| @@ -433,6 +433,10 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args) | |||
| 433 | dr6_p = (unsigned long *)ERR_PTR(args->err); | 433 | dr6_p = (unsigned long *)ERR_PTR(args->err); |
| 434 | dr6 = *dr6_p; | 434 | dr6 = *dr6_p; |
| 435 | 435 | ||
| 436 | /* If it's a single step, TRAP bits are random */ | ||
| 437 | if (dr6 & DR_STEP) | ||
| 438 | return NOTIFY_DONE; | ||
| 439 | |||
| 436 | /* Do an early return if no trap bits are set in DR6 */ | 440 | /* Do an early return if no trap bits are set in DR6 */ |
| 437 | if ((dr6 & DR_TRAP_BITS) == 0) | 441 | if ((dr6 & DR_TRAP_BITS) == 0) |
| 438 | return NOTIFY_DONE; | 442 | return NOTIFY_DONE; |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index a2d6ea49ec56..d1e55fed2c7d 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
| @@ -33,6 +33,8 @@ enum bp_type_idx { | |||
| 33 | 33 | ||
| 34 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 34 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| 35 | 35 | ||
| 36 | extern int __init init_hw_breakpoint(void); | ||
| 37 | |||
| 36 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) | 38 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) |
| 37 | { | 39 | { |
| 38 | memset(attr, 0, sizeof(*attr)); | 40 | memset(attr, 0, sizeof(*attr)); |
| @@ -108,6 +110,8 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | |||
| 108 | 110 | ||
| 109 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ | 111 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ |
| 110 | 112 | ||
| 113 | static inline int __init init_hw_breakpoint(void) { return 0; } | ||
| 114 | |||
| 111 | static inline struct perf_event * | 115 | static inline struct perf_event * |
| 112 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 116 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
| 113 | perf_overflow_handler_t triggered, | 117 | perf_overflow_handler_t triggered, |
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c index 2c9120f0afca..e5325825aeb6 100644 --- a/kernel/hw_breakpoint.c +++ b/kernel/hw_breakpoint.c | |||
| @@ -620,7 +620,7 @@ static struct pmu perf_breakpoint = { | |||
| 620 | .read = hw_breakpoint_pmu_read, | 620 | .read = hw_breakpoint_pmu_read, |
| 621 | }; | 621 | }; |
| 622 | 622 | ||
| 623 | static int __init init_hw_breakpoint(void) | 623 | int __init init_hw_breakpoint(void) |
| 624 | { | 624 | { |
| 625 | unsigned int **task_bp_pinned; | 625 | unsigned int **task_bp_pinned; |
| 626 | int cpu, err_cpu; | 626 | int cpu, err_cpu; |
| @@ -655,6 +655,5 @@ static int __init init_hw_breakpoint(void) | |||
| 655 | 655 | ||
| 656 | return -ENOMEM; | 656 | return -ENOMEM; |
| 657 | } | 657 | } |
| 658 | core_initcall(init_hw_breakpoint); | ||
| 659 | 658 | ||
| 660 | 659 | ||
diff --git a/kernel/irq_work.c b/kernel/irq_work.c index f16763ff8481..90f881904bb1 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c | |||
| @@ -145,7 +145,9 @@ void irq_work_run(void) | |||
| 145 | * Clear the BUSY bit and return to the free state if | 145 | * Clear the BUSY bit and return to the free state if |
| 146 | * no-one else claimed it meanwhile. | 146 | * no-one else claimed it meanwhile. |
| 147 | */ | 147 | */ |
| 148 | cmpxchg(&entry->next, next_flags(NULL, IRQ_WORK_BUSY), NULL); | 148 | (void)cmpxchg(&entry->next, |
| 149 | next_flags(NULL, IRQ_WORK_BUSY), | ||
| 150 | NULL); | ||
| 149 | } | 151 | } |
| 150 | } | 152 | } |
| 151 | EXPORT_SYMBOL_GPL(irq_work_run); | 153 | EXPORT_SYMBOL_GPL(irq_work_run); |
diff --git a/kernel/module.c b/kernel/module.c index 437a74a7524a..d190664f25ff 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -2326,6 +2326,18 @@ static void find_module_sections(struct module *mod, struct load_info *info) | |||
| 2326 | kmemleak_scan_area(mod->trace_events, sizeof(*mod->trace_events) * | 2326 | kmemleak_scan_area(mod->trace_events, sizeof(*mod->trace_events) * |
| 2327 | mod->num_trace_events, GFP_KERNEL); | ||
