mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Schmidt <list.lkml@jan-o-sch.net>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Kay Sievers <kay@vrfy.org>
Subject: /proc/kmsg giving eof on blocking read
Date: Thu, 22 Nov 2012 11:44:32 +0100	[thread overview]
Message-ID: <50AE0210.7010301@jan-o-sch.net> (raw)

Hi,

I'm currently debugging something in btrfs in good old printk style, generating
around 10MB/min. I'm seeing /proc/kmsg returning eof on a blocking read (and,
side note, syslog-ng won't reopen it, effectively stopping logging kernel
messages silently).

I'm using kernel 3.6.0+ from cmason's tree, which is Linux 3.6.0 (commit
a0d271cbfed1dd50278c6b06bead3d00ba0a88f9) plus the Btrfs code for 3.7 (commit
c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2).

I suspect it has something to do with the data I'm passing to printk. It happens
anywhere from several times per second to once every twenty minutes.

As a workaround (and proof), I'm currently using:

# perl -we 'use Fcntl; sysopen(K, "/proc/kmsg", O_RDONLY) or die "open $!";
while (1) {while ($ret = sysread(K, $buf, 8192)) {print $buf} print STDERR
scalar(localtime(time)), " oops $ret\\n";}' >> /var/tmp/kern

-Jan

             reply	other threads:[~2012-11-22 19:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22 10:44 Jan Schmidt [this message]
2012-11-22 12:29 ` Kay Sievers
2012-11-22 13:20   ` Jan Schmidt

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=50AE0210.7010301@jan-o-sch.net \
    --to=list.lkml@jan-o-sch.net \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®