perf tools: Use tid for finding thread
[cascardo/linux.git] / tools / perf / tests / code-reading.c
index bfb1869..67f2d63 100644 (file)
@@ -1,8 +1,7 @@
-#include <sys/types.h>
+#include <linux/types.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <inttypes.h>
 #include <ctype.h>
 #include <string.h>
 
@@ -257,7 +256,7 @@ static int process_sample_event(struct machine *machine,
                return -1;
        }
 
-       thread = machine__findnew_thread(machine, sample.pid, sample.pid);
+       thread = machine__findnew_thread(machine, sample.pid, sample.tid);
        if (!thread) {
                pr_debug("machine__findnew_thread failed\n");
                return -1;