The Linux error capture function of akagi201 supports drivers and applications.

Source: Internet
Author: User
/** @ File mydebug. H * @ note Hangzhou hikvision Digital Technology Co ., ltd. all right reserved. * @ brief my error capture function ** @ author liuboyf1 * @ date 2012-10-9 * @ version v1.0.0 ** @ note // description here * @ note history: * @ note <author> <time> <version> <DESC> * @ note * @ warning * // I printed the macro definition # ifdef debug # ifdef _ KERNEL __# define dbg_print_file_line (void) \ do \ {\ printk (kern_emerg "\ n % s: % s (): % d:", _ file __, _ FUNC __, _ line _); \} while (0) # define dbg_print (FMT, argS ...) \ do \ {\ deb_print_file_line (void); \ printk (kern_emerg FMT, # ARGs) ;\} while (0) # define err_print (FMT, argS ...) \ do \ {\ printk (kern_emerg FMT, # ARGs); \} while (0) # else # define dbg_print_file_line (void) \ do \ {\ fprintf (stderr, "\ n % s: % s (): % d:", _ file __, _ FUNC __, _ line _); \} while (0) # define dbg_print (FMT, argS ...) \ do \ {\ dbg_print_file_line (void); fprintf (stderr, FMT, # ARGs); \} while (0) # define err_print (STR) \ do \ {\ dbg_print_file_line (void); \ perror (STR); \} while (0) # endif # else # define dbg_print_file_line (void) do {} while (0) # define dbg_print (FMT, argS ...) do {} while (0) # define err_print (FMT, argS ...) do {} while (0) # endif

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.