"Fossies" - the Fresh Open Source Software Archive

Member "atop-2.8.1/rawlog.h" (7 Jan 2023, 3970 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 "rawlog.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 /*
    2 ** ATOP - System & Process Monitor
    3 **
    4 ** The program 'atop' offers the possibility to view the activity of 
    5 ** the system on system-level as well as process-level.
    6 ** ==========================================================================
    7 ** Author:      Gerlof Langeveld
    8 ** E-mail:      gerlof.langeveld@atoptool.nl
    9 ** Date:        September 2002
   10 ** --------------------------------------------------------------------------
   11 ** Copyright (C) 2000-2010 Gerlof Langeveld
   12 **
   13 ** This program is free software; you can redistribute it and/or modify it
   14 ** under the terms of the GNU General Public License as published by the
   15 ** Free Software Foundation; either version 2, or (at your option) any
   16 ** later version.
   17 **
   18 ** This program is distributed in the hope that it will be useful, but
   19 ** WITHOUT ANY WARRANTY; without even the implied warranty of
   20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   21 ** See the GNU General Public License for more details.
   22 **
   23 ** You should have received a copy of the GNU General Public License
   24 ** along with this program; if not, write to the Free Software
   25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   26 ** --------------------------------------------------------------------------
   27 */
   28 
   29 /*
   30 ** structure describing the raw file contents
   31 **
   32 ** layout raw file:    rawheader
   33 **
   34 **                     rawrecord                           \
   35 **                     compressed system-level statistics   | sample 1
   36 **                     compressed process-level statistics /
   37 **
   38 **                     rawrecord                           \
   39 **                     compressed system-level statistics   | sample 2
   40 **                     compressed process-level statistics /
   41 **
   42 ** etcetera .....
   43 */
   44 #define MYMAGIC     (unsigned int) 0xfeedbeef
   45 #define READAHEADOFF    22
   46 #define READAHEADSIZE   (1 << READAHEADOFF)
   47 
   48 struct rawheader {
   49     unsigned int    magic;
   50 
   51     unsigned short  aversion;   /* creator atop version with MSB */
   52     unsigned short  future1;    /* can be reused         */
   53     unsigned short  future2;    /* can be reused         */
   54     unsigned short  rawheadlen; /* length of struct rawheader    */
   55     unsigned short  rawreclen;  /* length of struct rawrecord    */
   56     unsigned short  hertz;      /* clock interrupts per second   */
   57     unsigned short  pidwidth;   /* number of digits for PID/TID  */
   58     unsigned short  sfuture[5]; /* future use                    */
   59     unsigned int    sstatlen;   /* length of struct sstat        */
   60     unsigned int    tstatlen;   /* length of struct tstat        */
   61     struct utsname  utsname;    /* info about this system        */
   62     char        cfuture[8]; /* future use                    */
   63 
   64     unsigned int    pagesize;   /* size of memory page (bytes)   */
   65     int     supportflags;   /* used features                 */
   66     int     osrel;      /* OS release number             */
   67     int     osvers;     /* OS version number             */
   68     int     ossub;      /* OS version subnumber          */
   69     int     ifuture[6]; /* future use                    */
   70 };
   71 
   72 struct rawrecord {
   73     time_t      curtime;    /* current time (epoch)         */
   74 
   75     unsigned short  flags;      /* various flags                */
   76     unsigned short  sfuture[3]; /* future use                   */
   77 
   78     unsigned int    scomplen;   /* length of compressed sstat   */
   79     unsigned int    pcomplen;   /* length of compressed tstat's */
   80     unsigned int    interval;   /* interval (number of seconds) */
   81     unsigned int    ndeviat;    /* number of tasks in list      */
   82     unsigned int    nactproc;   /* number of processes in list  */
   83     unsigned int    ntask;      /* total number of tasks        */
   84     unsigned int    totproc;    /* total number of processes    */
   85     unsigned int    totrun;     /* number of running  threads   */
   86     unsigned int    totslpi;    /* number of sleeping threads(S)*/
   87     unsigned int    totslpu;    /* number of sleeping threads(D)*/
   88     unsigned int    totzomb;    /* number of zombie processes   */
   89     unsigned int    nexit;      /* number of exited processes   */
   90     unsigned int    noverflow;  /* number of overflow processes */
   91     unsigned int    ifuture[6]; /* future use                   */
   92 };