[PATCH v3 1/4] proc: Add get_task_cmdline_kernel() function

2022-08-08 Thread Helge Deller
Add a new function get_task_cmdline_kernel() which reads the command line of a process into a kernel buffer. This command line can then be dumped by arch code to give additional debug info via the parameters with which a faulting process was started. The new function re-uses the existing code whic

[PATCH v3 0/4] Dump command line of faulting process to syslog

2022-08-08 Thread Helge Deller
This patch series dumps the command line (including the program parameters) of a faulting process to the syslog. The motivation for this patch is that it's sometimes quite hard to find out and annoying to not know which program *exactly* faulted when looking at the syslog. For example, a dump on

[PATCH v3 2/4] lib/dump_stack: Add dump_stack_print_cmdline() and wire up in dump_stack_print_info()

2022-08-08 Thread Helge Deller
Add the function dump_stack_print_cmdline() which can be used by arch code to print the command line of the current processs. This function is useful in arch code when dumping information for a faulting process. Wire this function up in the dump_stack_print_info() function to include the dumping

[PATCH v3 4/4] arc: Use generic dump_stack_print_cmdline() implementation

2022-08-08 Thread Helge Deller
The process program name and command line is now shown in generic code in dump_stack_print_info(), so drop the arc-specific implementation. Signed-off-by: Helge Deller --- arch/arc/kernel/troubleshoot.c | 24 1 file changed, 24 deletions(-) diff --git a/arch/arc/kernel/

[PATCH v3 3/4] x86/fault: Dump command line of faulting process to syslog

2022-08-08 Thread Helge Deller
If a process segfaults, include the command line of the faulting process in the syslog. In the example below, the "crash" program (which simply writes zero to address 0) was called with the parameters "this is a test": crash[2326]: segfault at 0 ip 561a7969c12e sp 7ffe97a05630 error 6 i