Find the answer to your Linux question:
Results 1 to 2 of 2
My printk statements are like printk (KERN_DEBUG, .........) Because I set printing all to the console. Thus, I get some information from the console. Meanwhile, after running codes, I checked ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Posts
    43

    question about the console and log file from Printk result


    My printk statements are like printk (KERN_DEBUG, .........)

    Because I set printing all to the console. Thus, I get some information from the console.
    Meanwhile, after running codes, I checked the /var/log/debug, which includes the
    information from the console, however, not everything.

    So my questions is
    (1) can printk print ALL the statements to console or /var/log/debug? Or if the printing
    speed is too fast, the printk only can print PART of them?

    Because I use printk debugging the codes, I am afraid I missed some information due to
    my bad understanding about printk.

    Any advice? Thanks a lot!

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    To control the error logging value, use /proc/sys/kernel/printk (echo 8 > /proc/sys/kernel/printk to print all messages, counting down from there.)
    The number of printk's can be controlled by using the /proc/sys/kernel/printk_ratelimit(_burst) files, and testing it like this:
    Code:
    if (printk_ratelimit())
    {
    printk(KERN_DEBUG "Here's an error message that could flood potentially flood the console!\n");
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •