]> granicus.if.org Git - sysstat/blob - sa_conv.h
iostat: Fix conversion factor for JSON output
[sysstat] / sa_conv.h
1 /*
2  * sa_conv.h: Include file for "sadf -c" command.
3  * (C) 1999-2016 by Sebastien Godard (sysstat <at> orange.fr)
4  */
5
6 #ifndef _SA_CONV_H
7 #define _SA_CONV_H
8
9 /*
10  * Header structure for previous system activity data file format
11  * (v9.1.6 up to v10.2.1).
12  */
13 struct file_header_2171 {
14         unsigned long sa_ust_time       __attribute__ ((aligned (8)));
15         unsigned int sa_act_nr          __attribute__ ((aligned (8)));
16         unsigned char sa_day;
17         unsigned char sa_month;
18         unsigned char sa_year;
19         char sa_sizeof_long;
20         char sa_sysname[UTSNAME_LEN];
21         char sa_nodename[UTSNAME_LEN];
22         char sa_release[UTSNAME_LEN];
23         char sa_machine[UTSNAME_LEN];
24 };
25
26 /* Structure stats_io for ACTIVITY_MAGIC_BASE format */
27 struct stats_io_8a {
28         unsigned int  dk_drive          __attribute__ ((aligned (4)));
29         unsigned int  dk_drive_rio      __attribute__ ((packed));
30         unsigned int  dk_drive_wio      __attribute__ ((packed));
31         unsigned int  dk_drive_rblk     __attribute__ ((packed));
32         unsigned int  dk_drive_wblk     __attribute__ ((packed));
33 };
34
35 /* Structure stats_queue for ACTIVITY_MAGIC_BASE format */
36 struct stats_queue_8a {
37         unsigned long nr_running        __attribute__ ((aligned (8)));
38         unsigned int  load_avg_1        __attribute__ ((aligned (8)));
39         unsigned int  load_avg_5        __attribute__ ((packed));
40         unsigned int  load_avg_15       __attribute__ ((packed));
41         unsigned int  nr_threads        __attribute__ ((packed));
42 };
43
44 /* Structure stats_disk for ACTIVITY_MAGIC_BASE format */
45 struct stats_disk_8a {
46         unsigned long long rd_sect      __attribute__ ((aligned (16)));
47         unsigned long long wr_sect      __attribute__ ((aligned (16)));
48         unsigned long rd_ticks          __attribute__ ((aligned (16)));
49         unsigned long wr_ticks          __attribute__ ((aligned (8)));
50         unsigned long tot_ticks         __attribute__ ((aligned (8)));
51         unsigned long rq_ticks          __attribute__ ((aligned (8)));
52         unsigned long nr_ios            __attribute__ ((aligned (8)));
53         unsigned int  major             __attribute__ ((aligned (8)));
54         unsigned int  minor             __attribute__ ((packed));
55 };
56
57 /* Structure stats_net_dev for ACTIVITY_MAGIC_BASE format */
58 struct stats_net_dev_8a {
59         unsigned long rx_packets                __attribute__ ((aligned (8)));
60         unsigned long tx_packets                __attribute__ ((aligned (8)));
61         unsigned long rx_bytes                  __attribute__ ((aligned (8)));
62         unsigned long tx_bytes                  __attribute__ ((aligned (8)));
63         unsigned long rx_compressed             __attribute__ ((aligned (8)));
64         unsigned long tx_compressed             __attribute__ ((aligned (8)));
65         unsigned long multicast                 __attribute__ ((aligned (8)));
66         char          interface[MAX_IFACE_LEN]  __attribute__ ((aligned (8)));
67 };
68
69 /* Structure stats_net_dev for ACTIVITY_MAGIC_BASE + 1 format */
70 struct stats_net_dev_8b {
71         unsigned long long rx_packets           __attribute__ ((aligned (16)));
72         unsigned long long tx_packets           __attribute__ ((aligned (16)));
73         unsigned long long rx_bytes             __attribute__ ((aligned (16)));
74         unsigned long long tx_bytes             __attribute__ ((aligned (16)));
75         unsigned long long rx_compressed        __attribute__ ((aligned (16)));
76         unsigned long long tx_compressed        __attribute__ ((aligned (16)));
77         unsigned long long multicast            __attribute__ ((aligned (16)));
78         char          interface[MAX_IFACE_LEN]  __attribute__ ((aligned (16)));
79 };
80
81 /* Structure stats_net_edev for ACTIVITY_MAGIC_BASE format */
82 struct stats_net_edev_8a {
83         unsigned long collisions                __attribute__ ((aligned (8)));
84         unsigned long rx_errors                 __attribute__ ((aligned (8)));
85         unsigned long tx_errors                 __attribute__ ((aligned (8)));
86         unsigned long rx_dropped                __attribute__ ((aligned (8)));
87         unsigned long tx_dropped                __attribute__ ((aligned (8)));
88         unsigned long rx_fifo_errors            __attribute__ ((aligned (8)));
89         unsigned long tx_fifo_errors            __attribute__ ((aligned (8)));
90         unsigned long rx_frame_errors           __attribute__ ((aligned (8)));
91         unsigned long tx_carrier_errors         __attribute__ ((aligned (8)));
92         char          interface[MAX_IFACE_LEN]  __attribute__ ((aligned (8)));
93 };
94
95 /* Structure stats_net_ip for ACTIVITY_MAGIC_BASE format */
96 struct stats_net_ip_8a {
97         unsigned long InReceives        __attribute__ ((aligned (8)));
98         unsigned long ForwDatagrams     __attribute__ ((aligned (8)));
99         unsigned long InDelivers        __attribute__ ((aligned (8)));
100         unsigned long OutRequests       __attribute__ ((aligned (8)));
101         unsigned long ReasmReqds        __attribute__ ((aligned (8)));
102         unsigned long ReasmOKs          __attribute__ ((aligned (8)));
103         unsigned long FragOKs           __attribute__ ((aligned (8)));
104         unsigned long FragCreates       __attribute__ ((aligned (8)));
105 };
106
107 /* Structure stats_net_eip for ACTIVITY_MAGIC_BASE format */
108 struct stats_net_eip_8a {
109         unsigned long InHdrErrors       __attribute__ ((aligned (8)));
110         unsigned long InAddrErrors      __attribute__ ((aligned (8)));
111         unsigned long InUnknownProtos   __attribute__ ((aligned (8)));
112         unsigned long InDiscards        __attribute__ ((aligned (8)));
113         unsigned long OutDiscards       __attribute__ ((aligned (8)));
114         unsigned long OutNoRoutes       __attribute__ ((aligned (8)));
115         unsigned long ReasmFails        __attribute__ ((aligned (8)));
116         unsigned long FragFails         __attribute__ ((aligned (8)));
117 };
118
119 /* Structure stats_net_ip6 for ACTIVITY_MAGIC_BASE format */
120 struct stats_net_ip6_8a {
121         unsigned long InReceives6       __attribute__ ((aligned (8)));
122         unsigned long OutForwDatagrams6 __attribute__ ((aligned (8)));
123         unsigned long InDelivers6       __attribute__ ((aligned (8)));
124         unsigned long OutRequests6      __attribute__ ((aligned (8)));
125         unsigned long ReasmReqds6       __attribute__ ((aligned (8)));
126         unsigned long ReasmOKs6         __attribute__ ((aligned (8)));
127         unsigned long InMcastPkts6      __attribute__ ((aligned (8)));
128         unsigned long OutMcastPkts6     __attribute__ ((aligned (8)));
129         unsigned long FragOKs6          __attribute__ ((aligned (8)));
130         unsigned long FragCreates6      __attribute__ ((aligned (8)));
131 };
132
133 /* Structure stats_net_eip6 for ACTIVITY_MAGIC_BASE format */
134 struct stats_net_eip6_8a {
135         unsigned long InHdrErrors6      __attribute__ ((aligned (8)));
136         unsigned long InAddrErrors6     __attribute__ ((aligned (8)));
137         unsigned long InUnknownProtos6  __attribute__ ((aligned (8)));
138         unsigned long InTooBigErrors6   __attribute__ ((aligned (8)));
139         unsigned long InDiscards6       __attribute__ ((aligned (8)));
140         unsigned long OutDiscards6      __attribute__ ((aligned (8)));
141         unsigned long InNoRoutes6       __attribute__ ((aligned (8)));
142         unsigned long OutNoRoutes6      __attribute__ ((aligned (8)));
143         unsigned long ReasmFails6       __attribute__ ((aligned (8)));
144         unsigned long FragFails6        __attribute__ ((aligned (8)));
145         unsigned long InTruncatedPkts6  __attribute__ ((aligned (8)));
146 };
147
148 #endif  /* _SA_CONV_H */