[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180109153522.14116-20-jolsa@kernel.org>
Date: Tue, 9 Jan 2018 16:34:52 +0100
From: Jiri Olsa <jolsa@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: [PATCH 19/49] perf tools: Add thread::exited flag
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 <jolsa@...nel.org>
---
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
Powered by blists - more mailing lists