From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759018AbeAIPgS (ORCPT + 1 other); Tue, 9 Jan 2018 10:36:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758978AbeAIPgP (ORCPT ); Tue, 9 Jan 2018 10:36:15 -0500 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Subject: [PATCH 19/49] perf tools: Add thread::exited flag Date: Tue, 9 Jan 2018 16:34:52 +0100 Message-Id: <20180109153522.14116-20-jolsa@kernel.org> In-Reply-To: <20180109153522.14116-1-jolsa@kernel.org> References: <20180109153522.14116-1-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 09 Jan 2018 15:36:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Adding thread::exited to indicate the thread has exited, and keeping the thread::dead flag to indicate thread is on the dead list. Link: http://lkml.kernel.org/n/tip-iak1784r9z2vhcnw6getmbdk@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/machine.c | 3 +++ tools/perf/util/thread.h | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 1be0fa64e3ca..ab79c2797a3c 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1667,6 +1667,9 @@ static void __machine__remove_thread(struct machine *machine, struct thread *th, rb_erase_init(&th->rb_node, &threads->entries); RB_CLEAR_NODE(&th->rb_node); --threads->nr; + + th->dead = true; + /* * No need to have an additional reference for non-index file * as they can be released when reference holders died and diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 90bf1d01fcf3..5ca81f29afa8 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h @@ -27,7 +27,8 @@ struct thread { char shortname[3]; bool comm_set; int comm_len; - bool dead; /* if set thread has exited */ + bool exited; /* if set thread has exited */ + bool dead; /* if set thread is in dead tree */ struct list_head namespaces_list; struct rw_semaphore namespaces_lock; struct list_head comm_list; @@ -65,7 +66,7 @@ static inline void __thread__zput(struct thread **thread) static inline void thread__exited(struct thread *thread) { - thread->dead = true; + thread->exited = true; } struct namespaces *thread__namespaces(const struct thread *thread); -- 2.13.6