Re: [PATCH] add syslog printing to xmon debugger.

From: Keith Owens
Date: Thu Oct 28 2004 - 01:42:53 EST


On Fri, 22 Oct 2004 11:59:17 +1000,
Paul Mackerras <paulus@xxxxxxxxx> wrote:
>Linas,
>
>> Andrew,
>>
>> Please apply at least the kernel/printk.c part of the patch,
>> if you are feeling at all charitable.
>
>Did you ever get any reaction to that?

I see that the printk.c patch was lifted straight from kdb - without
any mention of kdb. It even has the same bug as kdb, which was
corrected in kdb-v4.4-2.6.9-common-2. The current kdb patch to
printk.c is :-

Index: linux/kernel/printk.c
===================================================================
--- linux.orig/kernel/printk.c Tue Oct 19 07:55:35 2004
+++ linux/kernel/printk.c Thu Oct 21 18:06:28 2004
@@ -373,6 +373,20 @@ out:
return error;
}

+#ifdef CONFIG_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_KDB */
+
asmlinkage long sys_syslog(int type, char __user * buf, int len)
{
return do_syslog(type, buf, len);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/