Some methods for querying the behavior of Linux kernel

Source: Internet
Author: User


To learn about the behavior of the Linux kernel, you need a certain amount of experience, which can be roughly divided into the following:

1. Use printk

You can view some information about printk directly in the kernel code or module code. In this way, you need to compile the kernel code, compile the kernel module, correctly install it into the kernel, and start it. Although it requires so much knowledge, this method is quite earthy. Unless absolutely required, there must be a simpler method than this.

2. View dmesg

This method depends on what information the kernel will output. Dmesg displays important information.

3. proficient in procfs

Procfs contains a lot of useful and interesting information, either you can directly view the information (the format is special and difficult to understand) or analyze it using tools, such as rtstat, tools such as conntrack are analyzed and displayed in readable form In proc. In general, some kernel statistics have corresponding stat files for analysis.

4. Use kprobe

This is a debugging method, but it is generally not used or used.

5. Use small measures

It depends on your intelligence, come up with some of your own logic, guide or trash the kernel into your trap, and prove your guess.

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.