path: root/tools/perf/builtin-sched.c
diff options
authorArnaldo Carvalho de Melo <>2015-03-02 22:21:35 -0300
committerArnaldo Carvalho de Melo <>2015-03-03 00:17:08 -0300
commitf3b623b8490af7a9b819cbcf2d99ab4597ece94b (patch)
tree13926b268a431ab99d8518b0b9c9d4c7c124c188 /tools/perf/builtin-sched.c
parent2ed11312eb19506c027e7cac039994ad42a9cb2c (diff)
perf tools: Reference count struct thread
We need to do that to stop accumulating entries in the dead_threads linked list, i.e. we were keeping references to threads in struct hists that continue to exist even after a thread exited and was removed from the machine threads rbtree. We still keep the dead_threads list, but just for debugging, allowing us to iterate at any given point over the threads that still are referenced by things like struct hist_entry. Cc: Adrian Hunter <> Cc: Borislav Petkov <> Cc: David Ahern <> Cc: Don Zickus <> Cc: Frederic Weisbecker <> Cc: Jiri Olsa <> Cc: Namhyung Kim <> Cc: Stephane Eranian <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/builtin-sched.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 7ce296618717..e00e2eaf89da 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -831,7 +831,7 @@ static int thread_atoms_insert(struct perf_sched *sched, struct thread *thread)
return -1;
- atoms->thread = thread;
+ atoms->thread = thread__get(thread);
__thread_latency_insert(&sched->atom_root, atoms, &sched->cmp_pid);
return 0;