]> git.baikalelectronics.ru Git - kernel.git/commit
scripts/gdb: lx-dmesg: read records individually
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 15 Dec 2021 15:10:22 +0000 (16:16 +0106)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:56 +0000 (14:23 +0200)
commit45c5871ceab24db00738fd3bed1d6200c5e87898
tree47e9ae9c90d01f3a5edbc7e34be71e603115b950
parenta63394ef74d74282d9b5b9651ac6e5bf2c24d0ec
scripts/gdb: lx-dmesg: read records individually

[ Upstream commit 80755e151cb53402abeee936a0f89df0ae2a42c6 ]

For the gdb command lx-dmesg, the entire descriptor, info, and text
data regions are read into memory before printing any records. For
large kernel log buffers, this not only causes a huge delay before
seeing any records, but it may also lead to python errors of too
much memory allocation.

Rather than reading in all these regions in advance, read them as
needed and only read the regions for the particular record that is
being printed.

The gdb macro "dmesg" in Documentation/admin-guide/kdump/gdbmacros.txt
already prints out the kernel log buffer like this.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/874k79c3a9.fsf@jogness.linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/gdb/linux/dmesg.py