Principle of sar in linux

Source: Internet
Author: User
The principle of sar in linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. It was originally intended to find out the exception of the System load Status, which could not be checked by conventional means, so it was not necessary to study the moving average calculation method of load. Looking at the source code of sar, we found that sar only reads a series of memory files under linux/proc and obtains data through sampling.

Since I have never read the source code related to linux, I don't know much about many styles and variable definitions, and it is very difficult. After finding the root cause in a bunch of files and header definitions, I found the root cause from the main function for a long time. I didn't think it was read from the file, I thought that I could directly use some OS functions to get my own calculations.

Sar uses these files in fscanf to obtain output data.
QUOTE:

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.