From: Jason Wessel <jason.wessel@windriver.com>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
kgdb-bugreport@lists.sourceforge.net,
Jason Wessel <jason.wessel@windriver.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
David Airlie <airlied@linux.ie>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 2/9] vt,console,kdb: automatically set kdb LINES variable
Date: Thu, 5 Aug 2010 09:39:51 -0500 [thread overview]
Message-ID: <1281019198-6777-3-git-send-email-jason.wessel@windriver.com> (raw)
In-Reply-To: <1281019198-6777-2-git-send-email-jason.wessel@windriver.com>
The kernel console interface stores the number of lines it is
configured to use. The kdb debugger can greatly benefit by knowing how
many lines there are on the console for the pager functionality
without having the end user compile in the setting or have to
repeatedly change it at run time.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: David Airlie <airlied@linux.ie>
CC: Andrew Morton <akpm@linux-foundation.org>
---
drivers/char/vt.c | 17 +++++++++++++++++
include/linux/kdb.h | 4 ++++
kernel/debug/kdb/kdb_private.h | 2 --
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 117ce99..4a9eb30 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -104,6 +104,7 @@
#include <linux/io.h>
#include <asm/system.h>
#include <linux/uaccess.h>
+#include <linux/kdb.h>
#define MAX_NR_CON_DRIVER 16
@@ -3442,6 +3443,22 @@ int con_debug_enter(struct vc_data *vc)
console_blanked = 0;
if (vc->vc_sw->con_debug_enter)
ret = vc->vc_sw->con_debug_enter(vc);
+#ifdef CONFIG_KGDB_KDB
+ /* Set the initial LINES variable if it is not already set */
+ if (vc->vc_rows < 999) {
+ int linecount;
+ char lns[4];
+ const char *setargs[3] = {
+ "set",
+ "LINES",
+ lns,
+ };
+ if (kdbgetintenv(setargs[0], &linecount)) {
+ snprintf(lns, 4, "%i", vc->vc_rows);
+ kdb_set(2, setargs);
+ }
+ }
+#endif /* CONFIG_KGDB_KDB */
return ret;
}
EXPORT_SYMBOL_GPL(con_debug_enter);
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
index ccb2b3e..ea6e524 100644
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -114,4 +114,8 @@ enum {
KDB_INIT_EARLY,
KDB_INIT_FULL,
};
+
+extern int kdbgetintenv(const char *, int *);
+extern int kdb_set(int, const char **);
+
#endif /* !_KDB_H */
diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h
index 97d3ba6..c438f54 100644
--- a/kernel/debug/kdb/kdb_private.h
+++ b/kernel/debug/kdb/kdb_private.h
@@ -144,9 +144,7 @@ extern int kdb_getword(unsigned long *, unsigned long, size_t);
extern int kdb_putword(unsigned long, unsigned long, size_t);
extern int kdbgetularg(const char *, unsigned long *);
-extern int kdb_set(int, const char **);
extern char *kdbgetenv(const char *);
-extern int kdbgetintenv(const char *, int *);
extern int kdbgetaddrarg(int, const char **, int*, unsigned long *,
long *, char **);
extern int kdbgetsymval(const char *, kdb_symtab_t *);
--
1.6.4.rc1
next prev parent reply other threads:[~2010-08-05 14:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 14:39 [GIT PULL] kgdb,kdb,kms for 2.6.36 (2 of 2) Jason Wessel
2010-08-05 14:39 ` [PATCH 1/9] vt,console,kdb: implement atomic console enter/leave functions Jason Wessel
2010-08-05 14:39 ` Jason Wessel [this message]
2010-08-05 14:39 ` [PATCH 3/9] kgdboc: Add call backs to allow kernel mode switching Jason Wessel
2010-08-05 14:39 ` [PATCH 4/9] fb: add hooks to handle KDB enter/exit Jason Wessel
2010-08-05 14:39 ` [PATCH 5/9] drm: add KGDB/KDB support Jason Wessel
2010-08-05 14:39 ` [PATCH 6/9] drm/i915: use new fb debug hooks Jason Wessel
2010-08-05 14:39 ` [PATCH 7/9] i915: when kgdb is active display compression should be off Jason Wessel
2010-08-05 14:39 ` [PATCH 8/9] drm_fb_helper: Preserve capability to use atomic kms Jason Wessel
2010-08-05 14:39 ` [PATCH 9/9] kgdb,docs: Update the kgdb docs to include kms Jason Wessel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281019198-6777-3-git-send-email-jason.wessel@windriver.com \
--to=jason.wessel@windriver.com \
--cc=airlied@linux.ie \
--cc=akpm@linux-foundation.org \
--cc=jbarnes@virtuousgeek.org \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®