From 326e82c03d0d9e60ae9591d3aa7ff6536628b3d1 Mon Sep 17 00:00:00 2001 From: Gerlof Langeveld Date: Thu, 4 Jan 2024 10:56:08 +0100 Subject: [PATCH] Prepare for atop 2.10 --- AUTHORS | 4 + Makefile | 2 +- atopconvert.c | 157 +++++++++++++--- man/atop.1 | 2 +- man/atopacctd.8 | 2 +- man/atopcat.1 | 2 +- man/atopconvert.1 | 2 +- man/atopgpud.8 | 2 +- man/atophide.1 | 2 +- man/atoprc.5 | 2 +- man/atopsar.1 | 2 +- photoproc.h | 2 +- prev/netstats_wrong.h | 19 +- prev/photoproc_210.h | 127 +++++++++++++ prev/photosyst_20.h | 4 +- prev/photosyst_21.h | 4 +- prev/photosyst_210.h | 427 ++++++++++++++++++++++++++++++++++++++++++ prev/photosyst_22.h | 4 +- prev/photosyst_23.h | 4 +- prev/photosyst_24.h | 4 +- prev/photosyst_25.h | 4 +- prev/photosyst_26.h | 4 +- prev/photosyst_27.h | 4 +- prev/photosyst_28.h | 2 +- prev/photosyst_29.h | 4 +- version.h | 2 +- 26 files changed, 741 insertions(+), 53 deletions(-) create mode 100644 prev/photoproc_210.h create mode 100644 prev/photosyst_210.h diff --git a/AUTHORS b/AUTHORS index 5aea60da..3016e667 100644 --- a/AUTHORS +++ b/AUTHORS @@ -26,3 +26,7 @@ codebling Justin Kromlinger Alastair Young roadrunner2 +liutingjieni +Algebra970 +Donatas Abraitis +Marc Haber diff --git a/Makefile b/Makefile index 97f23ac9..a6f196b8 100644 --- a/Makefile +++ b/Makefile @@ -172,7 +172,7 @@ genericinstall: atop atopacctd atopconvert atopcat atophide chmod 0711 $(DESTDIR)$(BINPATH)/atopconvert cp atopcat $(DESTDIR)$(BINPATH)/atopcat chmod 0711 $(DESTDIR)$(BINPATH)/atopcat - cp atopcat $(DESTDIR)$(BINPATH)/atophide + cp atophide $(DESTDIR)$(BINPATH)/atophide chmod 0711 $(DESTDIR)$(BINPATH)/atophide cp man/atop.1 $(DESTDIR)$(MAN1PATH) cp man/atopsar.1 $(DESTDIR)$(MAN1PATH) diff --git a/atopconvert.c b/atopconvert.c index af5a6a38..2cc38499 100644 --- a/atopconvert.c +++ b/atopconvert.c @@ -1,7 +1,7 @@ /* ** ATOP - System & Process Monitor ** -** The program 'atop' offers the possibility to view the activity of +** The program 'atop' offers the possibility to view the activity of ** the system on system-level as well as process-level. ** ** This program converts a raw logfile created by a particular version @@ -11,7 +11,7 @@ ** E-mail: gerlof.langeveld@atoptool.nl ** Initial: July/August 2018 ** -------------------------------------------------------------------------- -** Copyright (C) 2018-2022 Gerlof Langeveld +** Copyright (C) 2018-2024 Gerlof Langeveld ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -85,27 +85,41 @@ #include "prev/photosyst_29.h" #include "prev/photoproc_29.h" +#include "prev/photosyst_210.h" +#include "prev/photoproc_210.h" + void justcopy(void *, void *, count_t, count_t); void scpu_to_21(void *, void *, count_t, count_t); void sdsk_to_21(void *, void *, count_t, count_t); + void sint_to_22(void *, void *, count_t, count_t); + void scpu_to_27(void *, void *, count_t, count_t); void smem_to_27(void *, void *, count_t, count_t); void sdsk_to_27(void *, void *, count_t, count_t); + void smem_to_28(void *, void *, count_t, count_t); void sdsk_to_28(void *, void *, count_t, count_t); void smnu_to_28(void *, void *, count_t, count_t); void scnu_to_28(void *, void *, count_t, count_t); + +void sllc_to_210(void *, void *, count_t, count_t); + void tgen_to_21(void *, void *, count_t, count_t); void tmem_to_21(void *, void *, count_t, count_t); + void tgen_to_22(void *, void *, count_t, count_t); + void tcpu_to_26(void *, void *, count_t, count_t); void tmem_to_26(void *, void *, count_t, count_t); + void tcpu_to_28(void *, void *, count_t, count_t); void tmem_to_28(void *, void *, count_t, count_t); +void tgen_to_210(void *, void *, count_t, count_t); + /////////////////////////////////////////////////////////////// // Conversion functions // -------------------- @@ -190,7 +204,7 @@ sint_to_22(void *old, void *new, count_t oldsize, count_t newsize) sizeof(struct perintf_21)); // correct last members by refilling - // + // i22->intf[i].type = '?'; i22->intf[i].speed = i21->intf[i].speed; i22->intf[i].speedp = i21->intf[i].speed; @@ -330,7 +344,7 @@ smnu_to_28(void *old, void *new, count_t oldsize, count_t newsize) n28->numa[i].inactive = n27->numa[i].inactive; n28->numa[i].shmem = n27->numa[i].shmem; n28->numa[i].tothp = n27->numa[i].tothp; - } + } } void @@ -355,9 +369,26 @@ scnu_to_28(void *old, void *new, count_t oldsize, count_t newsize) n28->numa[i].Stime = n27->numa[i].Stime; n28->numa[i].steal = n27->numa[i].steal; n28->numa[i].guest = n27->numa[i].guest; - } + } } +void +sllc_to_210(void *old, void *new, count_t oldsize, count_t newsize) +{ + struct llcstat_29 *l29 = old; + struct llcstat_210 *l210 = new; + int i; + + l210->nrllcs = l29->nrllcs; + + for (i=0; i < l210->nrllcs; i++) + { + l210->perllc[i].id = l29->perllc[i].id; + l210->perllc[i].occupancy = l29->perllc[i].occupancy; + l210->perllc[i].mbm_local = l29->perllc[i].mbm_local; + l210->perllc[i].mbm_total = l29->perllc[i].mbm_total; + } +} // ///////////////////////////////////////////////////////////////// // Specific functions that convert an old tstat sub-structure to @@ -482,6 +513,25 @@ tmem_to_28(void *old, void *new, count_t oldsize, count_t newsize) memset(m28->cfuture, 0, sizeof m28->cfuture); } +void +tgen_to_210(void *old, void *new, count_t oldsize, count_t newsize) +{ + // member 'nthridle' inserted, everything from member 'ctid' must shift + // + struct gen_29 *g29 = old; + struct gen_210 *g210 = new; + + memcpy(g210, g29, (char *)&g29->ctid - (char *)g29); // copy base values + + g210->nthridle = 0; + g210->ctid = g29->ctid; + g210->vpid = g29->vpid; + g210->wasinactive = g29->wasinactive; + + memcpy(g210->utsname, g29->container, sizeof(g210->utsname)); + memcpy(g210->cgpath, g29->cgpath, sizeof(g210->cgpath)); +} + /////////////////////////////////////////////////////////////// // conversion definition for various structs in sstat and tstat // @@ -510,6 +560,7 @@ struct sstat_26 sstat_26; struct sstat_27 sstat_27; struct sstat_28 sstat_28; struct sstat_29 sstat_29; +struct sstat_210 sstat_210; struct sstat sstat; struct tstat_20 tstat_20; @@ -522,6 +573,7 @@ struct tstat_26 tstat_26; struct tstat_27 tstat_27; struct tstat_28 tstat_28; struct tstat_29 tstat_29; +struct tstat_210 tstat_210; struct tstat tstat; struct convertall { @@ -556,7 +608,7 @@ struct convertall { struct tconvstruct tmem; struct tconvstruct tnet; struct tconvstruct tgpu; -} convs[] = +} convs[] = { {SETVERSION(2,0), sizeof(struct sstat_20), &sstat_20, @@ -577,11 +629,11 @@ struct convertall { {0, NULL, NULL}, {0, NULL, NULL}, - {sizeof(struct gen_20), + {sizeof(struct gen_20), STROFFSET(&tstat_20.gen, &tstat_20), NULL}, {sizeof(struct cpu_20), STROFFSET(&tstat_20.cpu, &tstat_20), NULL}, - {sizeof(struct dsk_20), + {sizeof(struct dsk_20), STROFFSET(&tstat_20.dsk, &tstat_20), NULL}, {sizeof(struct mem_20), STROFFSET(&tstat_20.mem, &tstat_20), NULL}, @@ -613,7 +665,7 @@ struct convertall { STROFFSET(&tstat_21.gen, &tstat_21), tgen_to_21}, {sizeof(struct cpu_21), STROFFSET(&tstat_21.cpu, &tstat_21), justcopy}, - {sizeof(struct dsk_21), + {sizeof(struct dsk_21), STROFFSET(&tstat_21.dsk, &tstat_21), justcopy}, {sizeof(struct mem_21), STROFFSET(&tstat_21.mem, &tstat_21), tmem_to_21}, @@ -641,7 +693,7 @@ struct convertall { {0, NULL, NULL}, {0, NULL, NULL}, - {sizeof(struct gen_22), + {sizeof(struct gen_22), STROFFSET(&tstat_22.gen, &tstat_22), tgen_to_22}, {sizeof(struct cpu_22), STROFFSET(&tstat_22.cpu, &tstat_22), justcopy}, @@ -679,7 +731,7 @@ struct convertall { STROFFSET(&tstat_23.cpu, &tstat_23), justcopy}, {sizeof(struct dsk_23), STROFFSET(&tstat_23.dsk, &tstat_23), justcopy}, - {sizeof(struct mem_23), + {sizeof(struct mem_23), STROFFSET(&tstat_23.mem, &tstat_23), justcopy}, {sizeof(struct net_23), STROFFSET(&tstat_23.net, &tstat_23), justcopy}, @@ -883,6 +935,39 @@ struct convertall { {sizeof(struct gpu_29), STROFFSET(&tstat_29.gpu, &tstat_29), justcopy}, }, + + {SETVERSION(2,10), // 2.9 --> 2.10 + sizeof(struct sstat_210), &sstat_210, + sizeof(struct tstat_210), NULL, + + {sizeof(struct cpustat_210), &sstat_210.cpu, justcopy}, + {sizeof(struct memstat_210), &sstat_210.mem, justcopy}, + {sizeof(struct netstat_210), &sstat_210.net, justcopy}, + {sizeof(struct intfstat_210), &sstat_210.intf, justcopy}, + {sizeof(struct dskstat_210), &sstat_210.dsk, justcopy}, + {sizeof(struct nfsstat_210), &sstat_210.nfs, justcopy}, + {sizeof(struct contstat_210), &sstat_210.cfs, justcopy}, + {sizeof(struct wwwstat_210), &sstat_210.www, justcopy}, + {sizeof(struct pressure_210), &sstat_210.psi, justcopy}, + {sizeof(struct gpustat_210), &sstat_210.gpu, justcopy}, + {sizeof(struct ifbstat_210), &sstat_210.ifb, justcopy}, + {sizeof(struct memnuma_210), &sstat_210.memnuma, justcopy}, + {sizeof(struct cpunuma_210), &sstat_210.cpunuma, justcopy}, + {sizeof(struct llcstat_210), &sstat_210.llc, sllc_to_210}, + + {sizeof(struct gen_210), + STROFFSET(&tstat_210.gen, &tstat_210), tgen_to_210}, + {sizeof(struct cpu_210), + STROFFSET(&tstat_210.cpu, &tstat_210), justcopy}, + {sizeof(struct dsk_210), + STROFFSET(&tstat_210.dsk, &tstat_210), justcopy}, + {sizeof(struct mem_210), + STROFFSET(&tstat_210.mem, &tstat_210), justcopy}, + {sizeof(struct net_210), + STROFFSET(&tstat_210.net, &tstat_210), justcopy}, + {sizeof(struct gpu_210), + STROFFSET(&tstat_210.gpu, &tstat_210), justcopy}, + }, }; int numconvs = sizeof convs / sizeof(struct convertall); @@ -1046,7 +1131,7 @@ main(int argc, char *argv[]) exit(11); } - // handle the output file + // handle the output file // if (optind >= argc) exit(0); @@ -1060,7 +1145,7 @@ main(int argc, char *argv[]) exit(12); } - // open the output file + // open the output file // if ( (ofd = openout(outfile)) == -1) { @@ -1076,6 +1161,9 @@ main(int argc, char *argv[]) orh.sstatlen = convs[targetix].sstatlen; orh.tstatlen = convs[targetix].tstatlen; + if (orh.pidwidth == 0) // no pid width know in old raw log? + orh.pidwidth = getpidwidth(); + writeout(ofd, &orh, sizeof orh); printf("Version of %s: %d.%d\n", outfile, @@ -1127,7 +1215,7 @@ convert_samples(int ifd, int ofd, struct rawheader *irh, int ivix, int ovix) exit(7); // STEP-BY-STEP CONVERSION FROM OLD VERSION TO NEW VERSION - // + // for (i=ivix; i < ovix; i++) { // convert system-level statistics to newer version @@ -1161,32 +1249,32 @@ convert_samples(int ifd, int ofd, struct rawheader *irh, int ivix, int ovix) for (t=0; t < irr.ndeviat; t++) // for every task { do_tconvert( - convs[i].tstat +(t*convs[i].tstatlen), + convs[i].tstat +(t*convs[i].tstatlen), convs[i+1].tstat+(t*convs[i+1].tstatlen), &(convs[i].tgen), &(convs[i+1].tgen)); do_tconvert( - convs[i].tstat +(t*convs[i].tstatlen), + convs[i].tstat +(t*convs[i].tstatlen), convs[i+1].tstat+(t*convs[i+1].tstatlen), &(convs[i].tcpu), &(convs[i+1].tcpu)); do_tconvert( - convs[i].tstat +(t*convs[i].tstatlen), + convs[i].tstat +(t*convs[i].tstatlen), convs[i+1].tstat+(t*convs[i+1].tstatlen), &(convs[i].tdsk), &(convs[i+1].tdsk)); do_tconvert( - convs[i].tstat +(t*convs[i].tstatlen), + convs[i].tstat +(t*convs[i].tstatlen), convs[i+1].tstat+(t*convs[i+1].tstatlen), &(convs[i].tmem), &(convs[i+1].tmem)); do_tconvert( - convs[i].tstat +(t*convs[i].tstatlen), + convs[i].tstat +(t*convs[i].tstatlen), convs[i+1].tstat+(t*convs[i+1].tstatlen), &(convs[i].tnet), &(convs[i+1].tnet)); do_tconvert( - convs[i].tstat +(t*convs[i].tstatlen), + convs[i].tstat +(t*convs[i].tstatlen), convs[i+1].tstat+(t*convs[i+1].tstatlen), &(convs[i].tgpu), &(convs[i+1].tgpu)); } @@ -1203,7 +1291,7 @@ convert_samples(int ifd, int ofd, struct rawheader *irh, int ivix, int ovix) irr.ndeviat); // cleanup - // + // free(convs[ovix].tstat); } @@ -1524,7 +1612,7 @@ testcompval(int rv, char *func) exit(7); case Z_DATA_ERROR: - fprintf(stderr, + fprintf(stderr, "%s: failed due to corrupted/incomplete data\n", func); exit(7); @@ -1551,3 +1639,28 @@ ptrverify(const void *ptr, const char *errormsg, ...) exit(13); } } + + +/* +** return maximum number of digits for PID/TID +** from the current system +*/ +int +getpidwidth(void) +{ + FILE *fp; + char linebuf[64]; + int numdigits = 5; + + if ( (fp = fopen("/proc/sys/kernel/pid_max", "r")) != NULL) + { + if ( fgets(linebuf, sizeof(linebuf), fp) != NULL) + { + numdigits = strlen(linebuf) - 1; + } + + fclose(fp); + } + + return numdigits; +} diff --git a/man/atop.1 b/man/atop.1 index e578a044..800a5c90 100644 --- a/man/atop.1 +++ b/man/atop.1 @@ -1,4 +1,4 @@ -.TH ATOP 1 "April 2023" "Linux" +.TH ATOP 1 "January 2024" "Linux" .SH NAME .B atop - Advanced System & Process Monitor diff --git a/man/atopacctd.8 b/man/atopacctd.8 index e936a7b3..4e014a7c 100644 --- a/man/atopacctd.8 +++ b/man/atopacctd.8 @@ -1,4 +1,4 @@ -.TH ATOPACCTD 8 "December 2022" "Linux" +.TH ATOPACCTD 8 "January 2024" "Linux" .SH NAME .B atopacctd - process accounting daemon diff --git a/man/atopcat.1 b/man/atopcat.1 index 54b09f52..e24b3bc7 100644 --- a/man/atopcat.1 +++ b/man/atopcat.1 @@ -1,4 +1,4 @@ -.TH ATOPCAT 1 "December 2022" "Linux" +.TH ATOPCAT 1 "January 2024" "Linux" .SH NAME .B atopcat - concatenate raw log files to stdout diff --git a/man/atopconvert.1 b/man/atopconvert.1 index f181a940..e345726a 100644 --- a/man/atopconvert.1 +++ b/man/atopconvert.1 @@ -1,4 +1,4 @@ -.TH ATOPCONVERT 1 "December 2022" "Linux" +.TH ATOPCONVERT 1 "January 2024" "Linux" .SH NAME .B atopconvert - convert raw log file to newer version diff --git a/man/atopgpud.8 b/man/atopgpud.8 index f5430a9e..3a5bf0e6 100644 --- a/man/atopgpud.8 +++ b/man/atopgpud.8 @@ -1,4 +1,4 @@ -.TH ATOPGPUD 8 "December 2022" "Linux" +.TH ATOPGPUD 8 "January 2024" "Linux" .SH NAME .B atopgpud - GPU statistics daemon diff --git a/man/atophide.1 b/man/atophide.1 index 163cc9b6..6d6f6a1a 100644 --- a/man/atophide.1 +++ b/man/atophide.1 @@ -1,4 +1,4 @@ -.TH ATOPHIDE 1 "July 2023" "Linux" +.TH ATOPHIDE 1 "January 2024" "Linux" .SH NAME .B atophide - partly copy raw log file and/or anonymize raw log diff --git a/man/atoprc.5 b/man/atoprc.5 index 92430857..a741a044 100644 --- a/man/atoprc.5 +++ b/man/atoprc.5 @@ -1,4 +1,4 @@ -.TH ATOPRC 5 "April 2023" "Linux" +.TH ATOPRC 5 "January 2024" "Linux" .SH NAME .B atoprc - atop/atopsar related rcfile diff --git a/man/atopsar.1 b/man/atopsar.1 index d31a3328..a2c5f1a7 100644 --- a/man/atopsar.1 +++ b/man/atopsar.1 @@ -1,4 +1,4 @@ -.TH ATOPSAR 1 "December 2022" "Linux" +.TH ATOPSAR 1 "January 2024" "Linux" .SH NAME .B atopsar - Advanced System Activity Report (atop related) diff --git a/photoproc.h b/photoproc.h index 750b4db0..d1bec71f 100644 --- a/photoproc.h +++ b/photoproc.h @@ -90,7 +90,7 @@ struct tstat { count_t blkdelay; /* blkio delay (ticks) */ count_t nvcsw; /* voluntary cxt switch counts */ count_t nivcsw; /* involuntary csw counts */ - count_t cfuture[1]; /* reserved for future use */ + count_t cfuture[3]; /* reserved for future use */ } cpu; /* DISK STATISTICS */ diff --git a/prev/netstats_wrong.h b/prev/netstats_wrong.h index 8a00c772..7db6cf9b 100644 --- a/prev/netstats_wrong.h +++ b/prev/netstats_wrong.h @@ -1,4 +1,21 @@ -struct icmpv4_stats_wrong { +struct tcp_stats_without_InCsumErrors { + count_t RtoAlgorithm; + count_t RtoMin; + count_t RtoMax; + count_t MaxConn; + count_t ActiveOpens; + count_t PassiveOpens; + count_t AttemptFails; + count_t EstabResets; + count_t CurrEstab; + count_t InSegs; + count_t OutSegs; + count_t RetransSegs; + count_t InErrs; + count_t OutRsts; +}; + +struct icmpv4_stats_without_InCsumErrors { count_t InMsgs; count_t InErrors; count_t InDestUnreachs; diff --git a/prev/photoproc_210.h b/prev/photoproc_210.h new file mode 100644 index 00000000..bb714ef8 --- /dev/null +++ b/prev/photoproc_210.h @@ -0,0 +1,127 @@ +/* +** structure containing only relevant process-info extracted +** from kernel's process-administration +*/ +struct tstat_210 { + /* GENERAL TASK INFO */ + struct gen_210 { + int tgid; /* threadgroup identification */ + int pid; /* process identification */ + int ppid; /* parent process identification*/ + int ruid; /* real user identification */ + int euid; /* eff. user identification */ + int suid; /* saved user identification */ + int fsuid; /* fs user identification */ + int rgid; /* real group identification */ + int egid; /* eff. group identification */ + int sgid; /* saved group identification */ + int fsgid; /* fs group identification */ + int nthr; /* number of threads in tgroup */ + char name[PNAMLEN+1];/* process name string */ + char isproc; /* boolean: process level? */ + char state; /* process state ('E' = exited) */ + int excode; /* process exit status */ + time_t btime; /* process start time (epoch) */ + time_t elaps; /* process elaps time (hertz) */ + char cmdline[CMDLEN+1];/* command-line string */ + int nthrslpi; /* # threads in state 'S' */ + int nthrslpu; /* # threads in state 'D' */ + int nthrrun; /* # threads in state 'R' */ + int nthridle; /* # threads in state 'I' */ + + int ctid; /* OpenVZ container ID */ + int vpid; /* OpenVZ virtual PID */ + + int wasinactive; /* boolean: task inactive */ + + char utsname[UTSLEN+1];/* UTS name container or pod */ + char cgpath[CGRLEN]; /* cgroup v2 path name */ + } gen; + + /* CPU STATISTICS */ + struct cpu_210 { + count_t utime; /* time user text (ticks) */ + count_t stime; /* time system text (ticks) */ + int nice; /* nice value */ + int prio; /* priority */ + int rtprio; /* realtime priority */ + int policy; /* scheduling policy */ + int curcpu; /* current processor */ + int sleepavg; /* sleep average percentage */ + int cgcpuweight; /* cgroup cpu.weight */ + int cgcpumax; /* cgroup cpu.max percentage */ + int cgcpumaxr; /* restrictive percentage */ + int ifuture[3]; /* reserved for future use */ + char wchan[16]; /* wait channel string */ + count_t rundelay; /* schedstat rundelay (nanosec) */ + count_t blkdelay; /* blkio delay (ticks) */ + count_t nvcsw; /* voluntary cxt switch counts */ + count_t nivcsw; /* involuntary csw counts */ + count_t cfuture[3]; /* reserved for future use */ + } cpu; + + /* DISK STATISTICS */ + struct dsk_210 { + count_t rio; /* number of read requests */ + count_t rsz; /* cumulative # sectors read */ + count_t wio; /* number of write requests */ + count_t wsz; /* cumulative # sectors written */ + count_t cwsz; /* cumulative # written sectors */ + /* being cancelled */ + count_t cfuture[4]; /* reserved for future use */ + } dsk; + + /* MEMORY STATISTICS */ + struct mem_210 { + count_t minflt; /* number of page-reclaims */ + count_t majflt; /* number of page-faults */ + count_t vexec; /* virtmem execfile (Kb) */ + count_t vmem; /* virtual memory (Kb) */ + count_t rmem; /* resident memory (Kb) */ + count_t pmem; /* resident memory (Kb) */ + count_t vgrow; /* virtual growth (Kb) */ + count_t rgrow; /* resident growth (Kb) */ + count_t vdata; /* virtmem data (Kb) */ + count_t vstack; /* virtmem stack (Kb) */ + count_t vlibs; /* virtmem libexec (Kb) */ + count_t vswap; /* swap space used (Kb) */ + count_t vlock; /* virtual locked (Kb) */ + count_t cgmemmax; /* cgroup memory.max (Kb) */ + count_t cgmemmaxr; /* restrictive memory.max (Kb) */ + count_t cgswpmax; /* cgroup memory.swap.max (Kb) */ + count_t cgswpmaxr; /* restrictive swap.max (Kb) */ + count_t cfuture[3]; /* reserved for future use */ + } mem; + + /* NETWORK STATISTICS */ + struct net_210 { + count_t tcpsnd; /* number of TCP-packets sent */ + count_t tcpssz; /* cumulative size packets sent */ + count_t tcprcv; /* number of TCP-packets recved */ + count_t tcprsz; /* cumulative size packets rcvd */ + count_t udpsnd; /* number of UDP-packets sent */ + count_t udpssz; /* cumulative size packets sent */ + count_t udprcv; /* number of UDP-packets recved */ + count_t udprsz; /* cumulative size packets sent */ + count_t avail1; /* */ + count_t avail2; /* */ + count_t cfuture[4]; /* reserved for future use */ + } net; + + struct gpu_210 { + char state; // A - active, E - Exit, '\0' - no use + char cfuture[3]; // + short nrgpus; // number of GPUs for this process + int32_t gpulist; // bitlist with GPU numbers + + int gpubusy; // gpu busy perc process lifetime -1 = n/a + int membusy; // memory busy perc process lifetime -1 = n/a + count_t timems; // milliseconds accounting -1 = n/a + // value 0 for active process, + // value > 0 after termination + + count_t memnow; // current memory consumption in KiB + count_t memcum; // cumulative memory consumption in KiB + count_t sample; // number of samples + } gpu; +}; diff --git a/prev/photosyst_20.h b/prev/photosyst_20.h index 6fe61291..380dfdb8 100644 --- a/prev/photosyst_20.h +++ b/prev/photosyst_20.h @@ -37,14 +37,14 @@ struct memstat_20 { struct netstat_20 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_21.h b/prev/photosyst_21.h index cd65be5b..c17468a1 100644 --- a/prev/photosyst_21.h +++ b/prev/photosyst_21.h @@ -47,14 +47,14 @@ struct memstat_21 { struct netstat_21 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_210.h b/prev/photosyst_210.h new file mode 100644 index 00000000..7ae4c65e --- /dev/null +++ b/prev/photosyst_210.h @@ -0,0 +1,427 @@ +#define MAXCPU_210 2048 +#define MAXDSK_210 1024 +#define MAXNUMA_210 1024 +#define MAXLVM_210 2048 +#define MAXMDD_210 256 +#define MAXINTF_210 128 +#define MAXCONTAINER_210 128 +#define MAXNFSMOUNT_210 64 +#define MAXIBPORT_210 32 +#define MAXGPU_210 32 +#define MAXGPUBUS_210 12 +#define MAXGPUTYPE_210 12 +#define MAXLLC_210 256 + +#define MAXDKNAM_210 32 +#define MAXIBNAME_210 12 + +/************************************************************************/ +struct memstat_210 { + count_t physmem; // number of physical pages + count_t freemem; // number of free pages + count_t buffermem; // number of buffer pages + count_t slabmem; // number of slab pages + count_t cachemem; // number of cache pages + count_t cachedrt; // number of cache pages (dirty) + + count_t totswap; // number of pages in swap + count_t freeswap; // number of free swap pages + + count_t pgscans; // number of page scans + count_t pgsteal; // number of page steals + count_t allocstall; // try to free pages forced + count_t swouts; // number of pages swapped out + count_t swins; // number of pages swapped in + count_t tcpsock; // number of pages allocated by TCP sockets + count_t udpsock; // number of pages allocated by UDP sockets + + count_t commitlim; // commit limit in pages + count_t committed; // number of reserved pages + + count_t shmem; // tot shmem incl. tmpfs (pages) + count_t shmrss; // resident shared memory (pages) + count_t shmswp; // swapped shared memory (pages) + + count_t slabreclaim; // reclaimable slab (pages) + + count_t stothugepage; // total huge pages (huge pages) - small + count_t sfreehugepage; // free huge pages (huge pages) - small + count_t shugepagesz; // huge page size (bytes) - small + + count_t vmwballoon; // vmware claimed balloon pages + count_t zfsarcsize; // zfsonlinux ARC size (pages) + count_t swapcached; // swap cache (pages) + count_t ksmsharing; // saved i.e. deduped memory (pages) + count_t ksmshared; // current size shared pages (pages) + count_t zswapped; // zswap stored pages decompressed (pages) + count_t zswap; // zswap current pool size compressed (pages) + count_t oomkills; // number of oom killings + count_t compactstall; // counter for process stalls + count_t pgmigrate; // counter for migrated successfully (pages) + count_t numamigrate; // counter for numa migrated (pages) + count_t pgouts; // total number of pages written to block device + count_t pgins; // total number of pages read from block device + count_t pagetables; // page tables of processes (pages) + + count_t zswouts; // number of pages swapped out to zswap + count_t zswins; // number of pages swapped in from zswap + + count_t ltothugepage; // total huge pages (huge pages) - large + count_t lfreehugepage; // free huge pages (huge pages) - large + count_t lhugepagesz; // huge page size (bytes) - large + + count_t availablemem; // available memory (pages) + + count_t anonhugepage; // anonymous transparent huge pages + // (in units of 'normal' pages) + + count_t cfuture[4]; // reserved for future use +}; + +/************************************************************************/ + +struct mempernuma_210 { + int numanr; + float frag; // fragmentation level for this numa + count_t totmem; // number of physical pages for this numa + count_t freemem; // number of free pages for this numa + count_t filepage; // number of file pages for this numa + count_t dirtymem; // number of cache pages (dirty) for this numa + count_t slabmem; // number of slab pages for this numa + count_t slabreclaim; // reclaimable slab (pages) for this numa + + count_t active; // number of pages used more recently for this numa + count_t inactive; // number of pages less recently used for this numa + + count_t shmem; // tot shmem incl. tmpfs (pages) for this numa + count_t tothp; // total huge pages (huge pages) for this numa + count_t freehp; // total free pages (huge pages) for this numa +}; + +struct memnuma_210 { + count_t nrnuma; /* the counts of numa */ + struct mempernuma_210 numa[MAXNUMA_210]; +}; + +struct cpupernuma_210 { + int numanr; + count_t nrcpu; // number of cpu's + count_t stime; // accumulate system time in clock ticks for per numa + count_t utime; // accumulate user time in clock ticks for per numa + count_t ntime; // accumulate nice time in clock ticks for per numa + count_t itime; // accumulate idle time in clock ticks for per numa + count_t wtime; // accumulate iowait time in clock ticks for per numa + count_t Itime; // accumulate irq time in clock ticks for per numa + count_t Stime; // accumulate softirq time in clock ticks for per numa + count_t steal; // accumulate steal time in clock ticks for per numa + count_t guest; // accumulate guest time in clock ticks for per numa +}; + +struct cpunuma_210 { + count_t nrnuma; /* the counts of numa */ + struct cpupernuma numa[MAXNUMA_210]; +}; + +/************************************************************************/ + +struct netstat_210 { + struct ipv4_stats ipv4; + struct icmpv4_stats icmpv4; + struct udpv4_stats udpv4; + + struct ipv6_stats ipv6; + struct icmpv6_stats icmpv6; + struct udpv6_stats udpv6; + + struct tcp_stats tcp; +}; + +/************************************************************************/ + +struct freqcnt_210 { + count_t maxfreq;/* frequency in MHz */ + count_t cnt; /* number of clock ticks times state */ + count_t ticks; /* number of total clock ticks */ + /* if zero, cnt is actual freq */ +}; + +struct percpu_210 { + int cpunr; + count_t stime; /* system time in clock ticks */ + count_t utime; /* user time in clock ticks */ + count_t ntime; /* nice time in clock ticks */ + count_t itime; /* idle time in clock ticks */ + count_t wtime; /* iowait time in clock ticks */ + count_t Itime; /* irq time in clock ticks */ + count_t Stime; /* softirq time in clock ticks */ + count_t steal; /* steal time in clock ticks */ + count_t guest; /* guest time in clock ticks */ + struct freqcnt_210 freqcnt;/* frequency scaling info */ + count_t instr; /* CPU instructions */ + count_t cycle; /* CPU cycles */ + count_t cfuture[6]; /* reserved for future use */ +}; + +struct cpustat_210 { + count_t nrcpu; /* number of cpu's */ + count_t devint; /* number of device interrupts */ + count_t csw; /* number of context switches */ + count_t nprocs; /* number of processes started */ + float lavg1; /* load average last minute */ + float lavg5; /* load average last 5 minutes */ + float lavg15; /* load average last 15 minutes */ + count_t cfuture[4]; /* reserved for future use */ + + struct percpu_210 all; + struct percpu_210 cpu[MAXCPU_210]; +}; + +/************************************************************************/ + +struct perdsk_210 { + char name[MAXDKNAM_210]; /* empty string for last */ + count_t nread; /* number of read transfers */ + count_t nrsect; /* number of sectors read */ + count_t nwrite; /* number of write transfers */ + count_t nwsect; /* number of sectors written */ + count_t io_ms; /* number of millisecs spent for I/O */ + count_t avque; /* average queue length */ + count_t ndisc; /* number of discards (-1 = unavailable)*/ + count_t ndsect; /* number of sectors discarded */ + count_t inflight; /* number of inflight I/O */ + count_t cfuture[3]; /* reserved for future use */ +}; + +struct dskstat_210 { + int ndsk; /* number of physical disks */ + int nmdd; /* number of md volumes */ + int nlvm; /* number of logical volumes */ + struct perdsk_210 dsk[MAXDSK_210]; + struct perdsk_210 mdd[MAXMDD_210]; + struct perdsk_210 lvm[MAXLVM_210]; +}; + +/************************************************************************/ + +struct perintf_210 { + char name[16]; /* empty string for last */ + + count_t rbyte; /* number of read bytes */ + count_t rpack; /* number of read packets */ + count_t rerrs; /* receive errors */ + count_t rdrop; /* receive drops */ + count_t rfifo; /* receive fifo */ + count_t rframe; /* receive framing errors */ + count_t rcompr; /* receive compressed */ + count_t rmultic;/* receive multicast */ + count_t rfuture[4]; /* reserved for future use */ + + count_t sbyte; /* number of written bytes */ + count_t spack; /* number of written packets */ + count_t serrs; /* transmit errors */ + count_t sdrop; /* transmit drops */ + count_t sfifo; /* transmit fifo */ + count_t scollis;/* collisions */ + count_t scarrier;/* transmit carrier */ + count_t scompr; /* transmit compressed */ + count_t sfuture[4]; /* reserved for future use */ + + char type; /* interface type ('e'/'w'/'v'/'?') */ + long speed; /* interface speed in megabits/second */ + long speedp; /* previous interface speed */ + char duplex; /* full duplex (boolean) */ + count_t cfuture[4]; /* reserved for future use */ +}; + +struct intfstat_210 { + int nrintf; + struct perintf_210 intf[MAXINTF_210]; +}; + +/************************************************************************/ + +struct pernfsmount_210 { + char mountdev[128]; /* mountdevice */ + count_t age; /* number of seconds mounted */ + + count_t bytesread; /* via normal reads */ + count_t byteswrite; /* via normal writes */ + count_t bytesdread; /* via direct reads */ + count_t bytesdwrite; /* via direct writes */ + count_t bytestotread; /* via reads */ + count_t bytestotwrite; /* via writes */ + count_t pagesmread; /* via mmap reads */ + count_t pagesmwrite; /* via mmap writes */ + + count_t future[8]; +}; + +struct nfsstat_210 { + struct { + count_t netcnt; + count_t netudpcnt; + count_t nettcpcnt; + count_t nettcpcon; + + count_t rpccnt; + count_t rpcbadfmt; + count_t rpcbadaut; + count_t rpcbadcln; + + count_t rpcread; + count_t rpcwrite; + + count_t rchits; /* repcache hits */ + count_t rcmiss; /* repcache misses */ + count_t rcnoca; /* uncached requests */ + + count_t nrbytes; /* read bytes */ + count_t nwbytes; /* written bytes */ + + count_t future[8]; + } server; + + struct { + count_t rpccnt; + count_t rpcretrans; + count_t rpcautrefresh; + + count_t rpcread; + count_t rpcwrite; + + count_t future[8]; + } client; + + struct { + int nrmounts; + struct pernfsmount_210 nfsmnt[MAXNFSMOUNT_210]; + } nfsmounts; +}; + +/************************************************************************/ +struct psi_210 { + float avg10; // average pressure last 10 seconds + float avg60; // average pressure last 60 seconds + float avg300; // average pressure last 300 seconds + count_t total; // total number of milliseconds +}; + +struct pressure_210 { + char present; /* pressure stats supported? */ + char future[3]; + struct psi_210 cpusome; /* pressure stall info 'some' */ + struct psi_210 memsome; /* pressure stall info 'some' */ + struct psi_210 memfull; /* pressure stall info 'full' */ + struct psi_210 iosome; /* pressure stall info 'some' */ + struct psi_210 iofull; /* pressure stall info 'full' */ +}; + +/************************************************************************/ + +struct percontainer_210 { + unsigned long ctid; /* container id */ + unsigned long numproc; /* number of processes */ + + count_t system; /* */ + count_t user; /* */ + count_t nice; /* */ + count_t uptime; /* */ + + count_t physpages; /* */ +}; + +struct contstat_210 { + int nrcontainer; + struct percontainer_210 cont[MAXCONTAINER_210]; +}; + +/************************************************************************/ +/* +** experimental stuff for access to local HTTP daemons +*/ +#define HTTPREQ "GET /server-status?auto HTTP/1.1\nHost: localhost\n\n" + +struct wwwstat_210 { + count_t accesses; /* total number of HTTP-requests */ + count_t totkbytes; /* total kbytes transfer for HTTP-req */ + count_t uptime; /* number of seconds since startup */ + int bworkers; /* number of busy httpd-daemons */ + int iworkers; /* number of idle httpd-daemons */ +}; + +/************************************************************************/ +struct pergpu_210 { + char taskstats; // GPU task statistics supported? + unsigned char nrprocs; // number of processes using GPU + char type[MAXGPUTYPE_210+1]; // GPU type + char busid[MAXGPUBUS_210+1]; // GPU bus identification + int gpunr; // GPU number + int gpupercnow; // processor percentage last second + // -1 if not supported + int mempercnow; // memory percentage last second + // -1 if not supported + count_t memtotnow; // total memory in KiB + count_t memusenow; // used memory in KiB + count_t samples; // number of samples + count_t gpuperccum; // cumulative processor busy percentage + // -1 if not supported + count_t memperccum; // cumulative memory percentage + // -1 if not supported + count_t memusecum; // cumulative used memory in KiB +}; + +struct gpustat_210 { + int nrgpus; // total number of GPUs + struct pergpu_210 gpu[MAXGPU_210]; +}; + +/************************************************************************/ +struct perifb_210 { + char ibname[MAXIBNAME_210]; // InfiniBand controller + short portnr; // InfiniBand controller port + + short lanes; // number of lanes (traffic factor) + count_t rate; // transfer rate in megabits/sec + count_t rcvb; // bytes received + count_t sndb; // bytes transmitted + count_t rcvp; // packets received + count_t sndp; // packets transmitted +}; + +struct ifbstat_210 { + int nrports; // total number of IB ports + struct perifb_210 ifb[MAXIBPORT_210]; +}; + +/************************************************************************/ +struct perllc_210 { + unsigned char id; + float occupancy; + count_t mbm_local; + count_t mbm_total; +}; + +struct llcstat_210 { + int nrllcs; // total number of LLC + struct perllc_210 perllc[MAXLLC_210]; +}; + +/************************************************************************/ + +struct sstat_210 { + struct cpustat_210 cpu; + struct memstat_210 mem; + struct netstat_210 net; + struct intfstat_210 intf; + struct memnuma_210 memnuma; + struct cpunuma_210 cpunuma; + struct dskstat_210 dsk; + struct nfsstat_210 nfs; + struct contstat_210 cfs; + struct pressure_210 psi; + struct gpustat_210 gpu; + struct ifbstat_210 ifb; + struct llcstat_210 llc; + + struct wwwstat_210 www; +}; diff --git a/prev/photosyst_22.h b/prev/photosyst_22.h index 1a4912ce..20d38030 100644 --- a/prev/photosyst_22.h +++ b/prev/photosyst_22.h @@ -49,14 +49,14 @@ struct memstat_22 { struct netstat_22 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_23.h b/prev/photosyst_23.h index fe091e65..ff8d87c4 100644 --- a/prev/photosyst_23.h +++ b/prev/photosyst_23.h @@ -49,14 +49,14 @@ struct memstat_23 { struct netstat_23 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_24.h b/prev/photosyst_24.h index e0b62284..a0395e5e 100644 --- a/prev/photosyst_24.h +++ b/prev/photosyst_24.h @@ -47,14 +47,14 @@ struct memstat_24 { struct netstat_24 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_25.h b/prev/photosyst_25.h index 82ba72c6..affde3eb 100644 --- a/prev/photosyst_25.h +++ b/prev/photosyst_25.h @@ -47,14 +47,14 @@ struct memstat_25 { struct netstat_25 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_26.h b/prev/photosyst_26.h index 7d6566dd..39b9c1c0 100644 --- a/prev/photosyst_26.h +++ b/prev/photosyst_26.h @@ -49,14 +49,14 @@ struct memstat_26 { struct netstat_26 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_27.h b/prev/photosyst_27.h index 34a97544..7ad65bce 100644 --- a/prev/photosyst_27.h +++ b/prev/photosyst_27.h @@ -104,14 +104,14 @@ struct cpunuma_27 { struct netstat_27 { struct ipv4_stats ipv4; - struct icmpv4_stats_wrong icmpv4; + struct icmpv4_stats_without_InCsumErrors icmpv4; struct udpv4_stats udpv4; struct ipv6_stats ipv6; struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_28.h b/prev/photosyst_28.h index abb12587..4ceee849 100644 --- a/prev/photosyst_28.h +++ b/prev/photosyst_28.h @@ -119,7 +119,7 @@ struct netstat_28 { struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ diff --git a/prev/photosyst_29.h b/prev/photosyst_29.h index a382781c..880d7520 100644 --- a/prev/photosyst_29.h +++ b/prev/photosyst_29.h @@ -119,7 +119,7 @@ struct netstat_29 { struct icmpv6_stats icmpv6; struct udpv6_stats udpv6; - struct tcp_stats tcp; + struct tcp_stats_without_InCsumErrors tcp; }; /************************************************************************/ @@ -280,7 +280,7 @@ struct nfsstat_29 { struct { int nrmounts; - struct pernfsmount nfsmnt[MAXNFSMOUNT_29]; + struct pernfsmount_29 nfsmnt[MAXNFSMOUNT_29]; } nfsmounts; }; diff --git a/version.h b/version.h index a5e0bbc7..6bdcd558 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #ifndef __ATOP_VERSION__ #define __ATOP_VERSION__ -#define ATOPVERS "2.9.0" +#define ATOPVERS "2.10.0" char *getstrvers(void); unsigned short getnumvers(void);