Skip to content

Commit

Permalink
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull stacktrace fix from Thomas Gleixner:
 "A small fix for a stacktrace regression.

  Saving a stacktrace for a foreign task skipped an extra entry which
  makes e.g. the output of /proc/$PID/stack incomplete"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  stacktrace: Don't skip first entry on noncurrent tasks
  • Loading branch information
torvalds committed Nov 10, 2019
2 parents 79a6406 + b0c51f1 commit 20c7e29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ unsigned int stack_trace_save_tsk(struct task_struct *tsk, unsigned long *store,
struct stacktrace_cookie c = {
.store = store,
.size = size,
.skip = skipnr + 1,
/* skip this function if they are tracing us */
.skip = skipnr + !!(current == tsk),
};

if (!try_get_task_stack(tsk))
Expand Down Expand Up @@ -298,7 +299,8 @@ unsigned int stack_trace_save_tsk(struct task_struct *task,
struct stack_trace trace = {
.entries = store,
.max_entries = size,
.skip = skipnr + 1,
/* skip this function if they are tracing us */
.skip = skipnr + !!(current == task),
};

save_stack_trace_tsk(task, &trace);
Expand Down

0 comments on commit 20c7e29

Please sign in to comment.