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:
perf, x86: Fix incorrect branches event on AMD CPUs
perf tools: Fix find tids routine by excluding "." and ".."
x86: Send a SIGTRAP for user icebp traps

+22 -4
+2 -2
arch/x86/kernel/cpu/perf_event_amd.c
··· 102 102 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, 103 103 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0080, 104 104 [PERF_COUNT_HW_CACHE_MISSES] = 0x0081, 105 - [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4, 106 - [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5, 105 + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2, 106 + [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3, 107 107 }; 108 108 109 109 static u64 amd_pmu_event_map(int hw_event)
+10 -1
arch/x86/kernel/traps.c
··· 526 526 dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) 527 527 { 528 528 struct task_struct *tsk = current; 529 + int user_icebp = 0; 529 530 unsigned long dr6; 530 531 int si_code; 531 532 ··· 534 533 535 534 /* Filter out all the reserved bits which are preset to 1 */ 536 535 dr6 &= ~DR6_RESERVED; 536 + 537 + /* 538 + * If dr6 has no reason to give us about the origin of this trap, 539 + * then it's very likely the result of an icebp/int01 trap. 540 + * User wants a sigtrap for that. 541 + */ 542 + if (!dr6 && user_mode(regs)) 543 + user_icebp = 1; 537 544 538 545 /* Catch kmemcheck conditions first of all! */ 539 546 if ((dr6 & DR_STEP) && kmemcheck_trap(regs)) ··· 584 575 regs->flags &= ~X86_EFLAGS_TF; 585 576 } 586 577 si_code = get_si_code(tsk->thread.debugreg6); 587 - if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS)) 578 + if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) 588 579 send_sigtrap(tsk, regs, error_code, si_code); 589 580 preempt_conditional_cli(regs); 590 581
+10 -1
tools/perf/util/thread.c
··· 7 7 #include "util.h" 8 8 #include "debug.h" 9 9 10 + /* Skip "." and ".." directories */ 11 + static int filter(const struct dirent *dir) 12 + { 13 + if (dir->d_name[0] == '.') 14 + return 0; 15 + else 16 + return 1; 17 + } 18 + 10 19 int find_all_tid(int pid, pid_t ** all_tid) 11 20 { 12 21 char name[256]; ··· 25 16 int i; 26 17 27 18 sprintf(name, "/proc/%d/task", pid); 28 - items = scandir(name, &namelist, NULL, NULL); 19 + items = scandir(name, &namelist, filter, NULL); 29 20 if (items <= 0) 30 21 return -ENOENT; 31 22 *all_tid = malloc(sizeof(pid_t) * items);