diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2012-08-26 23:37:03 -0400 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2012-10-12 07:37:35 -0400 |
commit | 17b572e82032bc246324ce136696656b66d4e3f1 (patch) | |
tree | ff54f0141d8d9d60c9d8ea1f49842474aa882912 /drivers/tty | |
parent | d1871b38fccdc4b6575b0cabdea9e06bc70167eb (diff) |
kdb,vt_console: Fix missed data due to pager overruns
It is possible to miss data when using the kdb pager. The kdb pager
does not pay attention to the maximum column constraint of the screen
or serial terminal. This result is not incrementing the shown lines
correctly and the pager will print more lines that fit on the screen.
Obviously that is less than useful when using a VGA console where you
cannot scroll back.
The pager will now look at the kdb_buffer string to see how many
characters are printed. It might not be perfect considering you can
output ASCII that might move the cursor position, but it is a
substantially better approximation for viewing dmesg and trace logs.
This also means that the vt screen needs to set the kdb COLUMNS
variable.
Cc: <stable@vger.kernel.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/vt/vt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 84cbf298c094..a13f7e158c5b 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
@@ -3475,6 +3475,19 @@ int con_debug_enter(struct vc_data *vc) | |||
3475 | kdb_set(2, setargs); | 3475 | kdb_set(2, setargs); |
3476 | } | 3476 | } |
3477 | } | 3477 | } |
3478 | if (vc->vc_cols < 999) { | ||
3479 | int colcount; | ||
3480 | char cols[4]; | ||
3481 | const char *setargs[3] = { | ||
3482 | "set", | ||
3483 | "COLUMNS", | ||
3484 | cols, | ||
3485 | }; | ||
3486 | if (kdbgetintenv(setargs[0], &colcount)) { | ||
3487 | snprintf(cols, 4, "%i", vc->vc_cols); | ||
3488 | kdb_set(2, setargs); | ||
3489 | } | ||
3490 | } | ||
3478 | #endif /* CONFIG_KGDB_KDB */ | 3491 | #endif /* CONFIG_KGDB_KDB */ |
3479 | return ret; | 3492 | return ret; |
3480 | } | 3493 | } |