Prepare for the LinuxKernel tour

Source: Internet
Author: User
Prepare for the LinuxKernel journey-general Linux technology-Linux programming and kernel information. The following is a detailed description. Create a debug header file debug_if.h in include \ linux.

In include \ linux \ kernel. h, debug_if.h is included in kernel. h, which facilitates

You can directly use your own macro in the kernel.

# Ifndef _ DEBUG_IF_H __
# Define _ DEBUG_IF_H __

# Define _ SDEBUG_OUT_ENABLE _ 1
# Define _ SDEBUG_DETAIL _ 1

# If _ SDEBUG_OUT_ENABLE _ = 1
Extern int printk (const char * fmt ,...);

# If _ SDEBUG_DETAIL _ = 0
# Define PLINE printk ("[LJH] <% s: % d> enter_now \ n", _ FILE __, _ func __, _ LINE __)

# Define trace_l133 (fmt ,...) printk ("[LMT] <% s: % d>" fmt, _ FILE __, _ func __, _ LINE __, _ VA_ARGS __)

# Else
# Define PLINE {\
Static unsigned short cnt = 0 ;\
Printk ("[lsung] <% s: % d> enter_now \ n", _ FILE __, _ func __, _ LINE __, ++ cnt );}

# Define trace_l133 (fmt ,...){\
Static unsigned short cnt = 0 ;\
Printk ("[LMT] <% s: % d>" fmt, _ FILE __, _ func __, _ LINE __, ++ cnt, _ VA_ARGS __);}

# Endif

# Else
# Define PLINE
# Define trace_l133 (fmt ,...)

# Endif/* _ SDEBUG_OUT_ENABLE _*/

# Endif/* _ DEBUG_IF_H __*/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.