From: Guilherme G. Piccoli <hidden> Date: 2017-02-21 01:58:58
This series contains some improvements and fixes to xmon:
1) Pan Xinhui fixed a long-term bug, in which the xmon debugger got
stuck enabled after invoked by sysrq, regardless the state it was
set in the kernel command-line.
2) A debugfs entry was added in order to allow users to enable/disable
xmon without needing a kernel reload.
3) The nobt option was dropped and some minor issues were fixed, like
a misplacement of __initdata.
@mpe: The series was rebased against powerpc-next.
Guilherme G. Piccoli (2):
powerpc/xmon: drop the nobt option from xmon plus minor fixes
powerpc/xmon: add debugfs entry for xmon
Pan Xinhui (1):
powerpc/xmon: Fix an unexpected xmon on/off state change
arch/powerpc/xmon/xmon.c | 62 ++++++++++++++++++++++++++++++++++++++----------
1 file changed, 50 insertions(+), 12 deletions(-)
--
2.7.4
From: Guilherme G. Piccoli <hidden> Date: 2017-02-21 01:59:19
The xmon parameter nobt was added long time ago, by commit 26c8af5f01df
("[POWERPC] print backtrace when entering xmon"). The problem that time
was that during a crash in a machine with USB keyboard, xmon wouldn't
respond to commands from the keyboard, so printing the backtrace wouldn't
be possible.
Idea then was to show automatically the backtrace on xmon crash for the
first time it's invoked (if it recovers, next time xmon won't show
backtrace automatically). The nobt parameter was added _only_ to prevent
this automatic trace show. Seems long time ago USB keyboards didn't work
that well!
We don't need it anymore, but the feature of auto showing the backtrace
on first crash seems interesting (imagine a case of auto-reboot script),
so this patch keeps the functionality, yet removes the nobt parameter.
Also, this patch fixes __initdata placement on xmon_early and replaces
__initcall() with modern device_initcall() on sysrq handler.
Signed-off-by: Guilherme G. Piccoli <redacted>
---
arch/powerpc/xmon/xmon.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
From: Guilherme G. Piccoli <hidden> Date: 2017-02-21 01:59:48
From: Pan Xinhui <redacted>
Once xmon is triggered by sysrq-x, it is enabled always afterwards even
if it is disabled during boot. This will cause a system reset interrupt
fail to dump. So keep xmon in its original state after exit.
We have several ways to set xmon on or off.
1) by a build config CONFIG_XMON_DEFAULT.
2) by a boot cmdline with xmon, xmon=early or xmon=on to enable xmon
and xmon=off to disable xmon. This value will override that in step 1.
3) by a debugfs interface, as proposed in this patchset.
This value can override those in step 1 and 2.
Signed-off-by: Pan Xinhui <redacted>
Signed-off-by: Guilherme G. Piccoli <redacted>
---
v3: changed xmon_off to xmon_on, simplifying the logic [mpe suggestion].
arch/powerpc/xmon/xmon.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
@@ -3274,10 +3277,12 @@ static int __init early_parse_xmon(char *p)/* just "xmon" is equivalent to "xmon=early" */xmon_init(1);xmon_early=1;-}elseif(strncmp(p,"on",2)==0)+xmon_on=1;+}elseif(strncmp(p,"on",2)==0){xmon_init(1);-elseif(strncmp(p,"off",3)==0)-xmon_off=1;+xmon_on=1;+}elseif(strncmp(p,"off",3)==0)+xmon_on=0;elseif(strncmp(p,"nobt",4)==0)xmon_no_auto_backtrace=1;else
From: Guilherme G. Piccoli <hidden> Date: 2017-02-21 01:59:49
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 we cannot enable/disable xmon in runtime, it needs kernel reload.
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. It's a simple attribute, value 0 meaning xmon is disabled
and value 1 the opposite. Writing these states to the file will take
immediate effect in the debugger.
Signed-off-by: Guilherme G. Piccoli <redacted>
---
v3: logic improved based in the changes made on patch 1.
v2: dropped the custom parser by using simple attributes [mpe suggestion].
arch/powerpc/xmon/xmon.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
From: Pan Xinhui <hidden> Date: 2017-02-21 06:36:10
在 2017/2/21 09:58, Guilherme G. Piccoli 写道:
quoted hunk
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 we cannot enable/disable xmon in runtime, it needs kernel reload.
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. It's a simple attribute, value 0 meaning xmon is disabled
and value 1 the opposite. Writing these states to the file will take
immediate effect in the debugger.
Signed-off-by: Guilherme G. Piccoli <redacted>
---
v3: logic improved based in the changes made on patch 1.
v2: dropped the custom parser by using simple attributes [mpe suggestion].
arch/powerpc/xmon/xmon.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
From: Guilherme G. Piccoli <hidden> Date: 2017-02-21 13:51:47
On 02/21/2017 03:35 AM, Pan Xinhui wrote:
在 2017/2/21 09:58, Guilherme G. Piccoli 写道:
quoted
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 we cannot enable/disable xmon in runtime, it needs kernel reload.
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. It's a simple attribute, value 0 meaning xmon is disabled
and value 1 the opposite. Writing these states to the file will take
immediate effect in the debugger.
Signed-off-by: Guilherme G. Piccoli <redacted>
---
v3: logic improved based in the changes made on patch 1.
v2: dropped the custom parser by using simple attributes [mpe suggestion].
arch/powerpc/xmon/xmon.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
OK, this is *really* odd.
I sent the wrong version of the patch ={
I'm _sorry_, thanks for noticing Xinhui!
@Michael, my complete fault. I tested the real "v3" of this patch, but
for some reason (aka my disorganization) I sent the old v2. In the v3, I
used "xmon_on = !!val".
How about if I resend the whole series tomorrow, correcting this and
changing patch 2 in order to keep the automatic show of backtrace
always? Or do you prefer to fix it yourself?
Thanks, and again, I apologize for the mess.
Guilherme