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

perf thread-stack: Eliminate code duplicating thread_stack__pop_ks()

Use new function thread_stack__pop_ks() in place of equivalent code.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190619064429.14940-3-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 97860b48
...@@ -664,12 +664,9 @@ static int thread_stack__no_call_return(struct thread *thread, ...@@ -664,12 +664,9 @@ static int thread_stack__no_call_return(struct thread *thread,
if (ip >= ks && addr < ks) { if (ip >= ks && addr < ks) {
/* Return to userspace, so pop all kernel addresses */ /* Return to userspace, so pop all kernel addresses */
while (thread_stack__in_kernel(ts)) { err = thread_stack__pop_ks(thread, ts, sample, ref);
err = thread_stack__call_return(thread, ts, --ts->cnt,
tm, ref, true);
if (err) if (err)
return err; return err;
}
/* If the stack is empty, push the userspace address */ /* If the stack is empty, push the userspace address */
if (!ts->cnt) { if (!ts->cnt) {
...@@ -679,13 +676,10 @@ static int thread_stack__no_call_return(struct thread *thread, ...@@ -679,13 +676,10 @@ static int thread_stack__no_call_return(struct thread *thread,
} }
} else if (thread_stack__in_kernel(ts) && ip < ks) { } else if (thread_stack__in_kernel(ts) && ip < ks) {
/* Return to userspace, so pop all kernel addresses */ /* Return to userspace, so pop all kernel addresses */
while (thread_stack__in_kernel(ts)) { err = thread_stack__pop_ks(thread, ts, sample, ref);
err = thread_stack__call_return(thread, ts, --ts->cnt,
tm, ref, true);
if (err) if (err)
return err; return err;
} }
}
if (ts->cnt) if (ts->cnt)
parent = ts->stack[ts->cnt - 1].cp; parent = ts->stack[ts->cnt - 1].cp;
......
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