forked from sysstat/sysstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rd_stats.h
617 lines (535 loc) · 22.9 KB
/
rd_stats.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
/*
* rd_stats.h: Include file used to read system statistics
* (C) 1999-2013 by Sebastien Godard (sysstat <at> orange.fr)
*/
#ifndef _RD_STATS_H
#define _RD_STATS_H
#include "common.h"
/*
***************************************************************************
* Miscellaneous constants
***************************************************************************
*/
/* Get IFNAMSIZ */
#include <net/if.h>
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif
/* 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 72
#define CNT_PART 1
#define CNT_ALL_DEV 0
#define CNT_USED_DEV 1
/*
***************************************************************************
* 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 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"
/*
***************************************************************************
* Definitions of structures for system statistics
***************************************************************************
*/
/*
* 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 __attribute__ ((aligned (16)));
unsigned long long cpu_nice __attribute__ ((aligned (16)));
unsigned long long cpu_sys __attribute__ ((aligned (16)));
unsigned long long cpu_idle __attribute__ ((aligned (16)));
unsigned long long cpu_iowait __attribute__ ((aligned (16)));
unsigned long long cpu_steal __attribute__ ((aligned (16)));
unsigned long long cpu_hardirq __attribute__ ((aligned (16)));
unsigned long long cpu_softirq __attribute__ ((aligned (16)));
unsigned long long cpu_guest __attribute__ ((aligned (16)));
unsigned long long cpu_guest_nice __attribute__ ((aligned (16)));
};
#define STATS_CPU_SIZE (sizeof(struct stats_cpu))
/*
* 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 __attribute__ ((aligned (16)));
unsigned long processes __attribute__ ((aligned (16)));
};
#define STATS_PCSW_SIZE (sizeof(struct stats_pcsw))
/*
* 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.)
*
* NOTE: The total number of interrupts is saved as a %llu by the kernel,
* whereas individual interrupts are saved as %u.
*/
struct stats_irq {
unsigned long long irq_nr __attribute__ ((aligned (16)));
};
#define STATS_IRQ_SIZE (sizeof(struct stats_irq))
/* 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))
/* 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))
/* Structure for I/O and transfer rate statistics */
struct stats_io {
unsigned long long dk_drive __attribute__ ((aligned (16)));
unsigned long long dk_drive_rio __attribute__ ((packed));
unsigned long long dk_drive_wio __attribute__ ((packed));
unsigned long long dk_drive_rblk __attribute__ ((packed));
unsigned long long dk_drive_wblk __attribute__ ((packed));
};
#define STATS_IO_SIZE (sizeof(struct stats_io))
/* Structure for memory and swap space utilization statistics */
struct stats_memory {
unsigned long frmkb __attribute__ ((aligned (8)));
unsigned long bufkb __attribute__ ((aligned (8)));
unsigned long camkb __attribute__ ((aligned (8)));
unsigned long tlmkb __attribute__ ((aligned (8)));
unsigned long frskb __attribute__ ((aligned (8)));
unsigned long tlskb __attribute__ ((aligned (8)));
unsigned long caskb __attribute__ ((aligned (8)));
unsigned long comkb __attribute__ ((aligned (8)));
unsigned long activekb __attribute__ ((aligned (8)));
unsigned long inactkb __attribute__ ((aligned (8)));
unsigned long dirtykb __attribute__ ((aligned (8)));
};
#define STATS_MEMORY_SIZE (sizeof(struct stats_memory))
/* Structure for kernel tables statistics */
struct stats_ktables {
unsigned int file_used __attribute__ ((aligned (4)));
unsigned int inode_used __attribute__ ((packed));
unsigned int dentry_stat __attribute__ ((packed));
unsigned int pty_nr __attribute__ ((packed));
};
#define STATS_KTABLES_SIZE (sizeof(struct stats_ktables))
/* Structure for queue and load statistics */
struct stats_queue {
unsigned long nr_running __attribute__ ((aligned (8)));
unsigned long procs_blocked __attribute__ ((aligned (8)));
unsigned int load_avg_1 __attribute__ ((aligned (8)));
unsigned int load_avg_5 __attribute__ ((packed));
unsigned int load_avg_15 __attribute__ ((packed));
unsigned int nr_threads __attribute__ ((packed));
};
#define STATS_QUEUE_SIZE (sizeof(struct stats_queue))
/* Structure for serial statistics */
struct stats_serial {
unsigned int rx __attribute__ ((aligned (4)));
unsigned int tx __attribute__ ((packed));
unsigned int frame __attribute__ ((packed));
unsigned int parity __attribute__ ((packed));
unsigned int brk __attribute__ ((packed));
unsigned int overrun __attribute__ ((packed));
/*
* A value of 0 means that the structure is unused.
* To avoid the confusion, the line number is saved as (line# + 1)
*/
unsigned int line __attribute__ ((packed));
};
#define STATS_SERIAL_SIZE (sizeof(struct stats_serial))
/* Structure for block devices statistics */
struct stats_disk {
unsigned long long nr_ios __attribute__ ((aligned (16)));
unsigned long rd_sect __attribute__ ((aligned (16)));
unsigned long wr_sect __attribute__ ((aligned (8)));
unsigned int rd_ticks __attribute__ ((aligned (8)));
unsigned int wr_ticks __attribute__ ((packed));
unsigned int tot_ticks __attribute__ ((packed));
unsigned int rq_ticks __attribute__ ((packed));
unsigned int major __attribute__ ((packed));
unsigned int minor __attribute__ ((packed));
};
#define STATS_DISK_SIZE (sizeof(struct stats_disk))
/* Structure for network interfaces statistics */
struct stats_net_dev {
unsigned long long rx_packets __attribute__ ((aligned (16)));
unsigned long long tx_packets __attribute__ ((aligned (16)));
unsigned long long rx_bytes __attribute__ ((aligned (16)));
unsigned long long tx_bytes __attribute__ ((aligned (16)));
unsigned long long rx_compressed __attribute__ ((aligned (16)));
unsigned long long tx_compressed __attribute__ ((aligned (16)));
unsigned long long multicast __attribute__ ((aligned (16)));
char interface[MAX_IFACE_LEN] __attribute__ ((aligned (16)));
};
#define STATS_NET_DEV_SIZE (sizeof(struct stats_net_dev))
/* Structure for network interface errors statistics */
struct stats_net_edev {
unsigned long long collisions __attribute__ ((aligned (16)));
unsigned long long rx_errors __attribute__ ((aligned (16)));
unsigned long long tx_errors __attribute__ ((aligned (16)));
unsigned long long rx_dropped __attribute__ ((aligned (16)));
unsigned long long tx_dropped __attribute__ ((aligned (16)));
unsigned long long rx_fifo_errors __attribute__ ((aligned (16)));
unsigned long long tx_fifo_errors __attribute__ ((aligned (16)));
unsigned long long rx_frame_errors __attribute__ ((aligned (16)));
unsigned long long tx_carrier_errors __attribute__ ((aligned (16)));
char interface[MAX_IFACE_LEN] __attribute__ ((aligned (16)));
};
#define STATS_NET_EDEV_SIZE (sizeof(struct stats_net_edev))
/* Structure for NFS client statistics */
struct stats_net_nfs {
unsigned int nfs_rpccnt __attribute__ ((aligned (4)));
unsigned int nfs_rpcretrans __attribute__ ((packed));
unsigned int nfs_readcnt __attribute__ ((packed));
unsigned int nfs_writecnt __attribute__ ((packed));
unsigned int nfs_accesscnt __attribute__ ((packed));
unsigned int nfs_getattcnt __attribute__ ((packed));
};
#define STATS_NET_NFS_SIZE (sizeof(struct stats_net_nfs))
/* Structure for NFS server statistics */
struct stats_net_nfsd {
unsigned int nfsd_rpccnt __attribute__ ((aligned (4)));
unsigned int nfsd_rpcbad __attribute__ ((packed));
unsigned int nfsd_netcnt __attribute__ ((packed));
unsigned int nfsd_netudpcnt __attribute__ ((packed));
unsigned int nfsd_nettcpcnt __attribute__ ((packed));
unsigned int nfsd_rchits __attribute__ ((packed));
unsigned int nfsd_rcmisses __attribute__ ((packed));
unsigned int nfsd_readcnt __attribute__ ((packed));
unsigned int nfsd_writecnt __attribute__ ((packed));
unsigned int nfsd_accesscnt __attribute__ ((packed));
unsigned int nfsd_getattcnt __attribute__ ((packed));
};
#define STATS_NET_NFSD_SIZE (sizeof(struct stats_net_nfsd))
/* Structure for IPv4 sockets statistics */
struct stats_net_sock {
unsigned int sock_inuse __attribute__ ((aligned (4)));
unsigned int tcp_inuse __attribute__ ((packed));
unsigned int tcp_tw __attribute__ ((packed));
unsigned int udp_inuse __attribute__ ((packed));
unsigned int raw_inuse __attribute__ ((packed));
unsigned int frag_inuse __attribute__ ((packed));
};
#define STATS_NET_SOCK_SIZE (sizeof(struct stats_net_sock))
/* Structure for IP statistics */
struct stats_net_ip {
unsigned long long InReceives __attribute__ ((aligned (16)));
unsigned long long ForwDatagrams __attribute__ ((aligned (16)));
unsigned long long InDelivers __attribute__ ((aligned (16)));
unsigned long long OutRequests __attribute__ ((aligned (16)));
unsigned long long ReasmReqds __attribute__ ((aligned (16)));
unsigned long long ReasmOKs __attribute__ ((aligned (16)));
unsigned long long FragOKs __attribute__ ((aligned (16)));
unsigned long long FragCreates __attribute__ ((aligned (16)));
};
#define STATS_NET_IP_SIZE (sizeof(struct stats_net_ip))
/* Structure for IP errors statistics */
struct stats_net_eip {
unsigned long long InHdrErrors __attribute__ ((aligned (16)));
unsigned long long InAddrErrors __attribute__ ((aligned (16)));
unsigned long long InUnknownProtos __attribute__ ((aligned (16)));
unsigned long long InDiscards __attribute__ ((aligned (16)));
unsigned long long OutDiscards __attribute__ ((aligned (16)));
unsigned long long OutNoRoutes __attribute__ ((aligned (16)));
unsigned long long ReasmFails __attribute__ ((aligned (16)));
unsigned long long FragFails __attribute__ ((aligned (16)));
};
#define STATS_NET_EIP_SIZE (sizeof(struct stats_net_eip))
/* 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))
/* 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))
/* 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))
/* 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))
/* 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))
/* Structure for IPv6 statistics */
struct stats_net_ip6 {
unsigned long long InReceives6 __attribute__ ((aligned (16)));
unsigned long long OutForwDatagrams6 __attribute__ ((aligned (16)));
unsigned long long InDelivers6 __attribute__ ((aligned (16)));
unsigned long long OutRequests6 __attribute__ ((aligned (16)));
unsigned long long ReasmReqds6 __attribute__ ((aligned (16)));
unsigned long long ReasmOKs6 __attribute__ ((aligned (16)));
unsigned long long InMcastPkts6 __attribute__ ((aligned (16)));
unsigned long long OutMcastPkts6 __attribute__ ((aligned (16)));
unsigned long long FragOKs6 __attribute__ ((aligned (16)));
unsigned long long FragCreates6 __attribute__ ((aligned (16)));
};
#define STATS_NET_IP6_SIZE (sizeof(struct stats_net_ip6))
/* Structure for IPv6 errors statistics */
struct stats_net_eip6 {
unsigned long long InHdrErrors6 __attribute__ ((aligned (16)));
unsigned long long InAddrErrors6 __attribute__ ((aligned (16)));
unsigned long long InUnknownProtos6 __attribute__ ((aligned (16)));
unsigned long long InTooBigErrors6 __attribute__ ((aligned (16)));
unsigned long long InDiscards6 __attribute__ ((aligned (16)));
unsigned long long OutDiscards6 __attribute__ ((aligned (16)));
unsigned long long InNoRoutes6 __attribute__ ((aligned (16)));
unsigned long long OutNoRoutes6 __attribute__ ((aligned (16)));
unsigned long long ReasmFails6 __attribute__ ((aligned (16)));
unsigned long long FragFails6 __attribute__ ((aligned (16)));
unsigned long long InTruncatedPkts6 __attribute__ ((aligned (16)));
};
#define STATS_NET_EIP6_SIZE (sizeof(struct stats_net_eip6))
/* 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))
/* 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))
/* 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))
/* Structure for IPv6 sockets statistics */
struct stats_net_sock6 {
unsigned int tcp6_inuse __attribute__ ((aligned (4)));
unsigned int udp6_inuse __attribute__ ((packed));
unsigned int raw6_inuse __attribute__ ((packed));
unsigned int frag6_inuse __attribute__ ((packed));
};
#define STATS_NET_SOCK6_SIZE (sizeof(struct stats_net_sock6))
/*
* 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))
/* Structure for hugepages statistics */
struct stats_huge {
unsigned long frhkb __attribute__ ((aligned (8)));
unsigned long tlhkb __attribute__ ((aligned (8)));
};
#define STATS_HUGE_SIZE (sizeof(struct stats_memory))
/*
* 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 __attribute__ ((aligned (16)));
unsigned long freq __attribute__ ((aligned (16)));
};
#define STATS_PWR_WGHFREQ_SIZE (sizeof(struct stats_pwr_wghfreq))
/*
* Structure for USB devices plugged into the system.
*/
struct stats_pwr_usb {
unsigned int bus_nr __attribute__ ((aligned (4)));
unsigned int vendor_id __attribute__ ((packed));
unsigned int product_id __attribute__ ((packed));
unsigned int bmaxpower __attribute__ ((packed));
char manufacturer[MAX_MANUF_LEN];
char product[MAX_PROD_LEN];
};
#define STATS_PWR_USB_SIZE (sizeof(struct stats_pwr_usb))
/* Structure for filesystems statistics */
struct stats_filesystem {
unsigned long long f_blocks __attribute__ ((aligned (16)));
unsigned long long f_bfree __attribute__ ((aligned (16)));
unsigned long long f_bavail __attribute__ ((aligned (16)));
unsigned long long f_files __attribute__ ((aligned (16)));
unsigned long long f_ffree __attribute__ ((aligned (16)));
char fs_name[MAX_FS_LEN] __attribute__ ((aligned (16)));
};
#define STATS_FILESYSTEM_SIZE (sizeof(struct stats_filesystem))
/*
***************************************************************************
* Prototypes for functions used to read system statistics
***************************************************************************
*/
extern void
oct2chr(char *);
extern void
read_stat_cpu(struct stats_cpu *, int,
unsigned long long *, unsigned long long *);
extern void
read_stat_pcsw(struct stats_pcsw *);
extern void
read_stat_irq(struct stats_irq *, int);
extern void
read_loadavg(struct stats_queue *);
extern void
read_meminfo(struct stats_memory *);
extern void
read_vmstat_swap(struct stats_swap *);
extern void
read_vmstat_paging(struct stats_paging *);
extern void
read_diskstats_io(struct stats_io *);
extern void
read_diskstats_disk(struct stats_disk *, int, int);
extern void
read_tty_driver_serial(struct stats_serial *, int);
extern void
read_kernel_tables(struct stats_ktables *);
extern void
read_net_dev(struct stats_net_dev *, int);
extern void
read_net_edev(struct stats_net_edev *, int);
extern void
read_net_nfs(struct stats_net_nfs *);
extern void
read_net_nfsd(struct stats_net_nfsd *);
extern void
read_net_sock(struct stats_net_sock *);
extern void
read_net_ip(struct stats_net_ip *);
extern void
read_net_eip(struct stats_net_eip *);
extern void
read_net_icmp(struct stats_net_icmp *);
extern void
read_net_eicmp(struct stats_net_eicmp *);
extern void
read_net_tcp(struct stats_net_tcp *);
extern void
read_net_etcp(struct stats_net_etcp *);
extern void
read_net_udp(struct stats_net_udp *);
extern void
read_uptime(unsigned long long *);
extern void
read_net_sock6(struct stats_net_sock6 *);
extern void
read_net_ip6(struct stats_net_ip6 *);
extern void
read_net_eip6(struct stats_net_eip6 *);
extern void
read_net_icmp6(struct stats_net_icmp6 *);
extern void
read_net_eicmp6(struct stats_net_eicmp6 *);
extern void
read_net_udp6(struct stats_net_udp6 *);
extern void
read_cpuinfo(struct stats_pwr_cpufreq *, int);
extern void
read_meminfo_huge(struct stats_huge *);
extern void
read_time_in_state(struct stats_pwr_wghfreq *, int, int);
extern void
read_bus_usb_dev(struct stats_pwr_usb *, int);
extern void
read_filesystem(struct stats_filesystem *, int);
#endif /* _RD_STATS_H */