linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add support to dump printk buffer to console via sysrq
@ 2024-01-17 10:12 Sreenath Vijayan
  2024-01-17 10:12 ` [PATCH v3 1/2] printk: Add function to dump printk buffer directly to consoles Sreenath Vijayan
  2024-01-17 11:13 ` [PATCH v3 2/2] tty/sysrq: Dump printk ring buffer messages via sysrq Sreenath Vijayan
  0 siblings, 2 replies; 10+ messages in thread
From: Sreenath Vijayan @ 2024-01-17 10:12 UTC (permalink / raw)
  To: john.ogness, corbet, gregkh, jirislaby, rdunlap, pmladek
  Cc: rostedt, senozhatsky, linux-doc, linux-kernel, linux-serial,
	taichi.shimoyashiki, daniel.palmer, anandakumar.balasubramaniam,
	sreenath.vijayan

Hi,

This patch series does two things:

1) Add function to dump the printk buffer messages directly to
consoles. To do this properly, access to printk private items
like PRINTK_MESSAGE_MAX is required. So, the function is
implemented in printk.c as suggested by John Ogness. This
function may sleep as it needs console related locks.

2) Add code in sysrq.c to call the above mentioned function
when sysrq+D is pressed. As the above function may sleep,
it cannot be called from interrupt context. A work is queued
in the system unbound workqueue to call the function when
the key is pressed.

Link to previous discussion:
- https://lore.kernel.org/linux-serial/20231221133953.1507021-1-sreenath.vijayan@sony.com/

Changelog:
V2 -> V3:
- split the implementation into two commits
- added function in printk.c to dump printk buffer to consoles
- added Suggested-by tag
- removed code to dump printk buffer from sysrq.c and called
  new function

V1 -> V2:
- modified kernel ring buffer to printk ring buffer
- allocated buf dynamically to prevent stack frame size warnings
- used buf of size 2048 to match PRINTK_MESSAGE_MAX and added comment

-- Sreenath

Sreenath Vijayan (2):
  printk: Add function to dump printk buffer directly to consoles
  tty/sysrq: Dump printk ring buffer messages via sysrq

 Documentation/admin-guide/sysrq.rst |  2 ++
 drivers/tty/sysrq.c                 | 20 ++++++++++++++++-
 include/linux/printk.h              |  4 ++++
 kernel/printk/printk.c              | 33 +++++++++++++++++++++++++++++
 4 files changed, 58 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-01-20  8:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 10:12 [PATCH v3 0/2] Add support to dump printk buffer to console via sysrq Sreenath Vijayan
2024-01-17 10:12 ` [PATCH v3 1/2] printk: Add function to dump printk buffer directly to consoles Sreenath Vijayan
2024-01-18  9:49   ` John Ogness
2024-01-18 10:14     ` John Ogness
2024-01-20  8:41     ` Sreenath Vijayan
2024-01-17 11:13 ` [PATCH v3 2/2] tty/sysrq: Dump printk ring buffer messages via sysrq Sreenath Vijayan
2024-01-17 10:12   ` Sreenath Vijayan
2024-01-18 10:05   ` John Ogness
2024-01-18 22:56   ` David Laight
2024-01-19  5:47     ` gregkh

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).