[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-2e9e8688763ff80f032d9a78c3b4b951fb6dd7a4@git.kernel.org>
Date: Thu, 3 Jan 2019 05:24:44 -0800
From: tip-bot for Adrian Hunter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, jolsa@...nel.org, linux-kernel@...r.kernel.org,
adrian.hunter@...el.com, mingo@...nel.org, tglx@...utronix.de,
hpa@...or.com
Subject: [tip:perf/urgent] perf thread-stack: Factor out
thread_stack__init()
Commit-ID: 2e9e8688763ff80f032d9a78c3b4b951fb6dd7a4
Gitweb: https://git.kernel.org/tip/2e9e8688763ff80f032d9a78c3b4b951fb6dd7a4
Author: Adrian Hunter <adrian.hunter@...el.com>
AuthorDate: Fri, 21 Dec 2018 14:06:17 +0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 2 Jan 2019 10:53:41 -0300
perf thread-stack: Factor out thread_stack__init()
In preparation for fixing thread stack processing for the idle task,
factor out thread_stack__init().
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Link: http://lkml.kernel.org/r/20181221120620.9659-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/thread-stack.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c
index a5f7b9d8fc23..03770af9e5cd 100644
--- a/tools/perf/util/thread-stack.c
+++ b/tools/perf/util/thread-stack.c
@@ -93,6 +93,24 @@ static int thread_stack__grow(struct thread_stack *ts)
return 0;
}
+static int thread_stack__init(struct thread_stack *ts, struct thread *thread,
+ struct call_return_processor *crp)
+{
+ int err;
+
+ err = thread_stack__grow(ts);
+ if (err)
+ return err;
+
+ if (thread->mg && thread->mg->machine)
+ ts->kernel_start = machine__kernel_start(thread->mg->machine);
+ else
+ ts->kernel_start = 1ULL << 63;
+ ts->crp = crp;
+
+ return 0;
+}
+
static struct thread_stack *thread_stack__new(struct thread *thread,
struct call_return_processor *crp)
{
@@ -104,17 +122,11 @@ static struct thread_stack *thread_stack__new(struct thread *thread,
ts->arr_sz = 1;
- if (thread_stack__grow(ts)) {
+ if (thread_stack__init(ts, thread, crp)) {
free(ts);
return NULL;
}
- if (thread->mg && thread->mg->machine)
- ts->kernel_start = machine__kernel_start(thread->mg->machine);
- else
- ts->kernel_start = 1ULL << 63;
- ts->crp = crp;
-
thread->ts = ts;
return ts;
Powered by blists - more mailing lists