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 probe: Init struct probe_point and set counter correctly
hw-breakpoint: Keep track of dr7 local enable bits
hw-breakpoints: Accept breakpoints on NULL address
perf_events: Fix FORK events

+22 -31
+2
arch/x86/include/asm/processor.h
··· 450 450 struct perf_event *ptrace_bps[HBP_NUM]; 451 451 /* Debug status used for traps, single steps, etc... */ 452 452 unsigned long debugreg6; 453 + /* Keep track of the exact dr7 value set by the user */ 454 + unsigned long ptrace_dr7; 453 455 /* Fault info: */ 454 456 unsigned long cr2; 455 457 unsigned long trap_no;
+7 -23
arch/x86/kernel/hw_breakpoint.c
··· 212 212 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); 213 213 } 214 214 215 - /* 216 - * Store a breakpoint's encoded address, length, and type. 217 - */ 218 - static int arch_store_info(struct perf_event *bp) 219 - { 220 - struct arch_hw_breakpoint *info = counter_arch_bp(bp); 221 - /* 222 - * For kernel-addresses, either the address or symbol name can be 223 - * specified. 224 - */ 225 - if (info->name) 226 - info->address = (unsigned long) 227 - kallsyms_lookup_name(info->name); 228 - if (info->address) 229 - return 0; 230 - 231 - return -EINVAL; 232 - } 233 - 234 215 int arch_bp_generic_fields(int x86_len, int x86_type, 235 216 int *gen_len, int *gen_type) 236 217 { ··· 343 362 return ret; 344 363 } 345 364 346 - ret = arch_store_info(bp); 347 - 348 - if (ret < 0) 349 - return ret; 365 + /* 366 + * For kernel-addresses, either the address or symbol name can be 367 + * specified. 368 + */ 369 + if (info->name) 370 + info->address = (unsigned long) 371 + kallsyms_lookup_name(info->name); 350 372 /* 351 373 * Check that the low-order bits of the address are appropriate 352 374 * for the alignment implied by len.
+5 -2
arch/x86/kernel/ptrace.c
··· 702 702 } else if (n == 6) { 703 703 val = thread->debugreg6; 704 704 } else if (n == 7) { 705 - val = ptrace_get_dr7(thread->ptrace_bps); 705 + val = thread->ptrace_dr7; 706 706 } 707 707 return val; 708 708 } ··· 778 778 return rc; 779 779 } 780 780 /* All that's left is DR7 */ 781 - if (n == 7) 781 + if (n == 7) { 782 782 rc = ptrace_write_dr7(tsk, val); 783 + if (!rc) 784 + thread->ptrace_dr7 = val; 785 + } 783 786 784 787 ret_path: 785 788 return rc;
+5 -6
kernel/perf_event.c
··· 3259 3259 task_event->event_id.tid = perf_event_tid(event, task); 3260 3260 task_event->event_id.ptid = perf_event_tid(event, current); 3261 3261 3262 - task_event->event_id.time = perf_clock(); 3263 - 3264 3262 perf_output_put(&handle, task_event->event_id); 3265 3263 3266 3264 perf_output_end(&handle); ··· 3266 3268 3267 3269 static int perf_event_task_match(struct perf_event *event) 3268 3270 { 3269 - if (event->state != PERF_EVENT_STATE_ACTIVE) 3271 + if (event->state < PERF_EVENT_STATE_INACTIVE) 3270 3272 return 0; 3271 3273 3272 3274 if (event->cpu != -1 && event->cpu != smp_processor_id()) ··· 3298 3300 cpuctx = &get_cpu_var(perf_cpu_context); 3299 3301 perf_event_task_ctx(&cpuctx->ctx, task_event); 3300 3302 if (!ctx) 3301 - ctx = rcu_dereference(task_event->task->perf_event_ctxp); 3303 + ctx = rcu_dereference(current->perf_event_ctxp); 3302 3304 if (ctx) 3303 3305 perf_event_task_ctx(ctx, task_event); 3304 3306 put_cpu_var(perf_cpu_context); ··· 3329 3331 /* .ppid */ 3330 3332 /* .tid */ 3331 3333 /* .ptid */ 3334 + .time = perf_clock(), 3332 3335 }, 3333 3336 }; 3334 3337 ··· 3379 3380 3380 3381 static int perf_event_comm_match(struct perf_event *event) 3381 3382 { 3382 - if (event->state != PERF_EVENT_STATE_ACTIVE) 3383 + if (event->state < PERF_EVENT_STATE_INACTIVE) 3383 3384 return 0; 3384 3385 3385 3386 if (event->cpu != -1 && event->cpu != smp_processor_id()) ··· 3499 3500 static int perf_event_mmap_match(struct perf_event *event, 3500 3501 struct perf_mmap_event *mmap_event) 3501 3502 { 3502 - if (event->state != PERF_EVENT_STATE_ACTIVE) 3503 + if (event->state < PERF_EVENT_STATE_INACTIVE) 3503 3504 return 0; 3504 3505 3505 3506 if (event->cpu != -1 && event->cpu != smp_processor_id())
+3
tools/perf/util/probe-event.c
··· 272 272 int ret; 273 273 274 274 pp->probes[0] = buf = zalloc(MAX_CMDLEN); 275 + pp->found = 1; 275 276 if (!buf) 276 277 die("Failed to allocate memory by zalloc."); 277 278 if (pp->offset) { ··· 295 294 error: 296 295 free(pp->probes[0]); 297 296 pp->probes[0] = NULL; 297 + pp->found = 0; 298 298 } 299 299 return ret; 300 300 } ··· 457 455 struct strlist *rawlist; 458 456 struct str_node *ent; 459 457 458 + memset(&pp, 0, sizeof(pp)); 460 459 fd = open_kprobe_events(O_RDONLY, 0); 461 460 rawlist = get_trace_kprobe_event_rawlist(fd); 462 461 close(fd);