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: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20181221120620.9659-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Adrian Hunter 2018-12-21 14:06:13 +02:00 committed by Arnaldo Carvalho de Melo
parent 4ccc98a489
commit 03b32cb281
1 changed files with 7 additions and 11 deletions

View File

@ -593,17 +593,13 @@ int thread_stack__process(struct thread *thread, struct comm *comm,
struct thread_stack *ts = thread->ts;
int err = 0;
if (ts) {
if (!ts->crp) {
/* Supersede thread_stack__event() */
thread_stack__free(thread);
thread->ts = thread_stack__new(thread, crp);
if (!thread->ts)
return -ENOMEM;
ts = thread->ts;
ts->comm = comm;
}
} else {
if (ts && !ts->crp) {
/* Supersede thread_stack__event() */
thread_stack__free(thread);
ts = NULL;
}
if (!ts) {
thread->ts = thread_stack__new(thread, crp);
if (!thread->ts)
return -ENOMEM;