2 * rd_stats.h: Include file used to read system statistics
3 * (C) 1999-2018 by Sebastien Godard (sysstat <at> orange.fr)
10 ***************************************************************************
11 * Miscellaneous constants
12 ***************************************************************************
21 /* Maximum length of block device name */
22 #define MAX_DEV_LEN 128
23 /* Maximum length of network interface name */
24 #define MAX_IFACE_LEN IFNAMSIZ
25 /* Maximum length of USB manufacturer string */
26 #define MAX_MANUF_LEN 24
27 /* Maximum length of USB product string */
28 #define MAX_PROD_LEN 48
29 /* Maximum length of filesystem name */
30 #define MAX_FS_LEN 128
31 /* Maximum length of FC host name */
32 #define MAX_FCH_LEN 16
36 #define CNT_USED_DEV 1
38 #define K_DUPLEX_HALF "half"
39 #define K_DUPLEX_FULL "full"
41 #define C_DUPLEX_HALF 1
42 #define C_DUPLEX_FULL 2
44 /* Type for all functions counting items. Value can be negative (-1) */
48 ***************************************************************************
49 * System files containing statistics
50 ***************************************************************************
55 #define SERIAL "/proc/tty/driver/serial"
56 #define FDENTRY_STATE "/proc/sys/fs/dentry-state"
57 #define FFILE_NR "/proc/sys/fs/file-nr"
58 #define FINODE_STATE "/proc/sys/fs/inode-state"
59 #define PTY_NR "/proc/sys/kernel/pty/nr"
60 #define NET_DEV "/proc/net/dev"
61 #define NET_SOCKSTAT "/proc/net/sockstat"
62 #define NET_SOCKSTAT6 "/proc/net/sockstat6"
63 #define NET_RPC_NFS "/proc/net/rpc/nfs"
64 #define NET_RPC_NFSD "/proc/net/rpc/nfsd"
65 #define NET_SOFTNET "/proc/net/softnet_stat"
66 #define LOADAVG "/proc/loadavg"
67 #define VMSTAT "/proc/vmstat"
68 #define NET_SNMP "/proc/net/snmp"
69 #define NET_SNMP6 "/proc/net/snmp6"
70 #define CPUINFO "/proc/cpuinfo"
71 #define MTAB "/etc/mtab"
72 #define IF_DUPLEX "/sys/class/net/%s/duplex"
73 #define IF_SPEED "/sys/class/net/%s/speed"
74 #define FC_RX_FRAMES "%s/%s/statistics/rx_frames"
75 #define FC_TX_FRAMES "%s/%s/statistics/tx_frames"
76 #define FC_RX_WORDS "%s/%s/statistics/rx_words"
77 #define FC_TX_WORDS "%s/%s/statistics/tx_words"
80 ***************************************************************************
81 * Definitions of structures for system statistics.
82 * WARNING: Fields order matters for SVG graphs!
83 ***************************************************************************
86 #define SIZEOF_LONG_64BIT 8
87 #define ULL_ALIGNMENT_WIDTH 8
88 #define UL_ALIGNMENT_WIDTH SIZEOF_LONG_64BIT
89 #define U_ALIGNMENT_WIDTH 4
91 #define MAP_SIZE(m) ((m[0] * ULL_ALIGNMENT_WIDTH) + \
92 (m[1] * UL_ALIGNMENT_WIDTH) + \
93 (m[2] * U_ALIGNMENT_WIDTH))
96 * Structure for CPU statistics.
97 * In activity buffer: First structure is for global CPU utilisation ("all").
98 * Following structures are for each individual CPU (0, 1, etc.)
101 unsigned long long cpu_user;
102 unsigned long long cpu_nice;
103 unsigned long long cpu_sys;
104 unsigned long long cpu_idle;
105 unsigned long long cpu_iowait;
106 unsigned long long cpu_steal;
107 unsigned long long cpu_hardirq;
108 unsigned long long cpu_softirq;
109 unsigned long long cpu_guest;
110 unsigned long long cpu_guest_nice;
113 #define STATS_CPU_SIZE (sizeof(struct stats_cpu))
114 #define STATS_CPU_ULL 10
115 #define STATS_CPU_UL 0
116 #define STATS_CPU_U 0
119 * Structure for task creation and context switch statistics.
120 * The attribute (aligned(16)) is necessary so that sizeof(structure) has
121 * the same value on 32 and 64-bit architectures.
124 unsigned long long context_switch;
125 unsigned long processes __attribute__ ((aligned (8)));
128 #define STATS_PCSW_SIZE (sizeof(struct stats_pcsw))
129 #define STATS_PCSW_ULL 1
130 #define STATS_PCSW_UL 1
131 #define STATS_PCSW_U 0
134 * Structure for interrupts statistics.
135 * In activity buffer: First structure is for total number of interrupts ("SUM").
136 * Following structures are for each individual interrupt (0, 1, etc.)
139 unsigned long long irq_nr;
142 #define STATS_IRQ_SIZE (sizeof(struct stats_irq))
143 #define STATS_IRQ_ULL 1
144 #define STATS_IRQ_UL 0
145 #define STATS_IRQ_U 0
147 /* Structure for swapping statistics */
149 unsigned long pswpin __attribute__ ((aligned (8)));
150 unsigned long pswpout __attribute__ ((aligned (8)));
153 #define STATS_SWAP_SIZE (sizeof(struct stats_swap))
154 #define STATS_SWAP_ULL 0
155 #define STATS_SWAP_UL 2
156 #define STATS_SWAP_U 0
158 /* Structure for paging statistics */
159 struct stats_paging {
160 unsigned long pgpgin __attribute__ ((aligned (8)));
161 unsigned long pgpgout __attribute__ ((aligned (8)));
162 unsigned long pgfault __attribute__ ((aligned (8)));
163 unsigned long pgmajfault __attribute__ ((aligned (8)));
164 unsigned long pgfree __attribute__ ((aligned (8)));
165 unsigned long pgscan_kswapd __attribute__ ((aligned (8)));
166 unsigned long pgscan_direct __attribute__ ((aligned (8)));
167 unsigned long pgsteal __attribute__ ((aligned (8)));
170 #define STATS_PAGING_SIZE (sizeof(struct stats_paging))
171 #define STATS_PAGING_ULL 0
172 #define STATS_PAGING_UL 8
173 #define STATS_PAGING_U 0
175 /* Structure for I/O and transfer rate statistics */
177 unsigned long long dk_drive;
178 unsigned long long dk_drive_rio;
179 unsigned long long dk_drive_wio;
180 unsigned long long dk_drive_rblk;
181 unsigned long long dk_drive_wblk;
182 unsigned long long dk_drive_dio;
183 unsigned long long dk_drive_dblk;
186 #define STATS_IO_SIZE (sizeof(struct stats_io))
187 #define STATS_IO_ULL 7
188 #define STATS_IO_UL 0
191 /* Structure for memory and swap space utilization statistics */
192 struct stats_memory {
193 unsigned long long frmkb;
194 unsigned long long bufkb;
195 unsigned long long camkb;
196 unsigned long long tlmkb;
197 unsigned long long frskb;
198 unsigned long long tlskb;
199 unsigned long long caskb;
200 unsigned long long comkb;
201 unsigned long long activekb;
202 unsigned long long inactkb;
203 unsigned long long dirtykb;
204 unsigned long long anonpgkb;
205 unsigned long long slabkb;
206 unsigned long long kstackkb;
207 unsigned long long pgtblkb;
208 unsigned long long vmusedkb;
209 unsigned long long availablekb;
212 #define STATS_MEMORY_SIZE (sizeof(struct stats_memory))
213 #define STATS_MEMORY_ULL 17
214 #define STATS_MEMORY_UL 0
215 #define STATS_MEMORY_U 0
217 /* Structure for kernel tables statistics */
218 struct stats_ktables {
219 unsigned long long file_used;
220 unsigned long long inode_used;
221 unsigned long long dentry_stat;
222 unsigned long long pty_nr;
225 #define STATS_KTABLES_SIZE (sizeof(struct stats_ktables))
226 #define STATS_KTABLES_ULL 4
227 #define STATS_KTABLES_UL 0
228 #define STATS_KTABLES_U 0
230 /* Structure for queue and load statistics */
232 unsigned long long nr_running;
233 unsigned long long procs_blocked;
234 unsigned long long nr_threads;
235 unsigned int load_avg_1;
236 unsigned int load_avg_5;
237 unsigned int load_avg_15;
240 #define STATS_QUEUE_SIZE (sizeof(struct stats_queue))
241 #define STATS_QUEUE_ULL 3
242 #define STATS_QUEUE_UL 0
243 #define STATS_QUEUE_U 3
245 /* Structure for serial statistics */
246 struct stats_serial {
252 unsigned int overrun;
256 #define STATS_SERIAL_SIZE (sizeof(struct stats_serial))
257 #define STATS_SERIAL_ULL 0
258 #define STATS_SERIAL_UL 0
259 #define STATS_SERIAL_U 7
261 /* Structure for block devices statistics */
263 unsigned long long nr_ios;
264 unsigned long rd_sect __attribute__ ((aligned (8)));
265 unsigned long wr_sect __attribute__ ((aligned (8)));
266 unsigned long dc_sect __attribute__ ((aligned (8)));
267 unsigned int rd_ticks __attribute__ ((aligned (8)));
268 unsigned int wr_ticks;
269 unsigned int tot_ticks;
270 unsigned int rq_ticks;
273 unsigned int dc_ticks;
276 #define STATS_DISK_SIZE (sizeof(struct stats_disk))
277 #define STATS_DISK_ULL 1
278 #define STATS_DISK_UL 3
279 #define STATS_DISK_U 7
281 /* Structure for network interfaces statistics */
282 struct stats_net_dev {
283 unsigned long long rx_packets;
284 unsigned long long tx_packets;
285 unsigned long long rx_bytes;
286 unsigned long long tx_bytes;
287 unsigned long long rx_compressed;
288 unsigned long long tx_compressed;
289 unsigned long long multicast;
291 char interface[MAX_IFACE_LEN];
295 #define STATS_NET_DEV_SIZE (sizeof(struct stats_net_dev))
296 #define STATS_NET_DEV_SIZE2CMP (STATS_NET_DEV_SIZE - MAX_IFACE_LEN - 1)
297 #define STATS_NET_DEV_ULL 7
298 #define STATS_NET_DEV_UL 0
299 #define STATS_NET_DEV_U 1
301 /* Structure for network interface errors statistics */
302 struct stats_net_edev {
303 unsigned long long collisions;
304 unsigned long long rx_errors;
305 unsigned long long tx_errors;
306 unsigned long long rx_dropped;
307 unsigned long long tx_dropped;
308 unsigned long long rx_fifo_errors;
309 unsigned long long tx_fifo_errors;
310 unsigned long long rx_frame_errors;
311 unsigned long long tx_carrier_errors;
312 char interface[MAX_IFACE_LEN];
315 #define STATS_NET_EDEV_SIZE (sizeof(struct stats_net_edev))
316 #define STATS_NET_EDEV_SIZE2CMP (STATS_NET_EDEV_SIZE - MAX_IFACE_LEN)
317 #define STATS_NET_EDEV_ULL 9
318 #define STATS_NET_EDEV_UL 0
319 #define STATS_NET_EDEV_U 0
321 /* Structure for NFS client statistics */
322 struct stats_net_nfs {
323 unsigned int nfs_rpccnt;
324 unsigned int nfs_rpcretrans;
325 unsigned int nfs_readcnt;
326 unsigned int nfs_writecnt;
327 unsigned int nfs_accesscnt;
328 unsigned int nfs_getattcnt;
331 #define STATS_NET_NFS_SIZE (sizeof(struct stats_net_nfs))
332 #define STATS_NET_NFS_ULL 0
333 #define STATS_NET_NFS_UL 0
334 #define STATS_NET_NFS_U 6
336 /* Structure for NFS server statistics */
337 struct stats_net_nfsd {
338 unsigned int nfsd_rpccnt;
339 unsigned int nfsd_rpcbad;
340 unsigned int nfsd_netcnt;
341 unsigned int nfsd_netudpcnt;
342 unsigned int nfsd_nettcpcnt;
343 unsigned int nfsd_rchits;
344 unsigned int nfsd_rcmisses;
345 unsigned int nfsd_readcnt;
346 unsigned int nfsd_writecnt;
347 unsigned int nfsd_accesscnt;
348 unsigned int nfsd_getattcnt;
351 #define STATS_NET_NFSD_SIZE (sizeof(struct stats_net_nfsd))
352 #define STATS_NET_NFSD_ULL 0
353 #define STATS_NET_NFSD_UL 0
354 #define STATS_NET_NFSD_U 11
356 /* Structure for IPv4 sockets statistics */
357 struct stats_net_sock {
358 unsigned int sock_inuse;
359 unsigned int tcp_inuse;
361 unsigned int udp_inuse;
362 unsigned int raw_inuse;
363 unsigned int frag_inuse;
366 #define STATS_NET_SOCK_SIZE (sizeof(struct stats_net_sock))
367 #define STATS_NET_SOCK_ULL 0
368 #define STATS_NET_SOCK_UL 0
369 #define STATS_NET_SOCK_U 6
371 /* Structure for IP statistics */
372 struct stats_net_ip {
373 unsigned long long InReceives;
374 unsigned long long ForwDatagrams;
375 unsigned long long InDelivers;
376 unsigned long long OutRequests;
377 unsigned long long ReasmReqds;
378 unsigned long long ReasmOKs;
379 unsigned long long FragOKs;
380 unsigned long long FragCreates;
383 #define STATS_NET_IP_SIZE (sizeof(struct stats_net_ip))
384 #define STATS_NET_IP_ULL 8
385 #define STATS_NET_IP_UL 0
386 #define STATS_NET_IP_U 0
388 /* Structure for IP errors statistics */
389 struct stats_net_eip {
390 unsigned long long InHdrErrors;
391 unsigned long long InAddrErrors;
392 unsigned long long InUnknownProtos;
393 unsigned long long InDiscards;
394 unsigned long long OutDiscards;
395 unsigned long long OutNoRoutes;
396 unsigned long long ReasmFails;
397 unsigned long long FragFails;
400 #define STATS_NET_EIP_SIZE (sizeof(struct stats_net_eip))
401 #define STATS_NET_EIP_ULL 8
402 #define STATS_NET_EIP_UL 0
403 #define STATS_NET_EIP_U 0
405 /* Structure for ICMP statistics */
406 struct stats_net_icmp {
407 unsigned long InMsgs __attribute__ ((aligned (8)));
408 unsigned long OutMsgs __attribute__ ((aligned (8)));
409 unsigned long InEchos __attribute__ ((aligned (8)));
410 unsigned long InEchoReps __attribute__ ((aligned (8)));
411 unsigned long OutEchos __attribute__ ((aligned (8)));
412 unsigned long OutEchoReps __attribute__ ((aligned (8)));
413 unsigned long InTimestamps __attribute__ ((aligned (8)));
414 unsigned long InTimestampReps __attribute__ ((aligned (8)));
415 unsigned long OutTimestamps __attribute__ ((aligned (8)));
416 unsigned long OutTimestampReps __attribute__ ((aligned (8)));
417 unsigned long InAddrMasks __attribute__ ((aligned (8)));
418 unsigned long InAddrMaskReps __attribute__ ((aligned (8)));
419 unsigned long OutAddrMasks __attribute__ ((aligned (8)));
420 unsigned long OutAddrMaskReps __attribute__ ((aligned (8)));
423 #define STATS_NET_ICMP_SIZE (sizeof(struct stats_net_icmp))
424 #define STATS_NET_ICMP_ULL 0
425 #define STATS_NET_ICMP_UL 14
426 #define STATS_NET_ICMP_U 0
428 /* Structure for ICMP error message statistics */
429 struct stats_net_eicmp {
430 unsigned long InErrors __attribute__ ((aligned (8)));
431 unsigned long OutErrors __attribute__ ((aligned (8)));
432 unsigned long InDestUnreachs __attribute__ ((aligned (8)));
433 unsigned long OutDestUnreachs __attribute__ ((aligned (8)));
434 unsigned long InTimeExcds __attribute__ ((aligned (8)));
435 unsigned long OutTimeExcds __attribute__ ((aligned (8)));
436 unsigned long InParmProbs __attribute__ ((aligned (8)));
437 unsigned long OutParmProbs __attribute__ ((aligned (8)));
438 unsigned long InSrcQuenchs __attribute__ ((aligned (8)));
439 unsigned long OutSrcQuenchs __attribute__ ((aligned (8)));
440 unsigned long InRedirects __attribute__ ((aligned (8)));
441 unsigned long OutRedirects __attribute__ ((aligned (8)));
444 #define STATS_NET_EICMP_SIZE (sizeof(struct stats_net_eicmp))
445 #define STATS_NET_EICMP_ULL 0
446 #define STATS_NET_EICMP_UL 12
447 #define STATS_NET_EICMP_U 0
449 /* Structure for TCP statistics */
450 struct stats_net_tcp {
451 unsigned long ActiveOpens __attribute__ ((aligned (8)));
452 unsigned long PassiveOpens __attribute__ ((aligned (8)));
453 unsigned long InSegs __attribute__ ((aligned (8)));
454 unsigned long OutSegs __attribute__ ((aligned (8)));
457 #define STATS_NET_TCP_SIZE (sizeof(struct stats_net_tcp))
458 #define STATS_NET_TCP_ULL 0
459 #define STATS_NET_TCP_UL 4
460 #define STATS_NET_TCP_U 0
462 /* Structure for TCP errors statistics */
463 struct stats_net_etcp {
464 unsigned long AttemptFails __attribute__ ((aligned (8)));
465 unsigned long EstabResets __attribute__ ((aligned (8)));
466 unsigned long RetransSegs __attribute__ ((aligned (8)));
467 unsigned long InErrs __attribute__ ((aligned (8)));
468 unsigned long OutRsts __attribute__ ((aligned (8)));
471 #define STATS_NET_ETCP_SIZE (sizeof(struct stats_net_etcp))
472 #define STATS_NET_ETCP_ULL 0
473 #define STATS_NET_ETCP_UL 5
474 #define STATS_NET_ETCP_U 0
476 /* Structure for UDP statistics */
477 struct stats_net_udp {
478 unsigned long InDatagrams __attribute__ ((aligned (8)));
479 unsigned long OutDatagrams __attribute__ ((aligned (8)));
480 unsigned long NoPorts __attribute__ ((aligned (8)));
481 unsigned long InErrors __attribute__ ((aligned (8)));
484 #define STATS_NET_UDP_SIZE (sizeof(struct stats_net_udp))
485 #define STATS_NET_UDP_ULL 0
486 #define STATS_NET_UDP_UL 4
487 #define STATS_NET_UDP_U 0
489 /* Structure for IPv6 sockets statistics */
490 struct stats_net_sock6 {
491 unsigned int tcp6_inuse;
492 unsigned int udp6_inuse;
493 unsigned int raw6_inuse;
494 unsigned int frag6_inuse;
497 #define STATS_NET_SOCK6_SIZE (sizeof(struct stats_net_sock6))
498 #define STATS_NET_SOCK6_ULL 0
499 #define STATS_NET_SOCK6_UL 0
500 #define STATS_NET_SOCK6_U 4
502 /* Structure for IPv6 statistics */
503 struct stats_net_ip6 {
504 unsigned long long InReceives6;
505 unsigned long long OutForwDatagrams6;
506 unsigned long long InDelivers6;
507 unsigned long long OutRequests6;
508 unsigned long long ReasmReqds6;
509 unsigned long long ReasmOKs6;
510 unsigned long long InMcastPkts6;
511 unsigned long long OutMcastPkts6;
512 unsigned long long FragOKs6;
513 unsigned long long FragCreates6;
516 #define STATS_NET_IP6_SIZE (sizeof(struct stats_net_ip6))
517 #define STATS_NET_IP6_ULL 10
518 #define STATS_NET_IP6_UL 0
519 #define STATS_NET_IP6_U 0
521 /* Structure for IPv6 errors statistics */
522 struct stats_net_eip6 {
523 unsigned long long InHdrErrors6;
524 unsigned long long InAddrErrors6;
525 unsigned long long InUnknownProtos6;
526 unsigned long long InTooBigErrors6;
527 unsigned long long InDiscards6;
528 unsigned long long OutDiscards6;
529 unsigned long long InNoRoutes6;
530 unsigned long long OutNoRoutes6;
531 unsigned long long ReasmFails6;
532 unsigned long long FragFails6;
533 unsigned long long InTruncatedPkts6;
536 #define STATS_NET_EIP6_SIZE (sizeof(struct stats_net_eip6))
537 #define STATS_NET_EIP6_ULL 11
538 #define STATS_NET_EIP6_UL 0
539 #define STATS_NET_EIP6_U 0
541 /* Structure for ICMPv6 statistics */
542 struct stats_net_icmp6 {
543 unsigned long InMsgs6 __attribute__ ((aligned (8)));
544 unsigned long OutMsgs6 __attribute__ ((aligned (8)));
545 unsigned long InEchos6 __attribute__ ((aligned (8)));
546 unsigned long InEchoReplies6 __attribute__ ((aligned (8)));
547 unsigned long OutEchoReplies6 __attribute__ ((aligned (8)));
548 unsigned long InGroupMembQueries6 __attribute__ ((aligned (8)));
549 unsigned long InGroupMembResponses6 __attribute__ ((aligned (8)));
550 unsigned long OutGroupMembResponses6 __attribute__ ((aligned (8)));
551 unsigned long InGroupMembReductions6 __attribute__ ((aligned (8)));
552 unsigned long OutGroupMembReductions6 __attribute__ ((aligned (8)));
553 unsigned long InRouterSolicits6 __attribute__ ((aligned (8)));
554 unsigned long OutRouterSolicits6 __attribute__ ((aligned (8)));
555 unsigned long InRouterAdvertisements6 __attribute__ ((aligned (8)));
556 unsigned long InNeighborSolicits6 __attribute__ ((aligned (8)));
557 unsigned long OutNeighborSolicits6 __attribute__ ((aligned (8)));
558 unsigned long InNeighborAdvertisements6 __attribute__ ((aligned (8)));
559 unsigned long OutNeighborAdvertisements6 __attribute__ ((aligned (8)));
562 #define STATS_NET_ICMP6_SIZE (sizeof(struct stats_net_icmp6))
563 #define STATS_NET_ICMP6_ULL 0
564 #define STATS_NET_ICMP6_UL 17
565 #define STATS_NET_ICMP6_U 0
567 /* Structure for ICMPv6 error message statistics */
568 struct stats_net_eicmp6 {
569 unsigned long InErrors6 __attribute__ ((aligned (8)));
570 unsigned long InDestUnreachs6 __attribute__ ((aligned (8)));
571 unsigned long OutDestUnreachs6 __attribute__ ((aligned (8)));
572 unsigned long InTimeExcds6 __attribute__ ((aligned (8)));
573 unsigned long OutTimeExcds6 __attribute__ ((aligned (8)));
574 unsigned long InParmProblems6 __attribute__ ((aligned (8)));
575 unsigned long OutParmProblems6 __attribute__ ((aligned (8)));
576 unsigned long InRedirects6 __attribute__ ((aligned (8)));
577 unsigned long OutRedirects6 __attribute__ ((aligned (8)));
578 unsigned long InPktTooBigs6 __attribute__ ((aligned (8)));
579 unsigned long OutPktTooBigs6 __attribute__ ((aligned (8)));
582 #define STATS_NET_EICMP6_SIZE (sizeof(struct stats_net_eicmp6))
583 #define STATS_NET_EICMP6_ULL 0
584 #define STATS_NET_EICMP6_UL 11
585 #define STATS_NET_EICMP6_U 0
587 /* Structure for UDPv6 statistics */
588 struct stats_net_udp6 {
589 unsigned long InDatagrams6 __attribute__ ((aligned (8)));
590 unsigned long OutDatagrams6 __attribute__ ((aligned (8)));
591 unsigned long NoPorts6 __attribute__ ((aligned (8)));
592 unsigned long InErrors6 __attribute__ ((aligned (8)));
595 #define STATS_NET_UDP6_SIZE (sizeof(struct stats_net_udp6))
596 #define STATS_NET_UDP6_ULL 0
597 #define STATS_NET_UDP6_UL 4
598 #define STATS_NET_UDP6_U 0
601 * Structure for CPU frequency statistics.
602 * In activity buffer: First structure is for global CPU utilisation ("all").
603 * Following structures are for each individual CPU (0, 1, etc.)
605 struct stats_pwr_cpufreq {
606 unsigned long cpufreq __attribute__ ((aligned (8)));
609 #define STATS_PWR_CPUFREQ_SIZE (sizeof(struct stats_pwr_cpufreq))
610 #define STATS_PWR_CPUFREQ_ULL 0
611 #define STATS_PWR_CPUFREQ_UL 1
612 #define STATS_PWR_CPUFREQ_U 0
614 /* Structure for hugepages statistics */
616 unsigned long long frhkb;
617 unsigned long long tlhkb;
618 unsigned long long rsvdhkb;
619 unsigned long long surphkb;
622 #define STATS_HUGE_SIZE (sizeof(struct stats_huge))
623 #define STATS_HUGE_ULL 4
624 #define STATS_HUGE_UL 0
625 #define STATS_HUGE_U 0
628 * Structure for weighted CPU frequency statistics.
629 * In activity buffer: First structure is for global CPU utilisation ("all").
630 * Following structures are for each individual CPU (0, 1, etc.)
632 struct stats_pwr_wghfreq {
633 unsigned long long time_in_state;
634 unsigned long freq __attribute__ ((aligned (8)));
637 #define STATS_PWR_WGHFREQ_SIZE (sizeof(struct stats_pwr_wghfreq))
638 #define STATS_PWR_WGHFREQ_ULL 1
639 #define STATS_PWR_WGHFREQ_UL 1
640 #define STATS_PWR_WGHFREQ_U 0
643 * Structure for USB devices plugged into the system.
645 struct stats_pwr_usb {
647 unsigned int vendor_id;
648 unsigned int product_id;
649 unsigned int bmaxpower;
650 char manufacturer[MAX_MANUF_LEN];
651 char product[MAX_PROD_LEN];
654 #define STATS_PWR_USB_SIZE (sizeof(struct stats_pwr_usb))
655 #define STATS_PWR_USB_ULL 0
656 #define STATS_PWR_USB_UL 0
657 #define STATS_PWR_USB_U 4
659 /* Structure for filesystems statistics */
660 struct stats_filesystem {
661 unsigned long long f_blocks;
662 unsigned long long f_bfree;
663 unsigned long long f_bavail;
664 unsigned long long f_files;
665 unsigned long long f_ffree;
666 char fs_name[MAX_FS_LEN];
667 char mountp[MAX_FS_LEN];
670 #define STATS_FILESYSTEM_SIZE (sizeof(struct stats_filesystem))
671 #define STATS_FILESYSTEM_SIZE2CMP (STATS_FILESYSTEM_SIZE - 2 * MAX_FS_LEN)
672 #define STATS_FILESYSTEM_ULL 5
673 #define STATS_FILESYSTEM_UL 0
674 #define STATS_FILESYSTEM_U 0
676 /* Structure for Fibre Channel HBA statistics */
677 struct stats_fchost {
678 unsigned long f_rxframes __attribute__ ((aligned (8)));
679 unsigned long f_txframes __attribute__ ((aligned (8)));
680 unsigned long f_rxwords __attribute__ ((aligned (8)));
681 unsigned long f_txwords __attribute__ ((aligned (8)));
682 char fchost_name[MAX_FCH_LEN] __attribute__ ((aligned (8)));
685 #define STATS_FCHOST_SIZE (sizeof(struct stats_fchost))
686 #define STATS_FCHOST_ULL 0
687 #define STATS_FCHOST_UL 4
688 #define STATS_FCHOST_U 0
690 /* Structure for softnet statistics */
691 struct stats_softnet {
692 unsigned int processed;
693 unsigned int dropped;
694 unsigned int time_squeeze;
695 unsigned int received_rps;
696 unsigned int flow_limit;
699 #define STATS_SOFTNET_SIZE (sizeof(struct stats_softnet))
700 #define STATS_SOFTNET_ULL 0
701 #define STATS_SOFTNET_UL 0
702 #define STATS_SOFTNET_U 5
705 ***************************************************************************
706 * Prototypes for functions used to read system statistics
707 ***************************************************************************
710 void compute_ext_disk_stats
711 (struct stats_disk *, struct stats_disk *, unsigned long long,
712 struct ext_disk_stats *);
713 unsigned long long get_per_cpu_interval
714 (struct stats_cpu *, struct stats_cpu *);
716 (struct stats_cpu *, __nr_t);
718 (struct stats_irq *, __nr_t);
720 (struct stats_memory *);
722 (unsigned long long *);
726 __nr_t read_stat_pcsw
727 (struct stats_pcsw *);
729 (struct stats_queue *);
730 __nr_t read_vmstat_swap
731 (struct stats_swap *);
732 __nr_t read_vmstat_paging
733 (struct stats_paging *);
734 __nr_t read_diskstats_io
736 __nr_t read_diskstats_disk
737 (struct stats_disk *, __nr_t, int);
738 __nr_t read_tty_driver_serial
739 (struct stats_serial *, __nr_t);
740 __nr_t read_kernel_tables
741 (struct stats_ktables *);
743 (struct stats_net_dev *, __nr_t);
745 (struct stats_net_dev *, int);
747 (struct stats_net_edev *, __nr_t);
749 (struct stats_net_nfs *);
751 (struct stats_net_nfsd *);
753 (struct stats_net_sock *);
755 (struct stats_net_ip *);
757 (struct stats_net_eip *);
759 (struct stats_net_icmp *);
760 __nr_t read_net_eicmp
761 (struct stats_net_eicmp *);
763 (struct stats_net_tcp *);
765 (struct stats_net_etcp *);
767 (struct stats_net_udp *);
768 __nr_t read_net_sock6
769 (struct stats_net_sock6 *);
771 (struct stats_net_ip6 *);
773 (struct stats_net_eip6 *);
774 __nr_t read_net_icmp6
775 (struct stats_net_icmp6 *);
776 __nr_t read_net_eicmp6
777 (struct stats_net_eicmp6 *);
779 (struct stats_net_udp6 *);
781 (struct stats_pwr_cpufreq *, __nr_t);
782 __nr_t read_meminfo_huge
783 (struct stats_huge *);
784 __nr_t read_cpu_wghfreq
785 (struct stats_pwr_wghfreq *, __nr_t, __nr_t);
786 __nr_t read_bus_usb_dev
787 (struct stats_pwr_usb *, __nr_t);
788 __nr_t read_filesystem
789 (struct stats_filesystem *, __nr_t);
791 (struct stats_fchost *, __nr_t);
793 (struct stats_softnet *, __nr_t, unsigned char []);
794 #endif /* SOURCE_SADC */
796 #endif /* _RD_STATS_H */