* [PATCH] powerpc/xmon: make dumping log buffer contents more reliable
@ 2021-05-14 16:24 Nathan Lynch
2021-06-06 12:08 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Lynch @ 2021-05-14 16:24 UTC (permalink / raw)
To: linuxppc-dev; +Cc: paulus, jniethe5
Log buffer entries that are too long for dump_log_buf()'s small
local buffer are:
* silently discarded when a single-line entry is too long;
kmsg_dump_get_line() returns true but sets &len to 0.
* silently truncated to the last fitting new line when a multi-line
entry is too long, e.g. register dumps from __show_regs(); this
seems undetectable via the kmsg_dump API.
xmon_printf()'s internal buffer is already 1KB; enlarge
dump_log_buf()'s own buffer to match and make it statically
allocated. Verified that this allows complete printing of register
dumps on ppc64le with both CONFIG_PRINTK_TIME=y and
CONFIG_PRINTK_CALLER=y.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/xmon/xmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index c8173e92f19d..f73c10869e64 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2975,7 +2975,7 @@ static void
dump_log_buf(void)
{
struct kmsg_dump_iter iter;
- unsigned char buf[128];
+ static unsigned char buf[1024];
size_t len;
if (setjmp(bus_error_jmp) != 0) {
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/xmon: make dumping log buffer contents more reliable
2021-05-14 16:24 [PATCH] powerpc/xmon: make dumping log buffer contents more reliable Nathan Lynch
@ 2021-06-06 12:08 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2021-06-06 12:08 UTC (permalink / raw)
To: linuxppc-dev, Nathan Lynch; +Cc: jniethe5, paulus
On Fri, 14 May 2021 11:24:20 -0500, Nathan Lynch wrote:
> Log buffer entries that are too long for dump_log_buf()'s small
> local buffer are:
>
> * silently discarded when a single-line entry is too long;
> kmsg_dump_get_line() returns true but sets &len to 0.
> * silently truncated to the last fitting new line when a multi-line
> entry is too long, e.g. register dumps from __show_regs(); this
> seems undetectable via the kmsg_dump API.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/xmon: make dumping log buffer contents more reliable
https://git.kernel.org/powerpc/c/2cec178e35baf57d307c0982fd2e53055bd1e9bb
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-06 12:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 16:24 [PATCH] powerpc/xmon: make dumping log buffer contents more reliable Nathan Lynch
2021-06-06 12:08 ` Michael Ellerman
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.