From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
<linux-riscv@lists.infradead.org>,
Palmer Dabbelt <palmerdabbelt@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>,
John Ogness <john.ogness@linutronix.de>
Subject: [PATCH v2] riscv: Using printk directly in __show_regs
Date: Thu, 26 Nov 2020 21:33:38 +0800 [thread overview]
Message-ID: <20201126133338.125608-1-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20201124112054.106960-2-wangkefeng.wang@huawei.com>
Covert bulk of pr_cont("...\n") to separate printk calls.
Note that a pr_cont() message with a trailing newline will
"terminate" the continous line so that it can no longer be
continued, also it is possible to sort out simultaneous dumps
from multiple CPUs with CONFIG_PRINTK_CALLER enabled.
And align the printing formats.
Suggested-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/riscv/kernel/process.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index e41b733abeaa..2119d49feea5 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -44,30 +44,30 @@ void __show_regs(struct pt_regs *regs)
{
show_regs_print_info(KERN_DEFAULT);
- pr_cont("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
+ printk("epc: " REG_FMT " ra : " REG_FMT " sp : " REG_FMT "\n",
regs->epc, regs->ra, regs->sp);
- pr_cont(" gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
+ printk("gp : " REG_FMT " tp : " REG_FMT " t0 : " REG_FMT "\n",
regs->gp, regs->tp, regs->t0);
- pr_cont(" t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
+ printk("t1 : " REG_FMT " t2 : " REG_FMT " s0 : " REG_FMT "\n",
regs->t1, regs->t2, regs->s0);
- pr_cont(" s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
+ printk("s1 : " REG_FMT " a0 : " REG_FMT " a1 : " REG_FMT "\n",
regs->s1, regs->a0, regs->a1);
- pr_cont(" a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
+ printk("a2 : " REG_FMT " a3 : " REG_FMT " a4 : " REG_FMT "\n",
regs->a2, regs->a3, regs->a4);
- pr_cont(" a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
+ printk("a5 : " REG_FMT " a6 : " REG_FMT " a7 : " REG_FMT "\n",
regs->a5, regs->a6, regs->a7);
- pr_cont(" s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
+ printk("s2 : " REG_FMT " s3 : " REG_FMT " s4 : " REG_FMT "\n",
regs->s2, regs->s3, regs->s4);
- pr_cont(" s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
+ printk("s5 : " REG_FMT " s6 : " REG_FMT " s7 : " REG_FMT "\n",
regs->s5, regs->s6, regs->s7);
- pr_cont(" s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
+ printk("s8 : " REG_FMT " s9 : " REG_FMT " s10: " REG_FMT "\n",
regs->s8, regs->s9, regs->s10);
- pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
+ printk("s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
regs->s11, regs->t3, regs->t4);
- pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
+ printk("t5 : " REG_FMT " t6 : " REG_FMT "\n",
regs->t5, regs->t6);
- pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
+ printk("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
regs->status, regs->badaddr, regs->cause);
}
void show_regs(struct pt_regs *regs)
--
2.26.2
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2020-11-26 13:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 6:42 [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
2020-11-13 6:42 ` [PATCH 1/3] riscv: Cleanup stacktrace Kefeng Wang
2020-11-13 6:42 ` [PATCH 2/3] riscv: Make stack walk callback consistent with generic code Kefeng Wang
2020-11-13 6:42 ` [PATCH 3/3] riscv: Enable ARCH_STACKWALK Kefeng Wang
2020-11-21 3:01 ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Palmer Dabbelt
2020-11-24 11:20 ` [PATCH 1/2] riscv: Add dump stack in show_regs Kefeng Wang
2020-11-24 11:20 ` [PATCH 2/2] riscv: Fix __show_regs printing formats Kefeng Wang
2020-11-25 22:58 ` Atish Patra
2020-11-26 1:10 ` Kefeng Wang
2020-11-26 10:02 ` John Ogness
2020-11-26 11:55 ` John Ogness
2020-11-26 12:49 ` Kefeng Wang
2020-11-26 13:33 ` Kefeng Wang [this message]
2020-12-11 1:43 ` [PATCH v2] riscv: Using printk directly in __show_regs Palmer Dabbelt
2020-12-11 8:48 ` John Ogness
2020-12-14 11:49 ` Kefeng Wang
2020-11-25 23:04 ` [PATCH 1/2] riscv: Add dump stack in show_regs Atish Patra
2020-12-14 11:52 ` Kefeng Wang
2021-01-09 22:24 ` Palmer Dabbelt
2021-01-11 3:23 ` Kefeng Wang
2020-12-17 2:34 ` [PATCH 0/3] riscv: cover to ARCH_STACKWALK Kefeng Wang
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=20201126133338.125608-1-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=aou@eecs.berkeley.edu \
--cc=john.ogness@linutronix.de \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=palmerdabbelt@google.com \
--cc=paul.walmsley@sifive.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