Re: Does excessive use of printk corrupt log buffer?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 10, 2008 6:50 AM, Shreyansh <shreyansh.jain@xxxxxxxxx> wrote:
> Hi All,
>
> While working (debugging) on one of my kernel modules (a file system),
> I had to put a lot of printk to understand and track all the changes that
> were happening. These printk had variables being printed and sometimes
> in loop. In essence, there was a huge log generated even for a small I/O.
>
> I also noticed that sometimes (not always but not rare as well) the
> /var/log/messages file had grabled text. Part of the text which belonged
> to the thrown printk was corrupted. Besides the order of printk being
> jumbled, the data which was being printed was also corrupted (with special
> characters).
>
> Also, when I reduced the number of printk (switching off a macro), I found
> this problem appearing even lesser. And infact, I could not reproduce this
> problem when I had just 10-20 lines of printk per module call.
>
> What I am wondering is that is it possible that excessive use of printk is
> causing corruption of the printk log buffer? Any hints/pointers as to what
> should I do to debug this kind of problem?
>
> I am currently working on SLES 10 SP1 (2.6.16.46 kernel) on an SMP opteron
> machine.
>
> Thanks,
>
> Shreyansh

Shreyansh,

As a general the output of dmesg is higher quality than
/var/log/messages. Dmesg directly accesses the kernel's memory based
log buffer.

If you want to have a high quality copy of the messages on disk, then
make your own copy.  ie. "dmesg > my-dmesg-copy"

The negative with dmesg is that the kernel's buffer is a fifo.  If for
some reason it is too small for the amount of logging you need, then
you can adjust the size and make as big as you need.

Greg
-- 
Greg Freemyer
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer
First 99 Days Litigation White Paper -
http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf

The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux