linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@rivosinc.com>
To: dvyukov@google.com, nogikh@google.com, syzkaller@googlegroups.com
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	aou@eecs.berkeley.edu, peterz@infradead.org,
	keescook@chromium.org, jszhang@kernel.org, geert@linux-m68k.org,
	chenhuang5@huawei.com, changbin.du@intel.com,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	Palmer Dabbelt <palmer@rivosinc.com>
Subject: [PATCH v1] RISC-V: Move the "Call Trace" to dump_backtrace()
Date: Tue, 19 Apr 2022 10:48:42 -0700	[thread overview]
Message-ID: <20220419174842.488-1-palmer@rivosinc.com> (raw)

From: Palmer Dabbelt <palmer@rivosinc.com>

Our oopses include "Call Trace:", but in a different place than some
other targets do.  This is breaking at least syzkaller, and likely other
bits of tooling that are trying to parse kernel stack traces.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

---

I'm sort of just dead-reckoning this one based on the syzkaller issues
being reported in
<CACT4Y+ZA7CRNfYgPmi6jHTKD9rwvaJy=nh5Gz_c-PFHq3tuziQ@mail.gmail.com>, I
haven't tested this at all.  There's a lot of other stuff here that
arm64 is doing, much of which seems like it could be pulled out into
generic code.  I seem to remember having said that before, though...

I've left this as "Call Trace:" after seeing some patches to convert the
arm/ print from "Call trace:" to "Call Trace:".  I can't find it again
and I remember it sounding like that wasn't necessary, but since we've
already got the capital I see no reason to change it.  That looks to be
the more popular way.

Presumably this will break any tools parsing the current log format, but
given that we've changed it a handful of times and it looks like it's
just blowing up for folks as-is.
---
 arch/riscv/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 08d11a53f39e..d5b91c0d1881 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -108,12 +108,12 @@ static bool print_trace_address(void *arg, unsigned long pc)
 noinline void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
 		    const char *loglvl)
 {
+	pr_cont("%sCall Trace:\n", loglvl);
 	walk_stackframe(task, regs, print_trace_address, (void *)loglvl);
 }
 
 void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
-	pr_cont("%sCall Trace:\n", loglvl);
 	dump_backtrace(NULL, task, loglvl);
 }
 
-- 
2.34.1


                 reply	other threads:[~2022-04-19 19:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220419174842.488-1-palmer@rivosinc.com \
    --to=palmer@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=changbin.du@intel.com \
    --cc=chenhuang5@huawei.com \
    --cc=dvyukov@google.com \
    --cc=geert@linux-m68k.org \
    --cc=jszhang@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=nogikh@google.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=syzkaller@googlegroups.com \
    /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).