From: Puranjay Mohan <puranjay12@gmail.com>
To: Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org
Cc: ardb@kernel.org, broonie@kernel.org, catalin.marinas@arm.com,
jpoimboe@kernel.org, kaleshsingh@google.com,
madvenka@linux.microsoft.com, mark.rutland@arm.com,
maz@kernel.org, mbenes@suse.cz, will@kernel.org
Subject: Re: [PATCH 00/10] arm64: stacktrace: improve unwind reporting
Date: Tue, 15 Oct 2024 11:54:34 +0000 [thread overview]
Message-ID: <mb61p8qupmvid.fsf@gmail.com> (raw)
In-Reply-To: <20241010101510.1487477-1-mark.rutland@arm.com>
[-- Attachment #1: Type: text/plain, Size: 2768 bytes --]
Mark Rutland <mark.rutland@arm.com> writes:
> This series improves arm64's unwinder to explicitly identify exception
> boundaries, reporting both pt_regs::pc and pt_regs::lr and explicitly
> identifying the source of elements in the stacktrace. This is useful to
> humans when reviewing a stacktrace, and serves as infrastructure that
> can be used for RELIABLE_STACKTRACE in future.
>
> The first 6 patches are preparatory work that are not intended to have
> any functional impact, with patches 7 to 10 making the key changes.
> Largely this involves teaching the unwinder to track metadata for each
> unwind step, and modifying the way we manage pt_regs::stackframe so that
> exception boundaries can be identifier explcitily.
>
> With this series applied, the unwinder will report when unwind elements are not
> simply the result of a frame pointer based unwind, e.g.
>
> | Call trace:
> | show_stack+0x20/0x38 (CF)
> | dump_stack_lvl+0x60/0x80 (F)
> | dump_stack+0x18/0x28
> | nmi_cpu_backtrace+0xfc/0x140
> | nmi_trigger_cpumask_backtrace+0x1c8/0x200
> | arch_trigger_cpumask_backtrace+0x20/0x40
> | sysrq_handle_showallcpus+0x24/0x38 (F)
> | __handle_sysrq+0xa8/0x1b0 (F)
> | handle_sysrq+0x38/0x50 (F)
> | pl011_int+0x420/0x570 (F)
> | __handle_irq_event_percpu+0x60/0x220 (F)
> | handle_irq_event+0x54/0xc0 (F)
> | handle_fasteoi_irq+0xa8/0x1d0 (F)
> | generic_handle_domain_irq+0x34/0x58 (F)
> | gic_handle_irq+0x54/0x140 (FK)
> | call_on_irq_stack+0x24/0x58 (F)
> | do_interrupt_handler+0x88/0xa0
> | el1_interrupt+0x34/0x68 (F)
> | el1h_64_irq_handler+0x18/0x28
> | el1h_64_irq+0x6c/0x70
> | default_idle_call+0x34/0x180 (P)
> | default_idle_call+0x28/0x180 (L)
> | do_idle+0x204/0x268
> | cpu_startup_entry+0x3c/0x50 (F)
> | rest_init+0xe4/0xf0
> | start_kernel+0x738/0x740
> | __primary_switched+0x88/0x98
>
> ... where:
>
> * "C" indicates that the first element of the trace was the caller of an unwind
> function (vs "T" for a blocked task's stave PC, or "P" for a pt_regs::pc).
>
> * "F" indicates that the element was recovered from fgraph (and
> would otherwise have been reported as return_to_handler).
>
> * "K" indicates that the element was recovered from kretprobes (and
> would otherwise have been reported as __kretprobe_trampoline).
>
> * "P" indicates that the element was recovered from pt_regs::pc, and therefore
> this is the first element after an exception boundary.
>
> * "L" indidates that the element was recovered from pt_regs::lr, and therefore
> this may or may not be reliable depending on whether the LR was live at the
> moment the exception was taken.
>
> Mark.
with all the typos reported by others fixed.
Reviewed-by: Puranjay Mohan <puranjay12@gmail.com>
Thanks,
Puranjay Mohan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]
prev parent reply other threads:[~2024-10-15 11:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 10:15 [PATCH 00/10] arm64: stacktrace: improve unwind reporting Mark Rutland
2024-10-10 10:15 ` [PATCH 01/10] arm64: pt_regs: assert pt_regs is a multiple of 16 bytes Mark Rutland
2024-10-10 14:23 ` Mark Brown
2024-10-10 10:15 ` [PATCH 02/10] arm64: pt_regs: remove stale big-endian layout Mark Rutland
2024-10-10 14:27 ` Mark Brown
2024-10-11 12:16 ` Miroslav Benes
2024-10-10 10:15 ` [PATCH 03/10] arm64: pt_regs: rename "pmr_save" -> "pmr" Mark Rutland
2024-10-10 14:27 ` Mark Brown
2024-10-10 10:15 ` [PATCH 04/10] arm64: pt_regs: swap 'unused' and 'pmr' fields Mark Rutland
2024-10-10 14:33 ` Mark Brown
2024-10-10 10:15 ` [PATCH 05/10] arm64: use a common struct frame_record Mark Rutland
2024-10-10 14:40 ` Mark Brown
2024-10-11 12:36 ` Miroslav Benes
2024-10-10 10:15 ` [PATCH 06/10] arm64: stacktrace: move dump_backtrace() to kunwind_stack_walk() Mark Rutland
2024-10-10 14:44 ` Mark Brown
2024-10-10 10:15 ` [PATCH 07/10] arm64: stacktrace: report source of unwind data Mark Rutland
2024-10-10 15:13 ` Mark Brown
2024-10-10 10:15 ` [PATCH 08/10] arm64: stacktrace: report recovered PCs Mark Rutland
2024-10-10 15:16 ` Mark Brown
2024-10-11 12:58 ` Miroslav Benes
2024-10-11 15:02 ` Mark Rutland
2024-10-10 10:15 ` [PATCH 09/10] arm64: stacktrace: split unwind_consume_stack() Mark Rutland
2024-10-11 13:11 ` Mark Brown
2024-10-10 10:15 ` [PATCH 10/10] arm64: stacktrace: unwind exception boundaries Mark Rutland
2024-10-11 15:16 ` Miroslav Benes
2024-10-11 16:13 ` Mark Rutland
2024-10-11 16:34 ` Miroslav Benes
2024-10-12 9:22 ` Mark Brown
2024-10-11 15:19 ` [PATCH 00/10] arm64: stacktrace: improve unwind reporting Miroslav Benes
2024-10-11 16:32 ` Mark Rutland
2024-10-15 11:54 ` Puranjay Mohan [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=mb61p8qupmvid.fsf@gmail.com \
--to=puranjay12@gmail.com \
--cc=ardb@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=jpoimboe@kernel.org \
--cc=kaleshsingh@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=madvenka@linux.microsoft.com \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=mbenes@suse.cz \
--cc=will@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).