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-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
"Tooling fixes: a 'perf record' deadlock fix plus debuggability fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf top: Show backtrace when handling a SIGSEGV on --stdio mode
perf tools: Fix buildid processing
perf tools: Make fork event processing more resilient
perf tools: Avoid deadlock when map_groups are broken

+37 -4
+11
tools/perf/builtin-record.c
··· 521 521 goto out_child; 522 522 } 523 523 524 + /* 525 + * Normally perf_session__new would do this, but it doesn't have the 526 + * evlist. 527 + */ 528 + if (rec->tool.ordered_events && !perf_evlist__sample_id_all(rec->evlist)) { 529 + pr_warning("WARNING: No sample_id_all support, falling back to unordered processing\n"); 530 + rec->tool.ordered_events = false; 531 + } 532 + 524 533 if (!rec->evlist->nr_groups) 525 534 perf_header__clear_feat(&session->header, HEADER_GROUP_DESC); 526 535 ··· 974 965 .tool = { 975 966 .sample = process_sample_event, 976 967 .fork = perf_event__process_fork, 968 + .exit = perf_event__process_exit, 977 969 .comm = perf_event__process_comm, 978 970 .mmap = perf_event__process_mmap, 979 971 .mmap2 = perf_event__process_mmap2, 972 + .ordered_events = true, 980 973 }, 981 974 }; 982 975
+2 -2
tools/perf/builtin-top.c
··· 601 601 602 602 static void display_setup_sig(void) 603 603 { 604 - signal(SIGSEGV, display_sig); 605 - signal(SIGFPE, display_sig); 604 + signal(SIGSEGV, sighandler_dump_stack); 605 + signal(SIGFPE, sighandler_dump_stack); 606 606 signal(SIGINT, display_sig); 607 607 signal(SIGQUIT, display_sig); 608 608 signal(SIGTERM, display_sig);
+18 -2
tools/perf/util/machine.c
··· 1387 1387 event->fork.ptid); 1388 1388 int err = 0; 1389 1389 1390 + if (dump_trace) 1391 + perf_event__fprintf_task(event, stdout); 1392 + 1393 + /* 1394 + * There may be an existing thread that is not actually the parent, 1395 + * either because we are processing events out of order, or because the 1396 + * (fork) event that would have removed the thread was lost. Assume the 1397 + * latter case and continue on as best we can. 1398 + */ 1399 + if (parent->pid_ != (pid_t)event->fork.ppid) { 1400 + dump_printf("removing erroneous parent thread %d/%d\n", 1401 + parent->pid_, parent->tid); 1402 + machine__remove_thread(machine, parent); 1403 + thread__put(parent); 1404 + parent = machine__findnew_thread(machine, event->fork.ppid, 1405 + event->fork.ptid); 1406 + } 1407 + 1390 1408 /* if a thread currently exists for the thread id remove it */ 1391 1409 if (thread != NULL) { 1392 1410 machine__remove_thread(machine, thread); ··· 1413 1395 1414 1396 thread = machine__findnew_thread(machine, event->fork.pid, 1415 1397 event->fork.tid); 1416 - if (dump_trace) 1417 - perf_event__fprintf_task(event, stdout); 1418 1398 1419 1399 if (thread == NULL || parent == NULL || 1420 1400 thread__fork(thread, parent, sample->time) < 0) {
+6
tools/perf/util/thread.c
··· 191 191 if (thread->pid_ == parent->pid_) 192 192 return 0; 193 193 194 + if (thread->mg == parent->mg) { 195 + pr_debug("broken map groups on thread %d/%d parent %d/%d\n", 196 + thread->pid_, thread->tid, parent->pid_, parent->tid); 197 + return 0; 198 + } 199 + 194 200 /* But this one is new process, copy maps. */ 195 201 for (i = 0; i < MAP__NR_TYPES; ++i) 196 202 if (map_groups__clone(thread->mg, parent->mg, i) < 0)