[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <698b03300532f80dfbd30fa35446a33e58ae0c89.camel@perches.com>
Date: Sun, 10 Nov 2019 14:00:44 -0800
From: Joe Perches <joe@...ches.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jiri Slaby <jslaby@...e.cz>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [GIT pull] core/urgent for v5.4-rc7
On Sun, 2019-11-10 at 10:21 +0000, Thomas Gleixner wrote:
> 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.
[]
> ------------------>
> Jiri Slaby (1):
> stacktrace: Don't skip first entry on noncurrent tasks
[]
> diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
[]
> @@ -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),
trivia:
This idiom '!!(logical test)' is odd and redundant.
Logical test result is already 0 or 1, no !! is unnecessary.
> };
>
> if (!try_get_task_stack(tsk))
> @@ -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);
>
>
Powered by blists - more mailing lists