aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-08-20 05:48:56 -0400
committerIngo Molnar <mingo@kernel.org>2015-08-20 05:48:56 -0400
commit40a2ea1bd988e3bbdb07a0708681fdb05cd7d267 (patch)
tree05806aaa27a4b0516a14a8ccf703c1501500e588 /tools
parenta897b5f0393a8a05d230c9248dc5324fb30720a0 (diff)
parent196676497f2507966f99abef63bede6a8550f8b3 (diff)
Merge branch 'perf/urgent' into perf/core, to pick up fixes before adding more changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-record.c11
-rw-r--r--tools/perf/builtin-top.c4
-rw-r--r--tools/perf/util/machine.c20
-rw-r--r--tools/perf/util/thread.c6
-rw-r--r--tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c2
5 files changed, 38 insertions, 5 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 25cf6b404e8a..a660022f2c92 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -521,6 +521,15 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
521 goto out_child; 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 if (!rec->evlist->nr_groups) 533 if (!rec->evlist->nr_groups)
525 perf_header__clear_feat(&session->header, HEADER_GROUP_DESC); 534 perf_header__clear_feat(&session->header, HEADER_GROUP_DESC);
526 535
@@ -970,9 +979,11 @@ static struct record record = {
970 .tool = { 979 .tool = {
971 .sample = process_sample_event, 980 .sample = process_sample_event,
972 .fork = perf_event__process_fork, 981 .fork = perf_event__process_fork,
982 .exit = perf_event__process_exit,
973 .comm = perf_event__process_comm, 983 .comm = perf_event__process_comm,
974 .mmap = perf_event__process_mmap, 984 .mmap = perf_event__process_mmap,
975 .mmap2 = perf_event__process_mmap2, 985 .mmap2 = perf_event__process_mmap2,
986 .ordered_events = true,
976 }, 987 },
977}; 988};
978 989
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index bfe24f1e362f..8c465c83aabf 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -602,8 +602,8 @@ static void display_sig(int sig __maybe_unused)
602 602
603static void display_setup_sig(void) 603static void display_setup_sig(void)
604{ 604{
605 signal(SIGSEGV, display_sig); 605 signal(SIGSEGV, sighandler_dump_stack);
606 signal(SIGFPE, display_sig); 606 signal(SIGFPE, sighandler_dump_stack);
607 signal(SIGINT, display_sig); 607 signal(SIGINT, display_sig);
608 signal(SIGQUIT, display_sig); 608 signal(SIGQUIT, display_sig);
609 signal(SIGTERM, display_sig); 609 signal(SIGTERM, display_sig);
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index be3e00891d22..6309f7ceb08f 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1395,6 +1395,24 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event
1395 event->fork.ptid); 1395 event->fork.ptid);
1396 int err = 0; 1396 int err = 0;
1397 1397
1398 if (dump_trace)
1399 perf_event__fprintf_task(event, stdout);
1400
1401 /*
1402 * There may be an existing thread that is not actually the parent,
1403 * either because we are processing events out of order, or because the
1404 * (fork) event that would have removed the thread was lost. Assume the
1405 * latter case and continue on as best we can.
1406 */
1407 if (parent->pid_ != (pid_t)event->fork.ppid) {
1408 dump_printf("removing erroneous parent thread %d/%d\n",
1409 parent->pid_, parent->tid);
1410 machine__remove_thread(machine, parent);
1411 thread__put(parent);
1412 parent = machine__findnew_thread(machine, event->fork.ppid,
1413 event->fork.ptid);
1414 }
1415
1398 /* if a thread currently exists for the thread id remove it */ 1416 /* if a thread currently exists for the thread id remove it */
1399 if (thread != NULL) { 1417 if (thread != NULL) {
1400 machine__remove_thread(machine, thread); 1418 machine__remove_thread(machine, thread);
@@ -1403,8 +1421,6 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event
1403 1421
1404 thread = machine__findnew_thread(machine, event->fork.pid, 1422 thread = machine__findnew_thread(machine, event->fork.pid,
1405 event->fork.tid); 1423 event->fork.tid);
1406 if (dump_trace)
1407 perf_event__fprintf_task(event, stdout);
1408 1424
1409 if (thread == NULL || parent == NULL || 1425 if (thread == NULL || parent == NULL ||
1410 thread__fork(thread, parent, sample->time) < 0) { 1426 thread__fork(thread, parent, sample->time) < 0) {
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 28c4b746baa1..0a9ae8014729 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -191,6 +191,12 @@ static int thread__clone_map_groups(struct thread *thread,
191 if (thread->pid_ == parent->pid_) 191 if (thread->pid_ == parent->pid_)
192 return 0; 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 /* But this one is new process, copy maps. */ 200 /* But this one is new process, copy maps. */
195 for (i = 0; i < MAP__NR_TYPES; ++i) 201 for (i = 0; i < MAP__NR_TYPES; ++i)
196 if (map_groups__clone(thread->mg, parent->mg, i) < 0) 202 if (map_groups__clone(thread->mg, parent->mg, i) < 0)
diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c b/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
index 7f0c756993af..3d7dc6afc3f8 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
191 if (res > 0) { 191 if (res > 0) {
192 atomic_set(&requeued, 1); 192 atomic_set(&requeued, 1);
193 break; 193 break;
194 } else if (res > 0) { 194 } else if (res < 0) {
195 error("FUTEX_CMP_REQUEUE_PI failed\n", errno); 195 error("FUTEX_CMP_REQUEUE_PI failed\n", errno);
196 ret = RET_ERROR; 196 ret = RET_ERROR;
197 break; 197 break;