diff options
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r-- | tools/perf/util/thread.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index f98032c135c6..3acd37f54888 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -80,6 +80,19 @@ threads__findnew(pid_t pid, struct rb_root *threads, struct thread **last_match) | |||
80 | return th; | 80 | return th; |
81 | } | 81 | } |
82 | 82 | ||
83 | struct thread * | ||
84 | register_idle_thread(struct rb_root *threads, struct thread **last_match) | ||
85 | { | ||
86 | struct thread *thread = threads__findnew(0, threads, last_match); | ||
87 | |||
88 | if (!thread || thread__set_comm(thread, "[idle]")) { | ||
89 | fprintf(stderr, "problem inserting idle task.\n"); | ||
90 | exit(-1); | ||
91 | } | ||
92 | |||
93 | return thread; | ||
94 | } | ||
95 | |||
83 | void thread__insert_map(struct thread *self, struct map *map) | 96 | void thread__insert_map(struct thread *self, struct map *map) |
84 | { | 97 | { |
85 | struct map *pos, *tmp; | 98 | struct map *pos, *tmp; |