Re: [PATCH] powerpc/xmon: add debugfs entry for xmon
From: Nicholas Piggin <npiggin@gmail.com>
Date: 2017-02-14 02:35:59
On Mon, 13 Feb 2017 19:00:42 -0200 "Guilherme G. Piccoli" [off-list ref] wrote:
Currently the xmon debugger is set only via kernel boot command-line. It's disabled by default, and can be enabled with "xmon=on" on the command-line. Also, xmon may be accessed via sysrq mechanism, but once we enter xmon via sysrq, it's kept enabled until system is rebooted, even if we exit the debugger. A kernel crash will then lead to xmon instance, instead of triggering a kdump procedure (if configured), for example. This patch introduces a debugfs entry for xmon, allowing user to query its current state and change it if desired. Basically, the "xmon" file to read from/write to is under the debugfs mount point, on powerpc directory. Reading this file will provide the current state of the debugger, one of the following: "on", "off", "early" or "nobt". Writing one of these states to the file will take immediate effect on the debugger. Signed-off-by: Guilherme G. Piccoli <redacted> --- * I had this patch partially done for some time, and after a discussion at the kernel slack channel latest week, I decided to rebase and fix some remaining bugs. I'd change 'x' option to always disable the debugger, since with this patch we can always re-enable xmon, but today I noticed Pan's patch on the mailing list, so perhaps his approach of adding a flag to 'x' option is preferable. I can change this in a V2, if requested. Thanks in advance!
xmon state changing after the first sysrq+x violates principle of least astonishment, so I think that should be fixed. Then the question is, is it worth making it runtime configurable with xmon command or debugfs tunables? Thanks, Nick