All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Jiayuan Chen <mrpre@163.com>,
	rdunlap@infradead.org, bagasdotme@gmail.com
Cc: linux-doc@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
	hpa@zytor.com, linux-kernel@vger.kernel.org,
	Jiayuan Chen <mrpre@163.com>
Subject: Re: [PATCH v4] docs/arch: remove deprecated function name
Date: Mon, 10 Feb 2025 11:17:59 -0700	[thread overview]
Message-ID: <87ldudzmso.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20250208081832.121337-1-mrpre@163.com>

Jiayuan Chen <mrpre@163.com> writes:

> print_context_stack() was removed in 2016 by commit c8fe4609827ae
> ("x86/dumpstack: Remove dump_trace() and related callbacks"). Remove
> the now-inaccurate guide.
>
> While at it, also link to Ingo's explanatory message.
>
> Signed-off-by: Jiayuan Chen <mrpre@163.com>
> Suggested-by: Randy Dunlap <rdunlap@infradead.org>
> Suggested-by: Jonathan Corbet <corbet@lwn.net>
> Suggested-by: Bagas Sanjaya <bagasdotme@gmail.com>
>
> ---
> V3 -> V4: Made changes based on Bagas's suggestion.
> V1 -> V3: Made changes based on suggestions from Randy and Jonathan.
> ---
>  Documentation/arch/x86/kernel-stacks.rst | 60 +++++++++---------------
>  1 file changed, 22 insertions(+), 38 deletions(-)

You didn't add Randy's Reviewed-by

This change is more than just removing a function name, though, so the
subject line is a bit off.  There's enough changing here that I would
really rather have an ack from the x86 folks before applying it.

Thanks,

jon

> diff --git a/Documentation/arch/x86/kernel-stacks.rst b/Documentation/arch/x86/kernel-stacks.rst
> index 738671a4070b..4cb68433272d 100644
> --- a/Documentation/arch/x86/kernel-stacks.rst
> +++ b/Documentation/arch/x86/kernel-stacks.rst
> @@ -112,41 +112,25 @@ Printing backtraces on x86
>  ==========================
>  
>  The question about the '?' preceding function names in an x86 stacktrace
> -keeps popping up, here's an indepth explanation. It helps if the reader
> -stares at print_context_stack() and the whole machinery in and around
> -arch/x86/kernel/dumpstack.c.
> -
> -Adapted from Ingo's mail, Message-ID: <20150521101614.GA10889@gmail.com>:
> -
> -We always scan the full kernel stack for return addresses stored on
> -the kernel stack(s) [1]_, from stack top to stack bottom, and print out
> -anything that 'looks like' a kernel text address.
> -
> -If it fits into the frame pointer chain, we print it without a question
> -mark, knowing that it's part of the real backtrace.
> -
> -If the address does not fit into our expected frame pointer chain we
> -still print it, but we print a '?'. It can mean two things:
> -
> - - either the address is not part of the call chain: it's just stale
> -   values on the kernel stack, from earlier function calls. This is
> -   the common case.
> -
> - - or it is part of the call chain, but the frame pointer was not set
> -   up properly within the function, so we don't recognize it.
> -
> -This way we will always print out the real call chain (plus a few more
> -entries), regardless of whether the frame pointer was set up correctly
> -or not - but in most cases we'll get the call chain right as well. The
> -entries printed are strictly in stack order, so you can deduce more
> -information from that as well.
> -
> -The most important property of this method is that we _never_ lose
> -information: we always strive to print _all_ addresses on the stack(s)
> -that look like kernel text addresses, so if debug information is wrong,
> -we still print out the real call chain as well - just with more question
> -marks than ideal.
> -
> -.. [1] For things like IRQ and IST stacks, we also scan those stacks, in
> -       the right order, and try to cross from one stack into another
> -       reconstructing the call chain. This works most of the time.
> +keeps popping up. Here's the explanation, that helps when the reader
> +stares at printk_stack_addressk() and its callers and pays special
> +attention to the 'reliable' parameter ('?' basically means that the
> +address is unreliable).
> +
> +The answer can be found in the comments within show_trace_log_lvl() body
> +in arch/x86/kernel/dumpstack.c::
> +
> +    /*
> +     * Scan the stack, printing any text addresses we find.  At the
> +     * same time, follow proper stack frames with the unwinder.
> +     *
> +     * Addresses found during the scan which are not reported by
> +     * the unwinder are considered to be additional clues which are
> +     * sometimes useful for debugging and are prefixed with '?'.
> +     * This also serves as a failsafe option in case the unwinder
> +     * goes off in the weeds.
> +     */
> +
> +For more information, see also Ingo's email. [1]_
> +
> +.. [1] https://lore.kernel.org/lkml/20150521101614.GA10889@gmail.com/
> -- 
> 2.43.5

      reply	other threads:[~2025-02-10 18:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-08  8:18 [PATCH v4] docs/arch: remove deprecated function name Jiayuan Chen
2025-02-10 18:17 ` Jonathan Corbet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ldudzmso.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=bagasdotme@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mrpre@163.com \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.