1 #define MAXCPU_25 2048 2 #define MAXDSK_25 1024 3 #define MAXLVM_25 2048 4 #define MAXMDD_25 256 5 #define MAXINTF_25 128 6 #define MAXCONTAINER_25 128 7 #define MAXNFSMOUNT_25 64 8 #define MAXIBPORT_25 32 9 #define MAXGPU_25 32 10 11 /************************************************************************/ 12 struct memstat_25 { 13 count_t physmem; // number of physical pages 14 count_t freemem; // number of free pages 15 count_t buffermem; // number of buffer pages 16 count_t slabmem; // number of slab pages 17 count_t cachemem; // number of cache pages 18 count_t cachedrt; // number of cache pages (dirty) 19 20 count_t totswap; // number of pages in swap 21 count_t freeswap; // number of free swap pages 22 23 count_t pgscans; // number of page scans 24 count_t pgsteal; // number of page steals 25 count_t allocstall; // try to free pages forced 26 count_t swouts; // number of pages swapped out 27 count_t swins; // number of pages swapped in 28 29 count_t commitlim; // commit limit in pages 30 count_t committed; // number of reserved pages 31 32 count_t shmem; // tot shmem incl. tmpfs (pages) 33 count_t shmrss; // resident shared memory (pages) 34 count_t shmswp; // swapped shared memory (pages) 35 36 count_t slabreclaim; // reclaimable slab (pages) 37 38 count_t tothugepage; // total huge pages (huge pages) 39 count_t freehugepage; // free huge pages (huge pages) 40 count_t hugepagesz; // huge page size (bytes) 41 42 count_t vmwballoon; // vmware claimed balloon pages 43 count_t cfuture[8]; // reserved for future use 44 }; 45 46 /************************************************************************/ 47 48 struct netstat_25 { 49 struct ipv4_stats ipv4; 50 struct icmpv4_stats_wrong icmpv4; 51 struct udpv4_stats udpv4; 52 53 struct ipv6_stats ipv6; 54 struct icmpv6_stats icmpv6; 55 struct udpv6_stats udpv6; 56 57 struct tcp_stats tcp; 58 }; 59 60 /************************************************************************/ 61 62 struct freqcnt_25 { 63 count_t maxfreq;/* frequency in MHz */ 64 count_t cnt; /* number of clock ticks times state */ 65 count_t ticks; /* number of total clock ticks */ 66 /* if zero, cnt is actul freq */ 67 }; 68 69 struct percpu_25 { 70 int cpunr; 71 count_t stime; /* system time in clock ticks */ 72 count_t utime; /* user time in clock ticks */ 73 count_t ntime; /* nice time in clock ticks */ 74 count_t itime; /* idle time in clock ticks */ 75 count_t wtime; /* iowait time in clock ticks */ 76 count_t Itime; /* irq time in clock ticks */ 77 count_t Stime; /* softirq time in clock ticks */ 78 count_t steal; /* steal time in clock ticks */ 79 count_t guest; /* guest time in clock ticks */ 80 struct freqcnt_25 freqcnt;/* frequency scaling info */ 81 count_t instr; /* CPU instructions */ 82 count_t cycle; /* CPU cycles */ 83 count_t cfuture[2]; /* reserved for future use */ 84 }; 85 86 struct cpustat_25 { 87 count_t nrcpu; /* number of cpu's */ 88 count_t devint; /* number of device interrupts */ 89 count_t csw; /* number of context switches */ 90 count_t nprocs; /* number of processes started */ 91 float lavg1; /* load average last minute */ 92 float lavg5; /* load average last 5 minutes */ 93 float lavg15; /* load average last 15 minutes */ 94 count_t cfuture[4]; /* reserved for future use */ 95 96 struct percpu_25 all; 97 struct percpu_25 cpu[MAXCPU_25]; 98 }; 99 100 /************************************************************************/ 101 102 struct perdsk_25 { 103 char name[MAXDKNAM]; /* empty string for last */ 104 count_t nread; /* number of read transfers */ 105 count_t nrsect; /* number of sectors read */ 106 count_t nwrite; /* number of write transfers */ 107 count_t nwsect; /* number of sectors written */ 108 count_t io_ms; /* number of millisecs spent for I/O */ 109 count_t avque; /* average queue length */ 110 count_t cfuture[4]; /* reserved for future use */ 111 }; 112 113 struct dskstat_25 { 114 int ndsk; /* number of physical disks */ 115 int nmdd; /* number of md volumes */ 116 int nlvm; /* number of logical volumes */ 117 struct perdsk_25 dsk[MAXDSK_25]; 118 struct perdsk_25 mdd[MAXMDD_25]; 119 struct perdsk_25 lvm[MAXLVM_25]; 120 }; 121 122 /************************************************************************/ 123 124 struct perintf_25 { 125 char name[16]; /* empty string for last */ 126 127 count_t rbyte; /* number of read bytes */ 128 count_t rpack; /* number of read packets */ 129 count_t rerrs; /* receive errors */ 130 count_t rdrop; /* receive drops */ 131 count_t rfifo; /* receive fifo */ 132 count_t rframe; /* receive framing errors */ 133 count_t rcompr; /* receive compressed */ 134 count_t rmultic;/* receive multicast */ 135 count_t rfuture[4]; /* reserved for future use */ 136 137 count_t sbyte; /* number of written bytes */ 138 count_t spack; /* number of written packets */ 139 count_t serrs; /* transmit errors */ 140 count_t sdrop; /* transmit drops */ 141 count_t sfifo; /* transmit fifo */ 142 count_t scollis;/* collisions */ 143 count_t scarrier;/* transmit carrier */ 144 count_t scompr; /* transmit compressed */ 145 count_t sfuture[4]; /* reserved for future use */ 146 147 char type; /* interface type ('e'/'w'/'?') */ 148 long speed; /* interface speed in megabits/second */ 149 long speedp; /* previous interface speed */ 150 char duplex; /* full duplex (boolean) */ 151 count_t cfuture[4]; /* reserved for future use */ 152 }; 153 154 struct intfstat_25 { 155 int nrintf; 156 struct perintf_25 intf[MAXINTF_25]; 157 }; 158 159 /************************************************************************/ 160 161 struct pernfsmount_25 { 162 char mountdev[128]; /* mountdevice */ 163 count_t age; /* number of seconds mounted */ 164 165 count_t bytesread; /* via normal reads */ 166 count_t byteswrite; /* via normal writes */ 167 count_t bytesdread; /* via direct reads */ 168 count_t bytesdwrite; /* via direct writes */ 169 count_t bytestotread; /* via reads */ 170 count_t bytestotwrite; /* via writes */ 171 count_t pagesmread; /* via mmap reads */ 172 count_t pagesmwrite; /* via mmap writes */ 173 174 count_t future[8]; 175 }; 176 177 struct nfsstat_25 { 178 struct { 179 count_t netcnt; 180 count_t netudpcnt; 181 count_t nettcpcnt; 182 count_t nettcpcon; 183 184 count_t rpccnt; 185 count_t rpcbadfmt; 186 count_t rpcbadaut; 187 count_t rpcbadcln; 188 189 count_t rpcread; 190 count_t rpcwrite; 191 192 count_t rchits; /* repcache hits */ 193 count_t rcmiss; /* repcache misses */ 194 count_t rcnoca; /* uncached requests */ 195 196 count_t nrbytes; /* read bytes */ 197 count_t nwbytes; /* written bytes */ 198 199 count_t future[8]; 200 } server; 201 202 struct { 203 count_t rpccnt; 204 count_t rpcretrans; 205 count_t rpcautrefresh; 206 207 count_t rpcread; 208 count_t rpcwrite; 209 210 count_t future[8]; 211 } client; 212 213 struct { 214 int nrmounts; 215 struct pernfsmount_25 nfsmnt[MAXNFSMOUNT_25]; 216 } nfsmounts; 217 }; 218 219 /************************************************************************/ 220 struct psi_25 { 221 float avg10; // average pressure last 10 seconds 222 float avg60; // average pressure last 60 seconds 223 float avg300; // average pressure last 300 seconds 224 count_t total; // total number of milliseconds 225 }; 226 227 struct pressure_25 { 228 char present; /* pressure stats supported? */ 229 char future[3]; 230 struct psi_25 cpusome; /* pressure stall info 'some' */ 231 struct psi_25 memsome; /* pressure stall info 'some' */ 232 struct psi_25 memfull; /* pressure stall info 'full' */ 233 struct psi_25 iosome; /* pressure stall info 'some' */ 234 struct psi_25 iofull; /* pressure stall info 'full' */ 235 }; 236 237 /************************************************************************/ 238 239 struct percontainer_25 { 240 unsigned long ctid; /* container id */ 241 unsigned long numproc; /* number of processes */ 242 243 count_t system; /* */ 244 count_t user; /* */ 245 count_t nice; /* */ 246 count_t uptime; /* */ 247 248 count_t physpages; /* */ 249 }; 250 251 struct contstat_25 { 252 int nrcontainer; 253 struct percontainer_25 cont[MAXCONTAINER_25]; 254 }; 255 256 /************************************************************************/ 257 /* 258 ** experimental stuff for access to local HTTP daemons 259 */ 260 struct wwwstat_25 { 261 count_t accesses; /* total number of HTTP-requests */ 262 count_t totkbytes; /* total kbytes transfer for HTTP-req */ 263 count_t uptime; /* number of seconds since startup */ 264 int bworkers; /* number of busy httpd-daemons */ 265 int iworkers; /* number of idle httpd-daemons */ 266 }; 267 268 /************************************************************************/ 269 270 struct pergpu_25 { 271 char taskstats; // GPU task statistics supported? 272 unsigned char nrprocs; // number of processes using GPU 273 char type[MAXGPUTYPE+1]; // GPU type 274 char busid[MAXGPUBUS+1]; // GPU bus identification 275 int gpunr; // GPU number 276 int gpupercnow; // processor percentage last second 277 // -1 if not supported 278 int mempercnow; // memory percentage last second 279 // -1 if not supported 280 count_t memtotnow; // total memory in KiB 281 count_t memusenow; // used memory in KiB 282 count_t samples; // number of samples 283 count_t gpuperccum; // cumulative processor busy percentage 284 // -1 if not supported 285 count_t memperccum; // cumulative memory percentage 286 // -1 if not supported 287 count_t memusecum; // cumulative used memory in KiB 288 }; 289 290 struct gpustat_25 { 291 int nrgpus; // total number of GPUs 292 struct pergpu_25 gpu[MAXGPU_25]; 293 }; 294 295 /************************************************************************/ 296 297 struct perifb_25 { 298 char ibname[MAXIBNAME]; // InfiniBand controller 299 short portnr; // InfiniBand controller port 300 301 short lanes; // number of lanes (traffic factor) 302 count_t rate; // transfer rate in megabits/sec 303 count_t rcvb; // bytes received 304 count_t sndb; // bytes transmitted 305 count_t rcvp; // packets received 306 count_t sndp; // packets transmitted 307 }; 308 309 struct ifbstat_25 { 310 int nrports; // total number of IB ports 311 struct perifb_25 ifb[MAXIBPORT_25]; 312 }; 313 /************************************************************************/ 314 315 struct sstat_25 { 316 struct cpustat_25 cpu; 317 struct memstat_25 mem; 318 struct netstat_25 net; 319 struct intfstat_25 intf; 320 struct dskstat_25 dsk; 321 struct nfsstat_25 nfs; 322 struct contstat_25 cfs; 323 struct pressure_25 psi; 324 struct gpustat_25 gpu; 325 struct ifbstat_25 ifb; 326 327 struct wwwstat_25 www; 328 };