aboutsummaryrefslogtreecommitdiff
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-05-20 21:04:21 -0500
committerJason Wessel <jason.wessel@windriver.com>2010-05-20 21:04:21 -0500
commit67fc4e0cb931d6b4ccf21248e4199b154478ecea (patch)
tree4cf49d00bc9ac03c3c77d91fadd13fcabc75e0c9 /kernel/printk.c
parent5d5314d6795f3c1c0f415348ff8c51f7de042b77 (diff)
kdb: core for kgdb back end (2 of 2)
This patch contains the hooks and instrumentation into kernel which live outside the kernel/debug directory, which the kdb core will call to run commands like lsmod, dmesg, bt etc... CC: linux-arch@vger.kernel.org Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Martin Hicks <mort@sgi.com>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 75077ad0b53..9213b8b5bb4 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -413,6 +413,22 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len)
return do_syslog(type, buf, len, SYSLOG_FROM_CALL);
}
+#ifdef CONFIG_KGDB_KDB
+/* kdb dmesg command needs access to the syslog buffer. do_syslog()
+ * uses locks so it cannot be used during debugging. Just tell kdb
+ * where the start and end of the physical and logical logs are. This
+ * is equivalent to do_syslog(3).
+ */
+void kdb_syslog_data(char *syslog_data[4])
+{
+ syslog_data[0] = log_buf;
+ syslog_data[1] = log_buf + log_buf_len;
+ syslog_data[2] = log_buf + log_end -
+ (logged_chars < log_buf_len ? logged_chars : log_buf_len);
+ syslog_data[3] = log_buf + log_end;
+}
+#endif /* CONFIG_KGDB_KDB */
+
/*
* Call the console drivers on a range of log_buf
*/