From: Jesper Juhl <juhl@eisenstein.dk>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] [PATCH] console_loglevel broken on ia64 - please test and comment
Date: Wed, 17 Oct 2001 20:53:32 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590698805363@msgid-missing> (raw)
[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]
This is an attempt to fix the broken console_loglevel in kernel/printk.c
that Keith Owens reported to the list some hours ago.
Instead of the four different _loglevel variables it adds a
console_printk array to hold the four values - that should be safe.
I have tested this as far as
a) it compiles
b) it boots
c) it has not exploded yet after more than an hour of use
d) "cat /proc/sys/kernel/printk" output looks sane both with and without
the patch
e) changing console_loglevel with "ALT-Sysrq-<number>" works and is
correctly reflected in /proc/sys/kernel/printk
Randy Dunlap was kind enough to take a look at the patch and thought it
looked ok, so I'm now submitting it to a broader audience to get some
more feedback before I try to send this off to Linux and/or Alan.
If nobody seems to screams at it too badly, then I'll make a version
against -ac as well and send it off to Linus and Alan for them to look
at and hopefully include in the next kernel.
The patch is against 2.4.13-pre3 and is attached as
"2.4.13-pre3-console_loglevel.patch".
Best regards,
Jesper Juhl
juhl@eisenstein.dk
[-- Attachment #2: 2.4.13-pre3-console_loglevel.patch --]
[-- Type: text/plain, Size: 2698 bytes --]
diff -ur linux-2.4.13-pre3-orig/arch/i386/mm/fault.c linux-2.4.13-pre3/arch/i386/mm/fault.c
--- linux-2.4.13-pre3-orig/arch/i386/mm/fault.c Wed Oct 10 00:13:03 2001
+++ linux-2.4.13-pre3/arch/i386/mm/fault.c Wed Oct 17 20:04:33 2001
@@ -27,8 +27,6 @@
extern void die(const char *,struct pt_regs *,long);
-extern int console_loglevel;
-
/*
* Ugly, ugly, but the goto's result in better assembly..
*/
diff -ur linux-2.4.13-pre3-orig/arch/parisc/kernel/traps.c linux-2.4.13-pre3/arch/parisc/kernel/traps.c
--- linux-2.4.13-pre3-orig/arch/parisc/kernel/traps.c Sun Sep 30 21:26:08 2001
+++ linux-2.4.13-pre3/arch/parisc/kernel/traps.c Wed Oct 17 20:05:21 2001
@@ -43,7 +43,6 @@
static inline void console_verbose(void)
{
- extern int console_loglevel;
console_loglevel = 15;
}
diff -ur linux-2.4.13-pre3-orig/include/linux/kernel.h linux-2.4.13-pre3/include/linux/kernel.h
--- linux-2.4.13-pre3-orig/include/linux/kernel.h Thu Oct 11 08:44:33 2001
+++ linux-2.4.13-pre3/include/linux/kernel.h Wed Oct 17 22:05:00 2001
@@ -36,6 +36,13 @@
#define KERN_INFO "<6>" /* informational */
#define KERN_DEBUG "<7>" /* debug-level messages */
+extern int console_printk[];
+
+#define console_loglevel (console_printk[0])
+#define default_message_loglevel (console_printk[1])
+#define minimum_console_loglevel (console_printk[2])
+#define default_console_loglevel (console_printk[3])
+
# define NORET_TYPE /**/
# define ATTRIB_NORET __attribute__((noreturn))
# define NORET_AND noreturn,
@@ -79,8 +86,6 @@
asmlinkage int printk(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2)));
-
-extern int console_loglevel;
static inline void console_silent(void)
{
diff -ur linux-2.4.13-pre3-orig/kernel/printk.c linux-2.4.13-pre3/kernel/printk.c
--- linux-2.4.13-pre3-orig/kernel/printk.c Mon Sep 17 22:16:30 2001
+++ linux-2.4.13-pre3/kernel/printk.c Wed Oct 17 22:21:51 2001
@@ -16,6 +16,7 @@
* 01Mar01 Andrew Morton <andrewm@uow.edu.au>
*/
+#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
@@ -39,11 +40,12 @@
DECLARE_WAIT_QUEUE_HEAD(log_wait);
-/* Keep together for sysctl support */
-int console_loglevel = DEFAULT_CONSOLE_LOGLEVEL;
-int default_message_loglevel = DEFAULT_MESSAGE_LOGLEVEL;
-int minimum_console_loglevel = MINIMUM_CONSOLE_LOGLEVEL;
-int default_console_loglevel = DEFAULT_CONSOLE_LOGLEVEL;
+int console_printk[4] = {
+ DEFAULT_CONSOLE_LOGLEVEL, /* console_loglevel */
+ DEFAULT_MESSAGE_LOGLEVEL, /* default_message_loglevel */
+ MINIMUM_CONSOLE_LOGLEVEL, /* minimum_console_loglevel */
+ DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */
+};
int oops_in_progress;
reply other threads:[~2001-10-17 20:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=marc-linux-ia64-105590698805363@msgid-missing \
--to=juhl@eisenstein.dk \
--cc=linux-ia64@vger.kernel.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