perf tools: Use tid in mmap/mmap2 events to find maps
authorDon Zickus <dzickus@redhat.com>
Wed, 26 Feb 2014 15:45:27 +0000 (10:45 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 18 Mar 2014 21:17:00 +0000 (18:17 -0300)
Now that we can properly synthesize threads system-wide, make sure the
mmap and mmap2 events use tids instead of pids to locate their maps.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1393429527-167840-3-git-send-email-dzickus@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/hists_link.c
tools/perf/util/machine.c

index 2b6519e0e36f09bdbdeac4865fed851f82a3a1ac..7ccbc7b6ae775e0c2793e77706a0acfaf86f5a27 100644 (file)
@@ -101,6 +101,7 @@ static struct machine *setup_fake_machine(struct machines *machines)
                        .mmap = {
                                .header = { .misc = PERF_RECORD_MISC_USER, },
                                .pid = fake_mmap_info[i].pid,
+                               .tid = fake_mmap_info[i].pid,
                                .start = fake_mmap_info[i].start,
                                .len = 0x1000ULL,
                                .pgoff = 0ULL,
index d280bf2101838d464017d78fb6fb3b2ca5072b99..a53cd0b8c151cdb898d3711c36e5081846813a15 100644 (file)
@@ -1027,7 +1027,7 @@ int machine__process_mmap2_event(struct machine *machine,
        }
 
        thread = machine__findnew_thread(machine, event->mmap2.pid,
-                                       event->mmap2.pid);
+                                       event->mmap2.tid);
        if (thread == NULL)
                goto out_problem;
 
@@ -1075,7 +1075,7 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event
        }
 
        thread = machine__findnew_thread(machine, event->mmap.pid,
-                                        event->mmap.pid);
+                                        event->mmap.tid);
        if (thread == NULL)
                goto out_problem;