Commit 03b32cb2 authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo

perf thread-stack: Simplify some code in thread_stack__process()

In preparation for fixing thread stack processing for the idle task,
simplify some code in thread_stack__process().
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20181221120620.9659-2-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4ccc98a4
...@@ -593,17 +593,13 @@ int thread_stack__process(struct thread *thread, struct comm *comm, ...@@ -593,17 +593,13 @@ int thread_stack__process(struct thread *thread, struct comm *comm,
struct thread_stack *ts = thread->ts; struct thread_stack *ts = thread->ts;
int err = 0; int err = 0;
if (ts) { if (ts && !ts->crp) {
if (!ts->crp) { /* Supersede thread_stack__event() */
/* Supersede thread_stack__event() */ thread_stack__free(thread);
thread_stack__free(thread); ts = NULL;
thread->ts = thread_stack__new(thread, crp); }
if (!thread->ts)
return -ENOMEM; if (!ts) {
ts = thread->ts;
ts->comm = comm;
}
} else {
thread->ts = thread_stack__new(thread, crp); thread->ts = thread_stack__new(thread, crp);
if (!thread->ts) if (!thread->ts)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment