Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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:
x86: Fix text_poke_smp_batch() deadlock
perf tools: Fix thread_map event synthesizing in top and record
watchdog, nmi: Lower the severity of error messages
ARM: oprofile: Fix backtraces in timer mode
oprofile: Fix usage of CONFIG_HW_PERF_EVENTS for oprofile_perf_init and friends

+42 -25
+2 -10
arch/arm/oprofile/common.c
··· 10 10 */ 11 11 12 12 #include <linux/cpumask.h> 13 - #include <linux/err.h> 14 - #include <linux/errno.h> 15 13 #include <linux/init.h> 16 14 #include <linux/mutex.h> 17 15 #include <linux/oprofile.h> ··· 44 46 return NULL; 45 47 } 46 48 } 49 + #endif 47 50 48 51 static int report_trace(struct stackframe *frame, void *d) 49 52 { ··· 110 111 111 112 int __init oprofile_arch_init(struct oprofile_operations *ops) 112 113 { 114 + /* provide backtrace support also in timer mode: */ 113 115 ops->backtrace = arm_backtrace; 114 116 115 117 return oprofile_perf_init(ops); ··· 120 120 { 121 121 oprofile_perf_exit(); 122 122 } 123 - #else 124 - int __init oprofile_arch_init(struct oprofile_operations *ops) 125 - { 126 - pr_info("oprofile: hardware counters not available\n"); 127 - return -ENODEV; 128 - } 129 - void __exit oprofile_arch_exit(void) {} 130 - #endif /* CONFIG_HW_PERF_EVENTS */
+1 -1
arch/x86/kernel/alternative.c
··· 671 671 672 672 atomic_set(&stop_machine_first, 1); 673 673 wrote_text = 0; 674 - stop_machine(stop_machine_text_poke, (void *)&tpp, NULL); 674 + __stop_machine(stop_machine_text_poke, (void *)&tpp, NULL); 675 675 } 676 676 677 677 #if defined(CONFIG_DYNAMIC_FTRACE) || defined(HAVE_JUMP_LABEL)
+11 -2
include/linux/oprofile.h
··· 16 16 #include <linux/types.h> 17 17 #include <linux/spinlock.h> 18 18 #include <linux/init.h> 19 + #include <linux/errno.h> 20 + #include <linux/printk.h> 19 21 #include <asm/atomic.h> 20 22 21 23 /* Each escaped entry is prefixed by ESCAPE_CODE ··· 188 186 int oprofile_add_data64(struct op_entry *entry, u64 val); 189 187 int oprofile_write_commit(struct op_entry *entry); 190 188 191 - #ifdef CONFIG_PERF_EVENTS 189 + #ifdef CONFIG_HW_PERF_EVENTS 192 190 int __init oprofile_perf_init(struct oprofile_operations *ops); 193 191 void oprofile_perf_exit(void); 194 192 char *op_name_from_perf_id(void); 195 - #endif /* CONFIG_PERF_EVENTS */ 193 + #else 194 + static inline int __init oprofile_perf_init(struct oprofile_operations *ops) 195 + { 196 + pr_info("oprofile: hardware counters not available\n"); 197 + return -ENODEV; 198 + } 199 + static inline void oprofile_perf_exit(void) { } 200 + #endif /* CONFIG_HW_PERF_EVENTS */ 196 201 197 202 #endif /* OPROFILE_H */
+8 -2
kernel/watchdog.c
··· 363 363 goto out_save; 364 364 } 365 365 366 - printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n", 367 - cpu, PTR_ERR(event)); 366 + 367 + /* vary the KERN level based on the returned errno */ 368 + if (PTR_ERR(event) == -EOPNOTSUPP) 369 + printk(KERN_INFO "NMI watchdog disabled (cpu%i): not supported (no LAPIC?)\n", cpu); 370 + else if (PTR_ERR(event) == -ENOENT) 371 + printk(KERN_WARNING "NMI watchdog disabled (cpu%i): hardware events not enabled\n", cpu); 372 + else 373 + printk(KERN_ERR "NMI watchdog disabled (cpu%i): unable to create perf event: %ld\n", cpu, PTR_ERR(event)); 368 374 return PTR_ERR(event); 369 375 370 376 /* success path */
+2 -2
tools/perf/builtin-record.c
··· 759 759 perf_session__process_machines(session, event__synthesize_guest_os); 760 760 761 761 if (!system_wide) 762 - event__synthesize_thread(target_tid, process_synthesized_event, 763 - session); 762 + event__synthesize_thread_map(threads, process_synthesized_event, 763 + session); 764 764 else 765 765 event__synthesize_threads(process_synthesized_event, session); 766 766
+1 -1
tools/perf/builtin-top.c
··· 1306 1306 return -ENOMEM; 1307 1307 1308 1308 if (target_tid != -1) 1309 - event__synthesize_thread(target_tid, event__process, session); 1309 + event__synthesize_thread_map(threads, event__process, session); 1310 1310 else 1311 1311 event__synthesize_threads(event__process, session); 1312 1312
+13 -5
tools/perf/util/event.c
··· 263 263 process, session); 264 264 } 265 265 266 - int event__synthesize_thread(pid_t pid, event__handler_t process, 267 - struct perf_session *session) 266 + int event__synthesize_thread_map(struct thread_map *threads, 267 + event__handler_t process, 268 + struct perf_session *session) 268 269 { 269 270 event_t *comm_event, *mmap_event; 270 - int err = -1; 271 + int err = -1, thread; 271 272 272 273 comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); 273 274 if (comm_event == NULL) ··· 278 277 if (mmap_event == NULL) 279 278 goto out_free_comm; 280 279 281 - err = __event__synthesize_thread(comm_event, mmap_event, pid, 282 - process, session); 280 + err = 0; 281 + for (thread = 0; thread < threads->nr; ++thread) { 282 + if (__event__synthesize_thread(comm_event, mmap_event, 283 + threads->map[thread], 284 + process, session)) { 285 + err = -1; 286 + break; 287 + } 288 + } 283 289 free(mmap_event); 284 290 out_free_comm: 285 291 free(comm_event);
+4 -2
tools/perf/util/event.h
··· 135 135 void event__print_totals(void); 136 136 137 137 struct perf_session; 138 + struct thread_map; 138 139 139 140 typedef int (*event__handler_synth_t)(event_t *event, 140 141 struct perf_session *session); 141 142 typedef int (*event__handler_t)(event_t *event, struct sample_data *sample, 142 143 struct perf_session *session); 143 144 144 - int event__synthesize_thread(pid_t pid, event__handler_t process, 145 - struct perf_session *session); 145 + int event__synthesize_thread_map(struct thread_map *threads, 146 + event__handler_t process, 147 + struct perf_session *session); 146 148 int event__synthesize_threads(event__handler_t process, 147 149 struct perf_session *session); 148 150 int event__synthesize_kernel_mmap(event__handler_t process,