"Fossies" - the Fresh Open Source Software Archive

Member "atop-2.8.1/prev/photosyst_27.h" (7 Jan 2023, 13426 Bytes) of package /linux/misc/atop-2.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "photosyst_27.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.7.1_vs_2.8.0.

    1 #define MAXCPU_27       2048
    2 #define MAXDSK_27       1024
    3 #define MAXNUMA_27      1024
    4 #define MAXLVM_27       2048
    5 #define MAXMDD_27       256
    6 #define MAXINTF_27      128
    7 #define MAXCONTAINER_27 128
    8 #define MAXNFSMOUNT_27  64
    9 #define MAXIBPORT_27    32
   10 #define MAXGPU_27       32
   11 #define MAXGPUBUS_27    12
   12 #define MAXGPUTYPE_27   12
   13 
   14 #define MAXDKNAM_27     32
   15 #define MAXIBNAME_27    12
   16 
   17 /************************************************************************/
   18 struct  memstat_27 {
   19     count_t physmem;    // number of physical pages
   20     count_t freemem;    // number of free     pages
   21     count_t buffermem;  // number of buffer   pages
   22     count_t slabmem;    // number of slab     pages
   23     count_t cachemem;   // number of cache    pages
   24     count_t cachedrt;   // number of cache    pages (dirty)
   25 
   26     count_t totswap;    // number of pages in swap
   27     count_t freeswap;   // number of free swap pages
   28 
   29     count_t pgscans;    // number of page scans
   30     count_t pgsteal;    // number of page steals
   31     count_t allocstall; // try to free pages forced
   32     count_t swouts;     // number of pages swapped out
   33     count_t swins;      // number of pages swapped in
   34 
   35     count_t commitlim;  // commit limit in pages
   36     count_t committed;  // number of reserved pages
   37 
   38     count_t shmem;      // tot shmem incl. tmpfs (pages)
   39     count_t shmrss;     // resident shared memory (pages)
   40     count_t shmswp;     // swapped shared memory (pages)
   41 
   42     count_t slabreclaim;    // reclaimable slab (pages)
   43 
   44     count_t tothugepage;    // total huge pages (huge pages)
   45     count_t freehugepage;   // free  huge pages (huge pages)
   46     count_t hugepagesz; // huge page size (bytes)
   47 
   48     count_t vmwballoon; // vmware claimed balloon pages
   49     count_t zfsarcsize; // zfsonlinux ARC size (pages)
   50     count_t swapcached; // swap cache (pages)
   51     count_t ksmsharing; // saved i.e. deduped memory (pages)
   52     count_t ksmshared;  // current size shared pages (pages)
   53     count_t zswstored;  // zswap stored pages (pages)
   54     count_t zswtotpool; // total pool size (pages)
   55     count_t oomkills;   // number of oom killings
   56     count_t compactstall;   // counter for process stalls
   57     count_t pgmigrate;  // counter for migrated successfully (pages)
   58     count_t numamigrate;    // counter for numa migrated (pages)
   59     count_t cfuture[9]; // reserved for future use
   60 };
   61 
   62 /************************************************************************/
   63 
   64 struct  mempernuma_27 {
   65     float   frag;       // fragmentation level for this numa
   66     count_t totmem;     // number of physical pages for this numa
   67     count_t freemem;    // number of free     pages for this numa
   68     count_t filepage;   // number of file     pages for this numa
   69     count_t dirtymem;   // number of cache    pages (dirty) for this numa
   70     count_t slabmem;    // number of slab     pages for this numa
   71     count_t slabreclaim;    // reclaimable slab (pages) for this numa
   72 
   73     count_t active;     // number of pages used more recently for this numa
   74     count_t inactive;   // number of pages less recently used for this numa
   75 
   76     count_t shmem;      // tot shmem incl. tmpfs (pages) for this numa
   77     count_t tothp;      // total huge pages (huge pages) for this numa
   78 };
   79 
   80 struct  memnuma_27 {
   81     count_t           nrnuma;       /* the counts of numa       */
   82     struct mempernuma_27 numa[MAXNUMA_27];
   83 };
   84 
   85 struct  cpupernuma_27 {
   86     count_t nrcpu;      // number of cpu's
   87     count_t stime;      // accumulate system  time in clock ticks for per numa
   88     count_t utime;      // accumulate user    time in clock ticks for per numa
   89     count_t ntime;      // accumulate nice    time in clock ticks for per numa
   90     count_t itime;      // accumulate idle    time in clock ticks for per numa
   91     count_t wtime;      // accumulate iowait  time in clock ticks for per numa
   92     count_t Itime;      // accumulate irq     time in clock ticks for per numa
   93     count_t Stime;      // accumulate softirq time in clock ticks for per numa
   94     count_t steal;      // accumulate steal   time in clock ticks for per numa
   95     count_t guest;      // accumulate guest   time in clock ticks for per numa
   96 };
   97 
   98 struct  cpunuma_27 {
   99     count_t           nrnuma;       /* the counts of numa       */
  100     struct cpupernuma_27 numa[MAXNUMA_27];
  101 };
  102 
  103 /************************************************************************/
  104 
  105 struct  netstat_27 {
  106     struct ipv4_stats   ipv4;
  107     struct icmpv4_stats_wrong   icmpv4;
  108     struct udpv4_stats  udpv4;
  109 
  110     struct ipv6_stats   ipv6;
  111     struct icmpv6_stats icmpv6;
  112     struct udpv6_stats  udpv6;
  113 
  114     struct tcp_stats    tcp;
  115 };
  116 
  117 /************************************************************************/
  118 
  119 struct freqcnt_27 {
  120         count_t maxfreq;/* frequency in MHz                    */
  121         count_t cnt;    /* number of clock ticks times state   */
  122         count_t ticks;  /* number of total clock ticks         */
  123                         /* if zero, cnt is actul freq          */
  124 };
  125 
  126 struct percpu_27 {
  127     int     cpunr;
  128     count_t     stime;  /* system  time in clock ticks      */
  129     count_t     utime;  /* user    time in clock ticks      */
  130     count_t     ntime;  /* nice    time in clock ticks      */
  131     count_t     itime;  /* idle    time in clock ticks      */
  132     count_t     wtime;  /* iowait  time in clock ticks      */
  133     count_t     Itime;  /* irq     time in clock ticks      */
  134     count_t     Stime;  /* softirq time in clock ticks      */
  135     count_t     steal;  /* steal   time in clock ticks      */
  136     count_t     guest;  /* guest   time in clock ticks      */
  137         struct freqcnt_27   freqcnt;/* frequency scaling info       */
  138     count_t     instr;  /* CPU instructions             */
  139     count_t     cycle;  /* CPU cycles               */
  140     count_t     cfuture[6]; /* reserved for future use  */
  141 };
  142 
  143 struct  cpustat_27 {
  144     count_t nrcpu;  /* number of cpu's          */
  145     count_t devint; /* number of device interrupts      */
  146     count_t csw;    /* number of context switches       */
  147     count_t nprocs; /* number of processes started          */
  148     float   lavg1;  /* load average last    minute          */
  149     float   lavg5;  /* load average last  5 minutes         */
  150     float   lavg15; /* load average last 15 minutes         */
  151     count_t cfuture[4]; /* reserved for future use  */
  152 
  153     struct percpu_27   all;
  154     struct percpu_27   cpu[MAXCPU_27];
  155 };
  156 
  157 /************************************************************************/
  158 
  159 struct  perdsk_27 {
  160         char    name[MAXDKNAM_27];  /* empty string for last        */
  161         count_t nread;  /* number of read  transfers            */
  162         count_t nrsect; /* number of sectors read               */
  163         count_t nwrite; /* number of write transfers            */
  164         count_t nwsect; /* number of sectors written            */
  165         count_t io_ms;  /* number of millisecs spent for I/O    */
  166         count_t avque;  /* average queue length                 */
  167         count_t ndisc;  /* number of discards (-1 = unavailable)*/
  168         count_t ndsect; /* number of sectors discarded          */
  169     count_t cfuture[2]; /* reserved for future use  */
  170 };
  171 
  172 struct dskstat_27 {
  173     int     ndsk;   /* number of physical disks */
  174     int     nmdd;   /* number of md volumes     */
  175     int     nlvm;   /* number of logical volumes    */
  176     struct perdsk_27    dsk[MAXDSK_27];
  177     struct perdsk_27    mdd[MAXMDD_27];
  178     struct perdsk_27    lvm[MAXLVM_27];
  179 };
  180 
  181 /************************************************************************/
  182 
  183 struct  perintf_27 {
  184         char    name[16];   /* empty string for last        */
  185 
  186         count_t rbyte;  /* number of read bytes                 */
  187         count_t rpack;  /* number of read packets               */
  188     count_t rerrs;  /* receive errors                       */
  189     count_t rdrop;  /* receive drops                        */
  190     count_t rfifo;  /* receive fifo                         */
  191     count_t rframe; /* receive framing errors               */
  192     count_t rcompr; /* receive compressed                   */
  193     count_t rmultic;/* receive multicast                    */
  194     count_t rfuture[4]; /* reserved for future use  */
  195 
  196         count_t sbyte;  /* number of written bytes              */
  197         count_t spack;  /* number of written packets            */
  198     count_t serrs;  /* transmit errors                      */
  199     count_t sdrop;  /* transmit drops                       */
  200     count_t sfifo;  /* transmit fifo                        */
  201     count_t scollis;/* collisions                           */
  202     count_t scarrier;/* transmit carrier                    */
  203     count_t scompr; /* transmit compressed                  */
  204     count_t sfuture[4]; /* reserved for future use  */
  205 
  206     char    type;   /* interface type ('e'/'w'/'v'/'?')     */
  207     long    speed;  /* interface speed in megabits/second   */
  208     long    speedp; /* previous interface speed         */
  209     char    duplex; /* full duplex (boolean)        */
  210     count_t cfuture[4]; /* reserved for future use  */
  211 };
  212 
  213 struct intfstat_27 {
  214     int     nrintf;
  215     struct perintf_27   intf[MAXINTF_27];
  216 };
  217 
  218 /************************************************************************/
  219 
  220 struct  pernfsmount_27 {
  221         char    mountdev[128];      /* mountdevice          */
  222         count_t age;            /* number of seconds mounted    */
  223     
  224     count_t bytesread;      /* via normal reads     */
  225     count_t byteswrite;     /* via normal writes        */
  226     count_t bytesdread;     /* via direct reads     */
  227     count_t bytesdwrite;        /* via direct writes        */
  228     count_t bytestotread;       /* via reads            */
  229     count_t bytestotwrite;      /* via writes           */
  230     count_t pagesmread;     /* via mmap  reads      */
  231     count_t pagesmwrite;        /* via mmap  writes     */
  232 
  233     count_t future[8];
  234 };
  235 
  236 struct nfsstat_27 {
  237     struct {
  238             count_t netcnt;
  239         count_t netudpcnt;
  240         count_t nettcpcnt;
  241         count_t nettcpcon;
  242 
  243         count_t rpccnt;
  244         count_t rpcbadfmt;
  245         count_t rpcbadaut;
  246         count_t rpcbadcln;
  247 
  248         count_t rpcread;
  249         count_t rpcwrite;
  250 
  251         count_t rchits;     /* repcache hits    */
  252         count_t rcmiss;     /* repcache misses  */
  253         count_t rcnoca;     /* uncached requests    */
  254 
  255         count_t nrbytes;    /* read bytes       */
  256         count_t nwbytes;    /* written bytes    */
  257 
  258         count_t future[8];
  259     } server;
  260 
  261     struct {
  262         count_t rpccnt;
  263         count_t rpcretrans;
  264         count_t rpcautrefresh;
  265 
  266         count_t rpcread;
  267         count_t rpcwrite;
  268 
  269         count_t future[8];
  270     } client;
  271 
  272     struct {
  273             int                 nrmounts;
  274             struct pernfsmount_27   nfsmnt[MAXNFSMOUNT_27];
  275     } nfsmounts;
  276 };
  277 
  278 /************************************************************************/
  279 struct  psi_27 {
  280     float   avg10;      // average pressure last 10 seconds
  281     float   avg60;      // average pressure last 60 seconds
  282     float   avg300;     // average pressure last 300 seconds
  283     count_t total;      // total number of milliseconds
  284 };
  285 
  286 struct  pressure_27 {
  287     char       present; /* pressure stats supported?    */
  288     char       future[3];
  289     struct psi_27 cpusome;  /* pressure stall info 'some'   */
  290     struct psi_27 memsome;  /* pressure stall info 'some'   */
  291     struct psi_27 memfull;  /* pressure stall info 'full'   */
  292     struct psi_27 iosome;   /* pressure stall info 'some'   */
  293     struct psi_27 iofull;   /* pressure stall info 'full'   */
  294 };
  295 
  296 /************************************************************************/
  297 
  298 struct  percontainer_27 {
  299         unsigned long   ctid;       /* container id         */
  300         unsigned long   numproc;    /* number of processes      */
  301 
  302         count_t system;     /* */
  303         count_t user;       /* */
  304         count_t nice;       /* */
  305         count_t uptime;     /* */
  306 
  307         count_t physpages;  /* */
  308 };
  309 
  310 struct contstat_27 {
  311         int                 nrcontainer;
  312         struct percontainer_27  cont[MAXCONTAINER_27];
  313 };
  314 
  315 /************************************************************************/
  316 /*
  317 ** experimental stuff for access to local HTTP daemons
  318 */
  319 #define HTTPREQ "GET /server-status?auto HTTP/1.1\nHost: localhost\n\n"
  320 
  321 struct wwwstat_27 {
  322     count_t accesses;   /* total number of HTTP-requests    */
  323     count_t totkbytes;  /* total kbytes transfer for HTTP-req   */
  324     count_t uptime;     /* number of seconds since startup  */
  325     int bworkers;   /* number of busy httpd-daemons     */
  326     int iworkers;   /* number of idle httpd-daemons     */
  327 };
  328 
  329 #if HTTPSTATS
  330 int getwwwstat_27(unsigned short, struct wwwstat_27 *);
  331 #endif
  332 /************************************************************************/
  333 struct pergpu_27 {
  334     char    taskstats;      // GPU task statistics supported?
  335     unsigned char   nrprocs;    // number of processes using GPU
  336     char    type[MAXGPUTYPE_27+1];  // GPU type
  337     char    busid[MAXGPUBUS_27+1];  // GPU bus identification
  338     int gpunr;          // GPU number
  339     int gpupercnow;     // processor percentage last second
  340                     // -1 if not supported
  341     int mempercnow;     // memory    percentage last second
  342                     // -1 if not supported
  343     count_t memtotnow;      // total memory in KiB
  344     count_t memusenow;      // used  memory in KiB
  345     count_t samples;        // number of samples
  346     count_t gpuperccum;     // cumulative processor busy percentage
  347                     // -1 if not supported
  348     count_t memperccum;     // cumulative memory percentage 
  349                     // -1 if not supported
  350     count_t memusecum;      // cumulative used memory in KiB
  351 };
  352 
  353 struct gpustat_27 {
  354     int     nrgpus;     // total number of GPUs
  355     struct pergpu_27   gpu[MAXGPU_27];
  356 };
  357 
  358 /************************************************************************/
  359 struct perifb_27 {
  360     char    ibname[MAXIBNAME_27];   // InfiniBand controller
  361     short   portnr;         // InfiniBand controller port
  362 
  363     short   lanes;          // number of lanes (traffic factor)
  364     count_t rate;           // transfer rate in megabits/sec
  365     count_t rcvb;               // bytes received
  366     count_t sndb;               // bytes transmitted
  367     count_t rcvp;               // packets received
  368     count_t sndp;               // packets transmitted
  369 };
  370 
  371 struct ifbstat_27 {
  372     int     nrports;    // total number of IB ports
  373     struct perifb_27   ifb[MAXIBPORT_27];
  374 };
  375 /************************************************************************/
  376 
  377 struct  sstat_27 {
  378     struct cpustat_27   cpu;
  379     struct memstat_27   mem;
  380     struct netstat_27   net;
  381     struct intfstat_27  intf;
  382     struct memnuma_27   memnuma;
  383     struct cpunuma_27   cpunuma;
  384     struct dskstat_27  dsk;
  385     struct nfsstat_27  nfs;
  386     struct contstat_27 cfs;
  387     struct pressure_27  psi;
  388     struct gpustat_27   gpu;
  389     struct ifbstat_27   ifb;
  390 
  391     struct wwwstat_27   www;
  392 };