Search code examples
clinux-kernelkernel-moduleprintk

Difference between printk and pr_info


What's the exact difference between printk and pr_info functions ? And under what conditions, should I choose one over the another ?


Solution

  • The kernel's printk.h has:

    #define pr_info(fmt,arg...) \
        printk(KERN_INFO fmt,##arg)
    

    Just like the name, pr_info() is printk() with the KERN_INFO priority.