"Guilherme G. Piccoli" <gpicc...@linux.vnet.ibm.com> writes: > On 14/02/2017 01:58, Pan Xinhui wrote: >> 在 2017/2/14 10:35, Nicholas Piggin 写道: >>> On Mon, 13 Feb 2017 19:00:42 -0200 >>> >>> xmon state changing after the first sysrq+x violates principle of least >>> astonishment, so I think that should be fixed. >>> >> hi, Nick >> yes, as long as xmon is disabled during boot, it should still be disabled >> after existing xmon. >> My patch does not fix that as it need people add one more char 'z' following >> 'x'. >> I will provide a new patch to fix that. >> >>> Then the question is, is it worth making it runtime configurable with xmon >>> command or debugfs tunables? >>> >> They are options for people to turn xmon features on or off. Maybe people >> needn't this. >> However I am not a fan of debugfs this time as I am used to using xmon >> cmds. :) >> >> Hi, Guilherme >> So in the end, my thought is that: 1) cmd x|X will exit xmon and keep xmon >> in the original state(indicated by var xmon_off). >> 2) Then add options to turn some features on/off. And debugfs maybe not fit >> for this. But I am also wondering at same time, are people needing this? > > Hi Nick and Xinhui, thanks very much for the feedback. > I agree, we should keep xmon in the state it was firstly set, on boot > time - dropping to the debugger using sysrq shouldn't change it. > > Now, the use case of the debugfs approach is to allow user to > enable/disable xmon without need to drop into the debugger itself, or > reboot the machine. > Imagine a scenario in which we have a production machine, and: > > > i) For some reason, somebody kept xmon enabled on grub.cfg and now, we > want to let kdump work in case of crash - how to disable xmon in runtime? > > ii) The opposite: xmon wasn't enable on boot time in production machine, > but we have a super-rare issue and want to drop to xmon next time it > happens, so we need to enable it. But we don't want to drop into the > debugger to force it gets enabled, so how do we enable it?
Yep. I think both of those are good reasons to add a debugfs file. > Regarding the place of the xmon state file, I believe debugfs is the > right place - where else could we add it? procfs? configfs? debugfs, under powerpc_debugfs_root. cheers