perf machine thread: Remove exited threads by default
[linux-2.6-microblaze.git] / tools / perf / util / machine.c
index 90c7501..a985d00 100644 (file)
@@ -2157,9 +2157,13 @@ int machine__process_exit_event(struct machine *machine, union perf_event *event
        if (dump_trace)
                perf_event__fprintf_task(event, stdout);
 
-       if (thread != NULL)
-               thread__put(thread);
-
+       if (thread != NULL) {
+               if (symbol_conf.keep_exited_threads)
+                       thread__set_exited(thread, /*exited=*/true);
+               else
+                       machine__remove_thread(machine, thread);
+       }
+       thread__put(thread);
        return 0;
 }