The tenth chapter: the Debugging technology of embedded Linux

Source: Internet
Author: User

How to debug: Set breakpoints, step through code, and output debugging information.

Print Nehe Debug information: PRINTK. The PRINTK function runs in kernel space, and the PRINTK function runs in user space. Linux kernel programs such as Linux drivers can only use the PRINTK function to output debug information.

asmlinkage int PRINTK (const char *FMT, ...) The first parameter represents a format string followed by a mutable parameter.

Although using the PRINTK function makes it easy to write a slim to a log file or console, a large number of PRINTK functions that frequently manipulate log files or console device files can severely affect the performance of Linux drivers. Prevent PRINTK functions from reducing the performance of Linux drivers

Data interaction through a virtual file system. In Linux file systems,/proc is often used as a tool for data interaction between kernel space and user space. /proc is not a real file system, but rather a mapping of memory. All read and write/proc are read and write to the memory, so reading and writing the/proc file system is much faster than reading/writing the/dev file system. As a result, the/proc file system can also serve as a tool for Linux to interact with user-space programs. There is a lot of system information that is provided to the outside world through the/proc file system by the kernel space program. The/proc file system, like the/dev file system, also needs to set the action handler function that accesses the file.

The tenth chapter: the Debugging technology of embedded Linux

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.