summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2018-12-21 15:06:13 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-01-02 16:42:45 +0300
commit03b32cb2810814756095dbd91fce0c77617d096b (patch)
treef3901b9c20a20b25de1bd185c549a93dc86c2ffb /tools
parent4ccc98a48958da9f89beb71c66a4e05468727951 (diff)
downloadlinux-03b32cb2810814756095dbd91fce0c77617d096b.tar.xz
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/thread-stack.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c
index 61a4286a74dc..115dc4b27a1b 100644
--- a/tools/perf/util/thread-stack.c
+++ b/tools/perf/util/thread-stack.c
@@ -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;