Merge branch 'work.preadv2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[cascardo/linux.git] / tools / perf / util / thread_map.c
index 267112b..5654fe1 100644 (file)
@@ -260,7 +260,7 @@ struct thread_map *thread_map__new_dummy(void)
        return threads;
 }
 
-static struct thread_map *thread_map__new_by_tid_str(const char *tid_str)
+struct thread_map *thread_map__new_by_tid_str(const char *tid_str)
 {
        struct thread_map *threads = NULL, *nt;
        int ntasks = 0;
@@ -436,3 +436,15 @@ struct thread_map *thread_map__new_event(struct thread_map_event *event)
 
        return threads;
 }
+
+bool thread_map__has(struct thread_map *threads, pid_t pid)
+{
+       int i;
+
+       for (i = 0; i < threads->nr; ++i) {
+               if (threads->map[i].pid == pid)
+                       return true;
+       }
+
+       return false;
+}