From: Mark Lord <lkml@rtr.ca>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH] Fix bytecount result from printk()
Date: Thu, 01 Dec 2005 10:55:49 -0500 [thread overview]
Message-ID: <438F1D05.5020004@rtr.ca> (raw)
[-- Attachment #1: Type: text/plain, Size: 1430 bytes --]
printk() returns a bytecount, which nothing actually appears to use.
This count is generated internally in vprintk(),
and is off-by-3 for one particular path through that function.
This patch fixes it to be consistent with how it is calculated
for the other paths through that same function (vprintk).
Whether or not the count should even exist in the first place
is still a question for examination -- nothing appears to use it.
On a related note, WHY does the LOG LEVEL format <6> not get
interpreted correctly for the first printk() after an oops report?
As in this example -- the <6> is printed, instead of being interpreted:
kernel: <6>note: insmod[31060] exited with preempt_count 1
Here's the off-by-3 fix patch.
Signed-off-by: Mark Lord <lkml@rtr.ca>
--- linux-2.6.15-rc3/kernel/printk.c.orig 2005-11-29 23:24:19.000000000 -0500
+++ linux/kernel/printk.c 2005-12-01 10:01:39.000000000 -0500
@@ -592,8 +592,8 @@
emit_log_char(default_message_loglevel
+ '0');
emit_log_char('>');
- }
- printed_len += 3;
+ } else
+ printed_len += 3;
}
log_level_unknown = 0;
if (!*p)
[-- Attachment #2: printk.patch --]
[-- Type: text/x-patch, Size: 358 bytes --]
--- linux-2.6.15-rc3/kernel/printk.c.orig 2005-11-29 23:24:19.000000000 -0500
+++ linux/kernel/printk.c 2005-12-01 10:01:39.000000000 -0500
@@ -592,8 +592,8 @@
emit_log_char(default_message_loglevel
+ '0');
emit_log_char('>');
- }
- printed_len += 3;
+ } else
+ printed_len += 3;
}
log_level_unknown = 0;
if (!*p)
next reply other threads:[~2005-12-01 15:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-01 15:55 Mark Lord [this message]
2005-12-01 16:09 ` [PATCH] Fix bytecount result from printk() Linus Torvalds
2005-12-01 16:25 ` Mark Lord
2005-12-01 17:57 ` Dave Jones
2005-12-01 20:15 ` David S. Miller
2005-12-02 1:23 ` Andi Kleen
2005-12-01 21:09 ` Mark Lord
2005-12-01 21:16 ` Andi Kleen
2005-12-02 2:04 ` Andrew Morton
2005-12-02 2:22 ` Mark Lord
2005-12-01 20:14 ` David S. Miller
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=438F1D05.5020004@rtr.ca \
--to=lkml@rtr.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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