专栏首页腾讯BBTeam团队的专栏sar - Linux 系统监控利器
原创

sar - Linux 系统监控利器

SAR - System Activity Report 系统活动报告

sar可以从多方面对系统的活动进行报告,包括:文件的读写情况、系统调用的使用情况、磁盘I/O、CPU效率、内存使用状况、进程活动及IPC有关的活动等。

sar 包含在 sysstat 软件包中.

常用选项

  • -A:所有报告的总和
  • -u:输出CPU使用情况的统计信息
  • -b:显示I/O和传送速率的统计信息
  • -B:输出系统分页统计信息
  • -d:输出每一个块设备的活动信息
  • -n:输出网络设备的活动信息
  • -v:输出inode、文件和其他内核表的统计信息
  • -r:输出内存和交换空间的统计信息
  • -a:文件读写情况
  • -c:输出进程统计信息,每秒创建的进程数
  • -R:输出内存页面的统计信息
  • -y:终端设备活动情况
  • -w:输出系统交换活动信息

命令分解

监控 CPU 资源使用情况

1. 命令:

sar 1 10

每秒采样一次, 共执行 10 次

或者

sar -u 1 10

2. 输出及解释:

2.1 查看整体的数据

sar -u 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

14:03:34        CPU     %user     %nice   %system   %iowait    %idle    %steal
14:03:35        all     15.21      0.00      3.74      0.25     80.80      0.00
14:03:36        all     12.50      0.00      2.75      0.00     84.75      0.00
14:03:37        all     15.29      0.00      2.01      0.00     82.71      0.00
14:03:38        all      9.98      0.00      2.99      0.00     87.03      0.00
14:03:39        all     16.29      0.00      3.76      0.00     79.95      0.00
14:03:40        all      9.75      0.00      3.75      0.00     86.50      0.00
14:03:41        all     15.75      0.00      3.50      0.00     80.75      0.00
14:03:42        all      9.25      0.00      2.75      0.00     88.00      0.00
14:03:43        all      9.25      0.00      3.00      0.00     87.75      0.00
14:03:44        all     10.75      0.00      4.00      0.00     85.25      0.00
Average:        all     12.40      0.00      3.23      0.03     84.35      0.00

2.2 查看每个 CPU 单独的数据

sar -P ALL 1 2

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

11:28:04 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
11:28:05 PM     all      0.00      0.00      0.00      0.00      0.00    100.00
11:28:05 PM       0      0.00      0.00      0.00      0.00      0.00    100.00
11:28:05 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:28:05 PM       2      0.00      0.00      0.00      0.00      0.00    100.00
11:28:05 PM       3      0.00      0.00      0.00      0.00      0.00    100.00

11:28:05 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
11:28:06 PM     all      0.00      0.00      0.00      0.00      0.00    100.00
11:28:06 PM       0      0.00      0.00      0.00      0.00      0.00    100.00
11:28:06 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:28:06 PM       2      0.00      0.00      0.00      0.00      0.00    100.00
11:28:06 PM       3      0.00      0.00      0.00      0.00      0.00    100.00

2.3 查看 CPU 1 的数据

sar -P 1 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

11:41:57 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
11:41:58 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:41:59 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:42:00 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:42:01 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:42:02 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:42:03 PM       1      0.99      0.00      0.00      0.00      0.00     99.01
11:42:04 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:42:05 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:42:06 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
11:42:07 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
Average:          1      0.10      0.00      0.00      0.00      0.00     99.90

返回值的解释:

# %user:   未标志nice值的用户态程序的CPU占用率
# %nice:   标志了nice值的用户态程序的CPU占用率
# %system: 系统态(内核)程序的CPU占用率
# %iowait: I/O等待的CPU占用率
# %idle:   idle越高,说明CPU越空闲
# %steal:  管理程序(hypervisor)为另一个虚拟进程提供服务而等待虚拟 CPU 的百分比i, 这个一般是在虚拟机中才能看到数值

3. 说明:

  • 若 %iowait 的值过高,表示硬盘存在I/O瓶颈
  • 若 %idle 的值高但系统响应慢时,有可能是 CPU 等待分配内存,此时应加大内存容量
  • 若 %idle 的值持续低于1,则系统的 CPU 处理能力相对较低,表明系统中最需要解决的资源是 CPU

监控 网络 资源使用情况

1. 命令:

sar -n "keyword" 1 10

关键词可以是(不同的发行版有所区别, 可以用 sar -h 查看):

  • DEV 网卡
  • EDEV 网卡 (错误)
  • NFS NFS 客户端
  • NFSD NFS 服务器
  • SOCK Sockets (套接字) (v4)
  • IP IP 流 (v4)
  • EIP IP 流 (v4) (错误)
  • ICMP ICMP 流 (v4)
  • EICMP ICMP 流 (v4) (错误)
  • TCP TCP 流 (v4)
  • ETCP TCP 流 (v4) (错误)
  • UDP UDP 流 (v4)
  • SOCK6 Sockets (套接字) (v6)
  • IP6 IP 流 (v6)
  • EIP6 IP 流 (v6) (错误)
  • ICMP6 ICMP 流 (v6)
  • EICMP6 ICMP 流 (v6) (错误)
  • UDP6 UDP 流 (v6)

2. 输出及解释:

2.1 查看网卡统计数据:

sar -n DEV 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

05:12:40 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
05:12:41 PM      eth0     43.00      0.00      2.51      0.00      0.00      0.00      0.00
05:12:41 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:12:41 PM   docker0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

05:12:41 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
05:12:42 PM      eth0     41.00      1.00      2.40      0.17      0.00      0.00      0.00
05:12:42 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:12:42 PM   docker0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

05:12:42 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
05:12:43 PM      eth0     42.00      2.00      2.46      0.57      0.00      0.00      0.00
05:12:43 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:12:43 PM   docker0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

-n DEV 返回值解释:

  • IFACE : 接口名
  • rxpck/s : 每秒接收的数据包个数
  • txpck/s : 每秒发送的数据包个数
  • rxkB/s : 每秒发送的数据量 KB/s
  • txkB/s : 每秒接收的数据量 KB/s
  • rxcmp/s : 每秒发送的压缩数据包个数
  • rxmcst/s : 每秒接收的多播数据包个数

2.2 查看 Socket 统计数据

sar -n SOCK 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

11:56:59 PM    totsck    tcpsck    udpsck    rawsck   ip-frag    tcp-tw
11:57:00 PM        77         7         0         0         0         0
11:57:01 PM        77         7         0         0         0         0
11:57:02 PM        77         7         0         0         0         0
11:57:03 PM        77         7         0         0         0         0
11:57:04 PM        77         7         0         0         0         0
11:57:05 PM        77         7         0         0         0         0
11:57:06 PM        77         7         0         0         0         0
11:57:07 PM        77         7         0         0         0         0
11:57:08 PM        77         7         0         0         0         0
11:57:09 PM        77         7         0         0         0         0
Average:           77         7         0         0         0         0

-n SOCK 返回值解释:

  • totsck: 系统使用的总的 socket 数量
  • tcpsck: 当前正在使用的 TCP sockt 数量
  • udpsck: 当前正在使用的 UDP sockt 数量
  • rawsck: 当前正在使用的 RAW sockt 数量
  • ip-frag: 当前队列中的 IP 端数量
  • tcp-tw: 当前系统中 TCP TIME_WAIT 数量

3. 说明:

  • 不同的sar 版本提供的数据类型也有所区别, 常用的有 DEV, SOCK 等

监控 块设备 使用情况

1. 命令及解释:

sar -d 2 2 -p

-p 参数表示把 块设备 的名称打印出来

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

11:34:21 PM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
11:34:23 PM       sda     78.71    316.83    483.17     10.16     24.42    310.23     12.58     99.06
11:34:23 PM      sda1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
11:34:23 PM      sda2     78.71    316.83    483.17     10.16     24.42    310.23     12.58     99.06
11:34:23 PM      sda3      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

11:34:23 PM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
11:34:25 PM       sda    115.58    924.62      0.00      8.00      2.00     17.52      8.69    100.45
11:34:25 PM      sda1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
11:34:25 PM      sda2    115.58    924.62      0.00      8.00      2.00     17.52      8.69    100.45
11:34:25 PM      sda3      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
Average:          sda     97.01    618.45    243.39      8.88     13.29    137.16     10.28     99.75
Average:         sda1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:         sda2     97.01    618.45    243.39      8.88     13.29    137.16     10.28     99.75
Average:         sda3      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

解释:

  • DEV: 块设备名
  • tps: 每秒的 I/O 物理请求量, 多次逻辑请求能合并成一次物理请求
  • rd_sec/s: 每秒读扇区的数量, 每个扇区 512bytes
  • wr_sec/s: 每秒写扇区的数量, 每个扇区 512bytes
  • avgrq-sz: 平均每次请求操作的扇区数量
  • avgqu-sz: 平均每次请求的磁盘队列长度
  • await: 每次请求的平均相应时间, 包括队列等待时间和处理时间, 单位 ms
  • svctm: 平均服务时间, 这个数据不准确, 将在后续版本中被取消
  • %util: 花在 I/O 上的 CPU 时间比重

3. 说明:

  • avgqu-sz 的值较低时,设备的利用率较高。
  • 当 %util 的值接近 100% 时,表示设备带宽已经占满, 示例中的块设备性能经常发生饱和现象, 是整个系统的瓶颈

监控 I/O和传输速率 统计情况

1. 命令及解释

sar -b 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

08:21:00 PM       tps      rtps      wtps   bread/s   bwrtn/s
08:21:01 PM      3.00      0.00      3.00      0.00     40.00
08:21:02 PM      3.00      0.00      3.00      0.00     32.00
08:21:03 PM      0.00      0.00      0.00      0.00      0.00
08:21:04 PM      0.00      0.00      0.00      0.00      0.00
08:21:05 PM      0.00      0.00      0.00      0.00      0.00
08:21:06 PM      0.00      0.00      0.00      0.00      0.00
08:21:07 PM      8.00      0.00      8.00      0.00    176.00
08:21:08 PM      0.00      0.00      0.00      0.00      0.00
08:21:09 PM      0.00      0.00      0.00      0.00      0.00
08:21:10 PM      0.00      0.00      0.00      0.00      0.00
Average:         1.40      0.00      1.40      0.00     24.80

解释:

  • tps : 每秒钟物理设备的 I/O 传输总量
  • rtps: 每秒钟从物理设备读入的数据总量
  • wtps: 每秒钟向物理设备写入的数据总量
  • bread/s: 每秒钟从物理设备读入的数据量,单位为 块/s
  • bwrtn/s: 每秒钟向物理设备写入的数据量,单位为 块/s

3. 说明:

  • 通过输出可以看出物理设备的 I/O 使用情况

监控 内存利用率 统计数据

1. 命令及解释:

sar -r 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

11:08:58 PM kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact
11:08:59 PM   4289192   3888848     47.55    772512   2457160    448212      4.36   1408804   1965308
11:09:00 PM   4289192   3888848     47.55    772512   2457160    448212      4.36   1408804   1965308
11:09:01 PM   4289192   3888848     47.55    772512   2457160    448212      4.36   1408804   1965308
11:09:02 PM   4288204   3889836     47.56    772512   2457160    448228      4.36   1408976   1965308
11:09:03 PM   4288168   3889872     47.56    772512   2457164    448228      4.36   1408960   1965308
11:09:04 PM   4288200   3889840     47.56    772512   2457160    448228      4.36   1408812   1965308
11:09:05 PM   4288200   3889840     47.56    772512   2457160    448228      4.36   1408812   1965308
11:09:06 PM   4288200   3889840     47.56    772512   2457160    448228      4.36   1408812   1965308
11:09:07 PM   4288200   3889840     47.56    772512   2457160    448228      4.36   1408812   1965308
11:09:08 PM   4288200   3889840     47.56    772512   2457160    448228      4.36   1408812   1965308
Average:      4288495   3889545     47.56    772512   2457160    448223      4.36   1408841   1965308

解释:

  • kbmemfree:可用内存总数, 这个值和free命令中的free值基本一致,不包括buffer和cache的空间
  • kbmemused:已使用内存总数, 这个值和free命令中的used值基本一致,包括buffer和cache的空间, 不包括内核自己使用的内存
  • %memused:这个值是kbmemused和内存总量(不包括swap)的一个百分比.
  • kbbuffers: 被内核作为 buffer 使用的内存总数
  • kbcached: 被内核作为 cache 使用的内存总数
  • kbcommit:保证当前系统负载所需要的内存,即为了确保不溢出而需要的内存(RAM+swap).
  • %commit:这个值是kbcommit与内存总量(包括swap)的一个百分比.
  • kbactive: 最近活跃的内存量, 这部分内存除非特别必要不会被回收
  • kbinact: 最近不活跃的内存量, 这部分内存可以被回收利用

3. 说明:

  • %commit 的值可能会超过 100%, 因为系统内核经常会过量使用内存

监控 内存 使用情况

1. 命令及解释

sar -R 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

11:24:40 PM   frmpg/s   bufpg/s   campg/s
11:24:41 PM    -33.00      0.00      0.00
11:24:42 PM     -2.00      0.00      0.00
11:24:43 PM      0.00      0.00      0.00
11:24:44 PM      0.00      0.00      0.00
11:24:45 PM      0.00      0.00      0.00
11:24:46 PM      0.00      0.00      0.00
11:24:47 PM      0.00      0.00      0.00
11:24:48 PM      0.00      0.00      0.00
11:24:49 PM      0.00      0.00      0.00
11:24:50 PM      0.00      0.00      0.00
Average:        -3.50      0.00      0.00

解释:

  • frmpg/s: 每秒被系统释放的内存页数量, 负数表示被分配的内存页数量. 1页通常是 4kB 或者 8kB
  • bufpg/s: 每秒增加的 buffer 内存页数量
  • campg/s: 每秒增加的 cache 内存页数量

3. 说明:

  • 不同的sar 版本提供的数据类型也有所区别

监控 队列长度和平均负载 统计数据

1. 命令及解释

sar -q 1 10

Linux 3.5.0-52-generic (VM-154-67-ubuntu)       10/20/2014      _x86_64_        (4 CPU)

09:04:20 PM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked
09:04:21 PM         0       116      0.00      0.01      0.05         0
09:04:22 PM         0       116      0.00      0.01      0.05         0
09:04:23 PM         0       116      0.00      0.01      0.05         0
09:04:24 PM         0       116      0.00      0.01      0.05         0
09:04:25 PM         0       116      0.00      0.01      0.05         0
09:04:26 PM         0       116      0.00      0.01      0.05         0
09:04:27 PM         0       116      0.00      0.01      0.05         0
09:04:28 PM         0       116      0.00      0.01      0.05         0
09:04:29 PM         0       116      0.00      0.01      0.05         0
09:04:30 PM         0       116      0.00      0.01      0.05         0
Average:            0       116      0.00      0.01      0.05         0

解释:

  • runq-sz: 等待运行的进程数(队列长度)
  • plist-sz: 进程列表中进程(processes)和线程(threads)的数量
  • ldavg-1: 最后1分钟的系统平均负载(System load average)
  • ldavg-5: 过去5分钟的系统平均负载
  • ldavg-15: 过去15分钟的系统平均负载

3. 说明:

  • 主要用来查看系统调度情况和系统负载情况
  • 这个数据可以和 /proc/loadavg 参照查看

技巧

  • 怀疑CPU存在瓶颈,可用 sar -u 和 sar -q 等来查看
  • 怀疑内存存在瓶颈,可用 sar -B、sar -r 和 sar -W 等来查看
  • 怀疑I/O存在瓶颈,可用 sar -b、sar -u 和 sar -d 等来查看

源码

sar是通过 fscanf 系统状态获取的数据, 在源码的 rd_stats.h 中定义了, 这些状态是从系统的哪些文件中得到的数据

https://github.com/sysstat/sysstat/blob/master/rd_stats.h

/*
 * rd_stats.h: Include file used to read system statistics
 * (C) 1999-2018 by Sebastien Godard (sysstat <at> orange.fr)
 */

#ifndef _RD_STATS_H
#define _RD_STATS_H

/*
 ***************************************************************************
 * Miscellaneous constants
 ***************************************************************************
 */

/* Get IFNAMSIZ */
#include <net/if.h>
#ifndef IFNAMSIZ
#define IFNAMSIZ	16
#endif

/* Maximum length of block device name */
#define MAX_DEV_LEN	128
/* Maximum length of network interface name */
#define MAX_IFACE_LEN	IFNAMSIZ
/* Maximum length of USB manufacturer string */
#define MAX_MANUF_LEN	24
/* Maximum length of USB product string */
#define MAX_PROD_LEN	48
/* Maximum length of filesystem name */
#define MAX_FS_LEN	128
/* Maximum length of FC host name */
#define MAX_FCH_LEN	16

#define CNT_PART	1
#define CNT_ALL_DEV	0
#define CNT_USED_DEV	1

#define K_DUPLEX_HALF	"half"
#define K_DUPLEX_FULL	"full"

#define C_DUPLEX_HALF	1
#define C_DUPLEX_FULL	2

/* Type for all functions counting items. Value can be negative (-1) */
#define __nr_t		int

/*
 ***************************************************************************
 * System files containing statistics
 ***************************************************************************
 */

/* Files */
#define PROC		"/proc"
#define SERIAL		"/proc/tty/driver/serial"
#define FDENTRY_STATE	"/proc/sys/fs/dentry-state"
#define FFILE_NR	"/proc/sys/fs/file-nr"
#define FINODE_STATE	"/proc/sys/fs/inode-state"
#define PTY_NR		"/proc/sys/kernel/pty/nr"
#define NET_DEV		"/proc/net/dev"
#define NET_SOCKSTAT	"/proc/net/sockstat"
#define NET_SOCKSTAT6	"/proc/net/sockstat6"
#define NET_RPC_NFS	"/proc/net/rpc/nfs"
#define NET_RPC_NFSD	"/proc/net/rpc/nfsd"
#define NET_SOFTNET	"/proc/net/softnet_stat"
#define LOADAVG		"/proc/loadavg"
#define VMSTAT		"/proc/vmstat"
#define NET_SNMP	"/proc/net/snmp"
#define NET_SNMP6	"/proc/net/snmp6"
#define CPUINFO		"/proc/cpuinfo"
#define MTAB		"/etc/mtab"
#define IF_DUPLEX	"/sys/class/net/%s/duplex"
#define IF_SPEED	"/sys/class/net/%s/speed"
#define FC_RX_FRAMES	"%s/%s/statistics/rx_frames"
#define FC_TX_FRAMES	"%s/%s/statistics/tx_frames"
#define FC_RX_WORDS	"%s/%s/statistics/rx_words"
#define FC_TX_WORDS	"%s/%s/statistics/tx_words"

/*
 ***************************************************************************
 * Definitions of structures for system statistics.
 * WARNING: Fields order matters for SVG graphs!
 ***************************************************************************
 */

#define SIZEOF_LONG_64BIT	8
#define ULL_ALIGNMENT_WIDTH	8
#define UL_ALIGNMENT_WIDTH	SIZEOF_LONG_64BIT
#define U_ALIGNMENT_WIDTH	4

#define MAP_SIZE(m)	((m[0] * ULL_ALIGNMENT_WIDTH) + \
			 (m[1] * UL_ALIGNMENT_WIDTH) +  \
			 (m[2] * U_ALIGNMENT_WIDTH))

/*
 * Structure for CPU statistics.
 * In activity buffer: First structure is for global CPU utilisation ("all").
 * Following structures are for each individual CPU (0, 1, etc.)
 */
struct stats_cpu {
	unsigned long long cpu_user;
	unsigned long long cpu_nice;
	unsigned long long cpu_sys;
	unsigned long long cpu_idle;
	unsigned long long cpu_iowait;
	unsigned long long cpu_steal;
	unsigned long long cpu_hardirq;
	unsigned long long cpu_softirq;
	unsigned long long cpu_guest;
	unsigned long long cpu_guest_nice;
};

#define STATS_CPU_SIZE	(sizeof(struct stats_cpu))
#define STATS_CPU_ULL	10
#define STATS_CPU_UL	0
#define STATS_CPU_U	0

/*
 * Structure for task creation and context switch statistics.
 * The attribute (aligned(16)) is necessary so that sizeof(structure) has
 * the same value on 32 and 64-bit architectures.
 */
struct stats_pcsw {
	unsigned long long context_switch;
	unsigned long	   processes	__attribute__ ((aligned (8)));
};

#define STATS_PCSW_SIZE	(sizeof(struct stats_pcsw))
#define STATS_PCSW_ULL	1
#define STATS_PCSW_UL	1
#define STATS_PCSW_U	0

/*
 * Structure for interrupts statistics.
 * In activity buffer: First structure is for total number of interrupts ("SUM").
 * Following structures are for each individual interrupt (0, 1, etc.)
 */
struct stats_irq {
	unsigned long long irq_nr;
};

#define STATS_IRQ_SIZE	(sizeof(struct stats_irq))
#define STATS_IRQ_ULL	1
#define STATS_IRQ_UL	0
#define STATS_IRQ_U	0

/* Structure for swapping statistics */
struct stats_swap {
	unsigned long pswpin	__attribute__ ((aligned (8)));
	unsigned long pswpout	__attribute__ ((aligned (8)));
};

#define STATS_SWAP_SIZE	(sizeof(struct stats_swap))
#define STATS_SWAP_ULL	0
#define STATS_SWAP_UL	2
#define STATS_SWAP_U	0

/* Structure for paging statistics */
struct stats_paging {
	unsigned long pgpgin		__attribute__ ((aligned (8)));
	unsigned long pgpgout		__attribute__ ((aligned (8)));
	unsigned long pgfault		__attribute__ ((aligned (8)));
	unsigned long pgmajfault	__attribute__ ((aligned (8)));
	unsigned long pgfree		__attribute__ ((aligned (8)));
	unsigned long pgscan_kswapd	__attribute__ ((aligned (8)));
	unsigned long pgscan_direct	__attribute__ ((aligned (8)));
	unsigned long pgsteal		__attribute__ ((aligned (8)));
};

#define STATS_PAGING_SIZE	(sizeof(struct stats_paging))
#define STATS_PAGING_ULL	0
#define STATS_PAGING_UL		8
#define STATS_PAGING_U		0

/* Structure for I/O and transfer rate statistics */
struct stats_io {
	unsigned long long dk_drive;
	unsigned long long dk_drive_rio;
	unsigned long long dk_drive_wio;
	unsigned long long dk_drive_rblk;
	unsigned long long dk_drive_wblk;
};

#define STATS_IO_SIZE	(sizeof(struct stats_io))
#define STATS_IO_ULL	5
#define STATS_IO_UL	0
#define STATS_IO_U	0

/* Structure for memory and swap space utilization statistics */
struct stats_memory {
	unsigned long long frmkb;
	unsigned long long bufkb;
	unsigned long long camkb;
	unsigned long long tlmkb;
	unsigned long long frskb;
	unsigned long long tlskb;
	unsigned long long caskb;
	unsigned long long comkb;
	unsigned long long activekb;
	unsigned long long inactkb;
	unsigned long long dirtykb;
	unsigned long long anonpgkb;
	unsigned long long slabkb;
	unsigned long long kstackkb;
	unsigned long long pgtblkb;
	unsigned long long vmusedkb;
	unsigned long long availablekb;
};

#define STATS_MEMORY_SIZE	(sizeof(struct stats_memory))
#define STATS_MEMORY_ULL	17
#define STATS_MEMORY_UL		0
#define STATS_MEMORY_U		0

/* Structure for kernel tables statistics */
struct stats_ktables {
	unsigned long long file_used;
	unsigned long long inode_used;
	unsigned long long dentry_stat;
	unsigned long long pty_nr;
};

#define STATS_KTABLES_SIZE	(sizeof(struct stats_ktables))
#define STATS_KTABLES_ULL	4
#define STATS_KTABLES_UL	0
#define STATS_KTABLES_U		0

/* Structure for queue and load statistics */
struct stats_queue {
	unsigned long long nr_running;
	unsigned long long procs_blocked;
	unsigned long long nr_threads;
	unsigned int	   load_avg_1;
	unsigned int	   load_avg_5;
	unsigned int	   load_avg_15;
};

#define STATS_QUEUE_SIZE	(sizeof(struct stats_queue))
#define STATS_QUEUE_ULL		3
#define STATS_QUEUE_UL		0
#define STATS_QUEUE_U		3

/* Structure for serial statistics */
struct stats_serial {
	unsigned int rx;
	unsigned int tx;
	unsigned int frame;
	unsigned int parity;
	unsigned int brk;
	unsigned int overrun;
	unsigned int line;
};

#define STATS_SERIAL_SIZE	(sizeof(struct stats_serial))
#define STATS_SERIAL_ULL	0
#define STATS_SERIAL_UL		0
#define STATS_SERIAL_U		7

/* Structure for block devices statistics */
struct stats_disk {
	unsigned long long nr_ios;
	unsigned long	   rd_sect	__attribute__ ((aligned (8)));
	unsigned long	   wr_sect	__attribute__ ((aligned (8)));
	unsigned int	   rd_ticks	__attribute__ ((aligned (8)));
	unsigned int	   wr_ticks;
	unsigned int	   tot_ticks;
	unsigned int	   rq_ticks;
	unsigned int	   major;
	unsigned int	   minor;
};

#define STATS_DISK_SIZE	(sizeof(struct stats_disk))
#define STATS_DISK_ULL	1
#define STATS_DISK_UL	2
#define STATS_DISK_U	6

/* Structure for network interfaces statistics */
struct stats_net_dev {
	unsigned long long rx_packets;
	unsigned long long tx_packets;
	unsigned long long rx_bytes;
	unsigned long long tx_bytes;
	unsigned long long rx_compressed;
	unsigned long long tx_compressed;
	unsigned long long multicast;
	unsigned int	   speed;
	char		   interface[MAX_IFACE_LEN];
	char		   duplex;
};

#define STATS_NET_DEV_SIZE	(sizeof(struct stats_net_dev))
#define STATS_NET_DEV_SIZE2CMP	(STATS_NET_DEV_SIZE - MAX_IFACE_LEN - 1)
#define STATS_NET_DEV_ULL	7
#define STATS_NET_DEV_UL	0
#define STATS_NET_DEV_U		1

/* Structure for network interface errors statistics */
struct stats_net_edev {
	unsigned long long collisions;
	unsigned long long rx_errors;
	unsigned long long tx_errors;
	unsigned long long rx_dropped;
	unsigned long long tx_dropped;
	unsigned long long rx_fifo_errors;
	unsigned long long tx_fifo_errors;
	unsigned long long rx_frame_errors;
	unsigned long long tx_carrier_errors;
	char		   interface[MAX_IFACE_LEN];
};

#define STATS_NET_EDEV_SIZE	(sizeof(struct stats_net_edev))
#define STATS_NET_EDEV_SIZE2CMP	(STATS_NET_EDEV_SIZE - MAX_IFACE_LEN)
#define STATS_NET_EDEV_ULL	9
#define STATS_NET_EDEV_UL	0
#define STATS_NET_EDEV_U	0

/* Structure for NFS client statistics */
struct stats_net_nfs {
	unsigned int nfs_rpccnt;
	unsigned int nfs_rpcretrans;
	unsigned int nfs_readcnt;
	unsigned int nfs_writecnt;
	unsigned int nfs_accesscnt;
	unsigned int nfs_getattcnt;
};

#define STATS_NET_NFS_SIZE	(sizeof(struct stats_net_nfs))
#define STATS_NET_NFS_ULL	0
#define STATS_NET_NFS_UL	0
#define STATS_NET_NFS_U		6

/* Structure for NFS server statistics */
struct stats_net_nfsd {
	unsigned int nfsd_rpccnt;
	unsigned int nfsd_rpcbad;
	unsigned int nfsd_netcnt;
	unsigned int nfsd_netudpcnt;
	unsigned int nfsd_nettcpcnt;
	unsigned int nfsd_rchits;
	unsigned int nfsd_rcmisses;
	unsigned int nfsd_readcnt;
	unsigned int nfsd_writecnt;
	unsigned int nfsd_accesscnt;
	unsigned int nfsd_getattcnt;
};

#define STATS_NET_NFSD_SIZE	(sizeof(struct stats_net_nfsd))
#define STATS_NET_NFSD_ULL	0
#define STATS_NET_NFSD_UL	0
#define STATS_NET_NFSD_U	11

/* Structure for IPv4 sockets statistics */
struct stats_net_sock {
	unsigned int sock_inuse;
	unsigned int tcp_inuse;
	unsigned int tcp_tw;
	unsigned int udp_inuse;
	unsigned int raw_inuse;
	unsigned int frag_inuse;
};

#define STATS_NET_SOCK_SIZE	(sizeof(struct stats_net_sock))
#define STATS_NET_SOCK_ULL	0
#define STATS_NET_SOCK_UL	0
#define STATS_NET_SOCK_U	6

/* Structure for IP statistics */
struct stats_net_ip {
	unsigned long long InReceives;
	unsigned long long ForwDatagrams;
	unsigned long long InDelivers;
	unsigned long long OutRequests;
	unsigned long long ReasmReqds;
	unsigned long long ReasmOKs;
	unsigned long long FragOKs;
	unsigned long long FragCreates;
};

#define STATS_NET_IP_SIZE	(sizeof(struct stats_net_ip))
#define STATS_NET_IP_ULL	8
#define STATS_NET_IP_UL		0
#define STATS_NET_IP_U		0

/* Structure for IP errors statistics */
struct stats_net_eip {
	unsigned long long InHdrErrors;
	unsigned long long InAddrErrors;
	unsigned long long InUnknownProtos;
	unsigned long long InDiscards;
	unsigned long long OutDiscards;
	unsigned long long OutNoRoutes;
	unsigned long long ReasmFails;
	unsigned long long FragFails;
};

#define STATS_NET_EIP_SIZE	(sizeof(struct stats_net_eip))
#define STATS_NET_EIP_ULL	8
#define STATS_NET_EIP_UL	0
#define STATS_NET_EIP_U		0

/* Structure for ICMP statistics */
struct stats_net_icmp {
	unsigned long InMsgs		__attribute__ ((aligned (8)));
	unsigned long OutMsgs		__attribute__ ((aligned (8)));
	unsigned long InEchos		__attribute__ ((aligned (8)));
	unsigned long InEchoReps	__attribute__ ((aligned (8)));
	unsigned long OutEchos		__attribute__ ((aligned (8)));
	unsigned long OutEchoReps	__attribute__ ((aligned (8)));
	unsigned long InTimestamps	__attribute__ ((aligned (8)));
	unsigned long InTimestampReps	__attribute__ ((aligned (8)));
	unsigned long OutTimestamps	__attribute__ ((aligned (8)));
	unsigned long OutTimestampReps	__attribute__ ((aligned (8)));
	unsigned long InAddrMasks	__attribute__ ((aligned (8)));
	unsigned long InAddrMaskReps	__attribute__ ((aligned (8)));
	unsigned long OutAddrMasks	__attribute__ ((aligned (8)));
	unsigned long OutAddrMaskReps	__attribute__ ((aligned (8)));
};

#define STATS_NET_ICMP_SIZE	(sizeof(struct stats_net_icmp))
#define STATS_NET_ICMP_ULL	0
#define STATS_NET_ICMP_UL	14
#define STATS_NET_ICMP_U	0

/* Structure for ICMP error message statistics */
struct stats_net_eicmp {
	unsigned long InErrors		__attribute__ ((aligned (8)));
	unsigned long OutErrors		__attribute__ ((aligned (8)));
	unsigned long InDestUnreachs	__attribute__ ((aligned (8)));
	unsigned long OutDestUnreachs	__attribute__ ((aligned (8)));
	unsigned long InTimeExcds	__attribute__ ((aligned (8)));
	unsigned long OutTimeExcds	__attribute__ ((aligned (8)));
	unsigned long InParmProbs	__attribute__ ((aligned (8)));
	unsigned long OutParmProbs	__attribute__ ((aligned (8)));
	unsigned long InSrcQuenchs	__attribute__ ((aligned (8)));
	unsigned long OutSrcQuenchs	__attribute__ ((aligned (8)));
	unsigned long InRedirects	__attribute__ ((aligned (8)));
	unsigned long OutRedirects	__attribute__ ((aligned (8)));
};

#define STATS_NET_EICMP_SIZE	(sizeof(struct stats_net_eicmp))
#define STATS_NET_EICMP_ULL	0
#define STATS_NET_EICMP_UL	12
#define STATS_NET_EICMP_U	0

/* Structure for TCP statistics */
struct stats_net_tcp {
	unsigned long ActiveOpens	__attribute__ ((aligned (8)));
	unsigned long PassiveOpens	__attribute__ ((aligned (8)));
	unsigned long InSegs		__attribute__ ((aligned (8)));
	unsigned long OutSegs		__attribute__ ((aligned (8)));
};

#define STATS_NET_TCP_SIZE	(sizeof(struct stats_net_tcp))
#define STATS_NET_TCP_ULL	0
#define STATS_NET_TCP_UL	4
#define STATS_NET_TCP_U		0

/* Structure for TCP errors statistics */
struct stats_net_etcp {
	unsigned long AttemptFails	__attribute__ ((aligned (8)));
	unsigned long EstabResets	__attribute__ ((aligned (8)));
	unsigned long RetransSegs	__attribute__ ((aligned (8)));
	unsigned long InErrs		__attribute__ ((aligned (8)));
	unsigned long OutRsts		__attribute__ ((aligned (8)));
};

#define STATS_NET_ETCP_SIZE	(sizeof(struct stats_net_etcp))
#define STATS_NET_ETCP_ULL	0
#define STATS_NET_ETCP_UL	5
#define STATS_NET_ETCP_U	0

/* Structure for UDP statistics */
struct stats_net_udp {
	unsigned long InDatagrams	__attribute__ ((aligned (8)));
	unsigned long OutDatagrams	__attribute__ ((aligned (8)));
	unsigned long NoPorts		__attribute__ ((aligned (8)));
	unsigned long InErrors		__attribute__ ((aligned (8)));
};

#define STATS_NET_UDP_SIZE	(sizeof(struct stats_net_udp))
#define STATS_NET_UDP_ULL	0
#define STATS_NET_UDP_UL	4
#define STATS_NET_UDP_U		0

/* Structure for IPv6 sockets statistics */
struct stats_net_sock6 {
	unsigned int tcp6_inuse;
	unsigned int udp6_inuse;
	unsigned int raw6_inuse;
	unsigned int frag6_inuse;
};

#define STATS_NET_SOCK6_SIZE	(sizeof(struct stats_net_sock6))
#define STATS_NET_SOCK6_ULL	0
#define STATS_NET_SOCK6_UL	0
#define STATS_NET_SOCK6_U	4

/* Structure for IPv6 statistics */
struct stats_net_ip6 {
	unsigned long long InReceives6;
	unsigned long long OutForwDatagrams6;
	unsigned long long InDelivers6;
	unsigned long long OutRequests6;
	unsigned long long ReasmReqds6;
	unsigned long long ReasmOKs6;
	unsigned long long InMcastPkts6;
	unsigned long long OutMcastPkts6;
	unsigned long long FragOKs6;
	unsigned long long FragCreates6;
};

#define STATS_NET_IP6_SIZE	(sizeof(struct stats_net_ip6))
#define STATS_NET_IP6_ULL	10
#define STATS_NET_IP6_UL	0
#define STATS_NET_IP6_U		0

/* Structure for IPv6 errors statistics */
struct stats_net_eip6 {
	unsigned long long InHdrErrors6;
	unsigned long long InAddrErrors6;
	unsigned long long InUnknownProtos6;
	unsigned long long InTooBigErrors6;
	unsigned long long InDiscards6;
	unsigned long long OutDiscards6;
	unsigned long long InNoRoutes6;
	unsigned long long OutNoRoutes6;
	unsigned long long ReasmFails6;
	unsigned long long FragFails6;
	unsigned long long InTruncatedPkts6;
};

#define STATS_NET_EIP6_SIZE	(sizeof(struct stats_net_eip6))
#define STATS_NET_EIP6_ULL	11
#define STATS_NET_EIP6_UL	0
#define STATS_NET_EIP6_U	0

/* Structure for ICMPv6 statistics */
struct stats_net_icmp6 {
	unsigned long InMsgs6				__attribute__ ((aligned (8)));
	unsigned long OutMsgs6				__attribute__ ((aligned (8)));
	unsigned long InEchos6				__attribute__ ((aligned (8)));
	unsigned long InEchoReplies6			__attribute__ ((aligned (8)));
	unsigned long OutEchoReplies6			__attribute__ ((aligned (8)));
	unsigned long InGroupMembQueries6		__attribute__ ((aligned (8)));
	unsigned long InGroupMembResponses6		__attribute__ ((aligned (8)));
	unsigned long OutGroupMembResponses6		__attribute__ ((aligned (8)));
	unsigned long InGroupMembReductions6		__attribute__ ((aligned (8)));
	unsigned long OutGroupMembReductions6		__attribute__ ((aligned (8)));
	unsigned long InRouterSolicits6			__attribute__ ((aligned (8)));
	unsigned long OutRouterSolicits6		__attribute__ ((aligned (8)));
	unsigned long InRouterAdvertisements6		__attribute__ ((aligned (8)));
	unsigned long InNeighborSolicits6		__attribute__ ((aligned (8)));
	unsigned long OutNeighborSolicits6		__attribute__ ((aligned (8)));
	unsigned long InNeighborAdvertisements6		__attribute__ ((aligned (8)));
	unsigned long OutNeighborAdvertisements6	__attribute__ ((aligned (8)));
};

#define STATS_NET_ICMP6_SIZE	(sizeof(struct stats_net_icmp6))
#define STATS_NET_ICMP6_ULL	0
#define STATS_NET_ICMP6_UL	17
#define STATS_NET_ICMP6_U	0

/* Structure for ICMPv6 error message statistics */
struct stats_net_eicmp6 {
	unsigned long InErrors6		__attribute__ ((aligned (8)));
	unsigned long InDestUnreachs6	__attribute__ ((aligned (8)));
	unsigned long OutDestUnreachs6	__attribute__ ((aligned (8)));
	unsigned long InTimeExcds6	__attribute__ ((aligned (8)));
	unsigned long OutTimeExcds6	__attribute__ ((aligned (8)));
	unsigned long InParmProblems6	__attribute__ ((aligned (8)));
	unsigned long OutParmProblems6	__attribute__ ((aligned (8)));
	unsigned long InRedirects6	__attribute__ ((aligned (8)));
	unsigned long OutRedirects6	__attribute__ ((aligned (8)));
	unsigned long InPktTooBigs6	__attribute__ ((aligned (8)));
	unsigned long OutPktTooBigs6	__attribute__ ((aligned (8)));
};

#define STATS_NET_EICMP6_SIZE	(sizeof(struct stats_net_eicmp6))
#define STATS_NET_EICMP6_ULL	0
#define STATS_NET_EICMP6_UL	11
#define STATS_NET_EICMP6_U	0

/* Structure for UDPv6 statistics */
struct stats_net_udp6 {
	unsigned long InDatagrams6	__attribute__ ((aligned (8)));
	unsigned long OutDatagrams6	__attribute__ ((aligned (8)));
	unsigned long NoPorts6		__attribute__ ((aligned (8)));
	unsigned long InErrors6		__attribute__ ((aligned (8)));
};

#define STATS_NET_UDP6_SIZE	(sizeof(struct stats_net_udp6))
#define STATS_NET_UDP6_ULL	0
#define STATS_NET_UDP6_UL	4
#define STATS_NET_UDP6_U	0

/*
 * Structure for CPU frequency statistics.
 * In activity buffer: First structure is for global CPU utilisation ("all").
 * Following structures are for each individual CPU (0, 1, etc.)
 */
struct stats_pwr_cpufreq {
	unsigned long cpufreq	__attribute__ ((aligned (8)));
};

#define STATS_PWR_CPUFREQ_SIZE	(sizeof(struct stats_pwr_cpufreq))
#define STATS_PWR_CPUFREQ_ULL	0
#define STATS_PWR_CPUFREQ_UL	1
#define STATS_PWR_CPUFREQ_U	0

/* Structure for hugepages statistics */
struct stats_huge {
	unsigned long long frhkb;
	unsigned long long tlhkb;
};

#define STATS_HUGE_SIZE	(sizeof(struct stats_memory))
#define STATS_HUGE_ULL	2
#define STATS_HUGE_UL	0
#define STATS_HUGE_U	0

/*
 * Structure for weighted CPU frequency statistics.
 * In activity buffer: First structure is for global CPU utilisation ("all").
 * Following structures are for each individual CPU (0, 1, etc.)
 */
struct stats_pwr_wghfreq {
	unsigned long long time_in_state;
	unsigned long 	   freq		__attribute__ ((aligned (8)));
};

#define STATS_PWR_WGHFREQ_SIZE	(sizeof(struct stats_pwr_wghfreq))
#define STATS_PWR_WGHFREQ_ULL	1
#define STATS_PWR_WGHFREQ_UL	1
#define STATS_PWR_WGHFREQ_U	0

/*
 * Structure for USB devices plugged into the system.
 */
struct stats_pwr_usb {
	unsigned int bus_nr;
	unsigned int vendor_id;
	unsigned int product_id;
	unsigned int bmaxpower;
	char	     manufacturer[MAX_MANUF_LEN];
	char	     product[MAX_PROD_LEN];
};

#define STATS_PWR_USB_SIZE	(sizeof(struct stats_pwr_usb))
#define STATS_PWR_USB_ULL	0
#define STATS_PWR_USB_UL	0
#define STATS_PWR_USB_U		4

/* Structure for filesystems statistics */
struct stats_filesystem {
	unsigned long long f_blocks;
	unsigned long long f_bfree;
	unsigned long long f_bavail;
	unsigned long long f_files;
	unsigned long long f_ffree;
	char 		   fs_name[MAX_FS_LEN];
	char 		   mountp[MAX_FS_LEN];
};

#define STATS_FILESYSTEM_SIZE		(sizeof(struct stats_filesystem))
#define STATS_FILESYSTEM_SIZE2CMP	(STATS_FILESYSTEM_SIZE - 2 * MAX_FS_LEN)
#define STATS_FILESYSTEM_ULL		5
#define STATS_FILESYSTEM_UL		0
#define STATS_FILESYSTEM_U		0

/* Structure for Fibre Channel HBA statistics */
struct stats_fchost {
	unsigned long f_rxframes		__attribute__ ((aligned (8)));
	unsigned long f_txframes		__attribute__ ((aligned (8)));
	unsigned long f_rxwords			__attribute__ ((aligned (8)));
	unsigned long f_txwords			__attribute__ ((aligned (8)));
	char	      fchost_name[MAX_FCH_LEN]	__attribute__ ((aligned (8)));
};

#define STATS_FCHOST_SIZE	(sizeof(struct stats_fchost))
#define STATS_FCHOST_ULL	0
#define STATS_FCHOST_UL		4
#define STATS_FCHOST_U		0

/* Structure for softnet statistics */
struct stats_softnet {
	unsigned int processed;
	unsigned int dropped;
	unsigned int time_squeeze;
	unsigned int received_rps;
	unsigned int flow_limit;
};

#define STATS_SOFTNET_SIZE	(sizeof(struct stats_softnet))
#define STATS_SOFTNET_ULL	0
#define STATS_SOFTNET_UL	0
#define STATS_SOFTNET_U		5

/*
 ***************************************************************************
 * Prototypes for functions used to read system statistics
 ***************************************************************************
 */

void compute_ext_disk_stats
	(struct stats_disk *, struct stats_disk *, unsigned long long,
	 struct ext_disk_stats *);
unsigned long long get_per_cpu_interval
	(struct stats_cpu *, struct stats_cpu *);
__nr_t read_stat_cpu
	(struct stats_cpu *, __nr_t);
__nr_t read_stat_irq
	(struct stats_irq *, __nr_t);
__nr_t read_meminfo
	(struct stats_memory *);
void read_uptime
	(unsigned long long *);
#ifdef SOURCE_SADC
void oct2chr
	(char *);
__nr_t read_stat_pcsw
	(struct stats_pcsw *);
__nr_t read_loadavg
	(struct stats_queue *);
__nr_t read_vmstat_swap
	(struct stats_swap *);
__nr_t read_vmstat_paging
	(struct stats_paging *);
__nr_t read_diskstats_io
	(struct stats_io *);
__nr_t read_diskstats_disk
	(struct stats_disk *, __nr_t, int);
__nr_t read_tty_driver_serial
	(struct stats_serial *, __nr_t);
__nr_t read_kernel_tables
	(struct stats_ktables *);
__nr_t read_net_dev
	(struct stats_net_dev *, __nr_t);
void read_if_info
	(struct stats_net_dev *, int);
__nr_t read_net_edev
	(struct stats_net_edev *, __nr_t);
__nr_t read_net_nfs
	(struct stats_net_nfs *);
__nr_t read_net_nfsd
	(struct stats_net_nfsd *);
__nr_t read_net_sock
	(struct stats_net_sock *);
__nr_t read_net_ip
	(struct stats_net_ip *);
__nr_t read_net_eip
	(struct stats_net_eip *);
__nr_t read_net_icmp
	(struct stats_net_icmp *);
__nr_t read_net_eicmp
	(struct stats_net_eicmp *);
__nr_t read_net_tcp
	(struct stats_net_tcp *);
__nr_t read_net_etcp
	(struct stats_net_etcp *);
__nr_t read_net_udp
	(struct stats_net_udp *);
__nr_t read_net_sock6
	(struct stats_net_sock6 *);
__nr_t read_net_ip6
	(struct stats_net_ip6 *);
__nr_t read_net_eip6
	(struct stats_net_eip6 *);
__nr_t read_net_icmp6
	(struct stats_net_icmp6 *);
__nr_t read_net_eicmp6
	(struct stats_net_eicmp6 *);
__nr_t read_net_udp6
	(struct stats_net_udp6 *);
__nr_t read_cpuinfo
	(struct stats_pwr_cpufreq *, __nr_t);
__nr_t read_meminfo_huge
	(struct stats_huge *);
__nr_t read_cpu_wghfreq
	(struct stats_pwr_wghfreq *, __nr_t, __nr_t);
__nr_t read_bus_usb_dev
	(struct stats_pwr_usb *, __nr_t);
__nr_t read_filesystem
	(struct stats_filesystem *, __nr_t);
__nr_t read_fchost
	(struct stats_fchost *, __nr_t);
int read_softnet
	(struct stats_softnet *, __nr_t, unsigned char []);
#endif /* SOURCE_SADC */

#endif /* _RD_STATS_H */

Refrence

http://www.computerhope.com/unix/usar.htm

http://lovesoo.org/linux-sar-command-detailed.html

sysstat 主页

sysstat 源码

原创声明,本文系作者授权云+社区发表,未经许可,不得转载。

如有侵权,请联系 yunjia_community@tencent.com 删除。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 在腾讯云服务器上体验 Docker

    在腾讯云的 ubuntu 服务器上安装和运行 Docker,Docker可以解决虚拟机能够解决的问题,同时也能够解决虚拟机由于资源要求过高而无法解决的问题。

    姚俊刚
  • Elasticsearch 索引容量管理实践

    Elasticsearch是目前大数据领域最热门的技术栈之一,腾讯云 Elasticsearch Service(ES)是基于开源搜索引擎 Elasticsea...

    姚俊刚
  • Dockerfile 分享之 SSH Server

    Docker 官方网站上给出的示例里面有个 用 Dockerfile 构建 SSH Server 的例子, 我在腾讯云的主机上实验了一下, 中间添加了一些优化,...

    姚俊刚
  • codeforces 1436C(二分+数学)

    由于二分是通过不断缩减寻找区间的操作,所以我们可以模拟二分操作,求出二分结束后位置停留在pos时的向左跳的次数left和向右跳的次数right,最后通过组合数来...

    dejavu1zz
  • MYSQL 5.6 从库复制的部署和监控

    (2) slave配置 slave如上安装时的配置,注意的是replicate-do-db、replicate-ignore-db的配置

    明哥的运维笔记
  • tensorflow object detection API使用之GPU训练实现宠物识别

    之前写过几篇关于tensorflow object detection API使用的相关文章分享,收到不少关注与鼓励,所以决定再写一篇感谢大家肯定与支持。在具体...

    OpenCV学堂
  • JavaSE之Long 详解 Long的方法简介以及用法

    java.lang.Long.valueOf(String, int)是借助于parseLong进行转换

    noteless
  • 深度学习入门篇--手把手教你用 TensorFlow 训练模型

    最近笔者终于跑通 TensorFlow Object Detection API的ssd_mobilenet_v1 模型,这里记录下如何完整跑通数据准备到模型使...

    付越
  • myeclipse 2017 CI 中如何修改Servlet模板

      在实际开发中,这些生成的代码和注释一般我们都用不到的,每次都要手工删除这些注释和代码,很麻烦,因此可以根据开发的实际情况修改Servlet的模板代码,改成符...

    黑泽君
  • 微软亚洲研究院20年20人

    作为人工智能的“黄埔军校”,微软亚洲研究院(MSRA)这20年来,走出了无数传奇人物。

    量子位

扫码关注云+社区

领取腾讯云代金券