diff -Nru atop-2.6.0/acctproc.c atop-2.7.1/acctproc.c --- atop-2.6.0/acctproc.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/acctproc.c 2022-01-08 11:49:00.000000000 +0000 @@ -21,96 +21,6 @@ ** WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ** See the GNU General Public License for more details. -** -** $Log: acctproc.c,v $ -** Revision 1.28 2010/04/23 12:20:19 gerlof -** Modified mail-address in header. -** -** Revision 1.27 2009/12/12 10:12:01 gerlof -** Register and display end date and end time for process. -** -** Revision 1.26 2008/03/06 08:37:25 gerlof -** Register/show ppid of a process. -** -** Revision 1.25 2008/01/14 09:22:23 gerlof -** Support for environment variable ATOPACCT to specify the name of a -** particular process accouting file. -** -** Revision 1.24 2007/08/17 08:50:26 gerlof -** Verify if private accounting used before switching off accounting. -** -** Revision 1.23 2007/03/20 13:01:51 gerlof -** Introduction of variable supportflags. -** -** Revision 1.22 2007/02/13 09:14:49 gerlof -** New boolean introduced to indicate if accounting is active. -** -** Revision 1.21 2006/02/07 06:46:15 gerlof -** Removed swap-counter. -** -** Revision 1.20 2005/11/04 14:17:10 gerlof -** Improved recognition of certain version process accounting file. -** -** Revision 1.19 2005/10/31 12:44:58 gerlof -** Support account-record version 3 (used by Mandriva). -** -** Revision 1.18 2005/10/31 08:55:05 root -** *** empty log message *** -** -** Revision 1.17 2004/12/14 15:05:00 gerlof -** Implementation of patch-recognition for disk and network-statistics. -** -** Revision 1.16 2004/06/01 11:57:22 gerlof -** Consider other standard accounting-files, i.e. /var/account/pacct. -** -** Revision 1.15 2004/05/06 09:48:21 gerlof -** Ported to kernel-version 2.6. -** -** Revision 1.14 2003/07/07 09:26:15 gerlof -** Cleanup code (-Wall proof). -** -** Revision 1.13 2003/07/02 06:43:11 gerlof -** Modified include-file sys/acct.h to linux/acct.h to make it -** work on Alpha-based systems as well. -** -** Revision 1.12 2003/06/27 12:31:24 gerlof -** Adapt long to long long. -** -** Revision 1.11 2003/04/03 08:32:58 gerlof -** Cosmetic changes. -** -** Revision 1.10 2003/01/14 09:01:45 gerlof -** Small cosmetic changes. -** -** Revision 1.9 2002/10/03 11:12:03 gerlof -** Modify (effective) uid/gid to real uid/gid. -** -** Revision 1.8 2002/07/24 11:11:12 gerlof -** Redesigned to ease porting to other UNIX-platforms. -** -** Revision 1.7 2002/07/11 07:28:29 root -** Some additions related to secure accounting file handling -** -** Revision 1.6 2002/07/08 09:14:54 root -** Modified secure handling of accounting file -** (inspired by Tobias Rittweiler). -** -** Revision 1.5 2001/11/07 09:16:55 gerlof -** Allow users to run atop without process-accounting switched on. -** -** Revision 1.4 2001/10/16 06:15:52 gerlof -** Partly redesigned. -** -** Revision 1.3 2001/10/04 13:02:24 gerlof -** Redesign of the way to determine how many atop's are using process-accounting -** on basis of semaphores. -** -** Revision 1.2 2001/10/04 08:46:46 gerlof -** Improved verification of kernel-symbol addresses -** -** Revision 1.1 2001/10/02 10:38:35 gerlof -** Initial revision -** */ #define _FILE_OFFSET_BITS 64 @@ -153,14 +63,20 @@ static void acctrestarttrial(); static void switchshadow(void); +/* +** possible process accounting files used by (ps)acct package +*/ struct pacctadm { char *name; struct stat stat; } pacctadm[] = { { "/var/log/pacct", {0, }, }, - { "/var/account/pacct", {0, }, } + { "/var/account/pacct", {0, }, }, + { "/var/log/account/pacct", {0, }, } }; +struct pacctadm *pacctcur; // pointer to entry in use + /* ** Semaphore-handling ** @@ -394,6 +310,9 @@ } supportflags |= ACCTACTIVE; + + pacctcur = &pacctadm[i]; // register current + return 0; } } @@ -754,7 +673,10 @@ ** process accounting file */ { - if (acctsize > statacc.st_size) /* accounting reset? */ + /* + ** accounting reset? + */ + if (acctsize > statacc.st_size) { /* ** reposition to start of file @@ -763,6 +685,28 @@ acctsize = 0; } + /* + ** using account file managed by (ps)acct package? + */ + if (pacctcur) + { + /* + ** check inode of the current file and compare this + ** with the inode of the opened file; if not equal, + ** a file rotation has taken place and the size of + ** the new file has to be added + */ + if ( stat(pacctcur->name, &(pacctcur->stat)) == 0) + { + if (statacc.st_ino != pacctcur->stat.st_ino) + { + return (statacc.st_size - acctsize + + pacctcur->stat.st_size) / + acctrecsz; + } + } + } + return (statacc.st_size - acctsize) / acctrecsz; } } @@ -799,7 +743,49 @@ ** just reposition to skip superfluous records */ (void) lseek(acctfd, noverflow * acctrecsz, SEEK_CUR); - acctsize += noverflow * acctrecsz; + acctsize += noverflow * acctrecsz; + + /* + ** when the new seek pointer is beyond the current file size + ** and reading from a process accounting file written by + ** the (ps)acct package, a logrotation might have taken place + */ + if (pacctcur) + { + struct stat statacc; + + /* + ** determine the size of the current accounting file + */ + if (fstat(acctfd, &statacc) == -1) + return; + + /* + ** seek pointer beyond file size and rotated to + ** new account file? + */ + if (acctsize > statacc.st_size && + statacc.st_ino != pacctcur->stat.st_ino) + { + /* + ** - close old file + ** - open new file + ** - adapt acctsize to actual offset in new file + ** and seek to that offset + */ + (void) close(acctfd); + + if ( (acctfd = open(pacctcur->name, + O_RDONLY) ) == -1) + return; // open failed + + acctsize = acctsize - statacc.st_size; + (void) lseek(acctfd, acctsize, SEEK_SET); + + if (fstat(acctfd, &statacc) == -1) + return; // no new inode info + } + } } } @@ -825,7 +811,6 @@ /* ** determine the size of the (current) account file - ** and the current offset within that file */ if (fstat(acctfd, &statacc) == -1) return 0; @@ -855,6 +840,37 @@ } /* + ** in case of account file managed by (ps)acct package, + ** be aware that a switch to a newer logfile might have + ** to be done + */ + if (pacctcur && acctsize >= statacc.st_size) + { + /* + ** check inode of the current file and compare this + ** with the inode of the opened file; if not equal, + ** a file rotation has taken place and the file + ** has to be reopened + */ + if ( stat(pacctcur->name, &(pacctcur->stat)) == 0) + { + if (statacc.st_ino != pacctcur->stat.st_ino) + { + (void) close(acctfd); + + if ( (acctfd = open(pacctcur->name, + O_RDONLY) ) == -1) + return 0; // open failed + + if (fstat(acctfd, &statacc) == -1) + return 0; // no new inode info + + acctsize = 0; // reset size new file + } + } + } + + /* ** read the next record */ switch (acctversion) diff -Nru atop-2.6.0/atopacctd.h atop-2.7.1/atopacctd.h --- atop-2.6.0/atopacctd.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atopacctd.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,32 @@ /* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ + +/* ** keys to access the semaphores */ #define PACCTPUBKEY 1071980 // # clients using shadow files diff -Nru atop-2.6.0/atopacct.init atop-2.7.1/atopacct.init --- atop-2.6.0/atopacct.init 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atopacct.init 2022-01-08 11:49:00.000000000 +0000 @@ -25,9 +25,9 @@ # See how we were called. case "$1" in start) - # Check if process accounting already in use via psacct + # Check if process accounting already in use via separate psacct package # - for PACCTFILE in /var/account/pacct /var/log/pacct + for PACCTFILE in /var/account/pacct /var/log/pacct /var/log/account/pacct do if [ -f "$PACCTFILE" ] # file exists? then diff -Nru atop-2.6.0/atop.c atop-2.7.1/atop.c --- atop-2.6.0/atop.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atop.c 2022-01-08 11:49:00.000000000 +0000 @@ -321,6 +321,8 @@ char threadview = 0; /* boolean: show individual threads */ char calcpss = 0; /* boolean: read/calculate process PSS */ char getwchan = 0; /* boolean: obtain wchan string */ +char rmspaces = 0; /* boolean: remove spaces from command */ + /* name in case of parseable output */ unsigned short hertz; unsigned int pagesize; @@ -363,6 +365,7 @@ void do_maxifb(char *, char *); void do_maxnfsm(char *, char *); void do_maxcont(char *, char *); +void do_maxnuma(char *, char *); void do_colinfo(char *, char *); void do_colalmost(char *, char *); void do_colcrit(char *, char *); @@ -374,6 +377,8 @@ void do_ownmemline(char *, char *); void do_ownswpline(char *, char *); void do_ownpagline(char *, char *); +void do_ownmemnumaline(char *, char *); +void do_owncpunumaline(char *, char *); void do_owndskline(char *, char *); void do_ownnettransportline(char *, char *); void do_ownnetnetline(char *, char *); @@ -411,6 +416,7 @@ { "maxlineifb", do_maxifb, 0, }, { "maxlinenfsm", do_maxnfsm, 0, }, { "maxlinecont", do_maxcont, 0, }, + { "maxlinenuma", do_maxnuma, 0, }, { "colorinfo", do_colinfo, 0, }, { "coloralmost", do_colalmost, 0, }, { "colorcritical", do_colcrit, 0, }, @@ -421,6 +427,8 @@ { "ownmemline", do_ownmemline, 0, }, { "ownswpline", do_ownswpline, 0, }, { "ownpagline", do_ownpagline, 0, }, + { "ownmemnumaline", do_ownmemnumaline, 0, }, + { "ownnumacpuline", do_owncpunumaline, 0, }, { "owndskline", do_owndskline, 0, }, { "ownnettrline", do_ownnettransportline, 0, }, { "ownnetnetline", do_ownnetnetline, 0, }, @@ -594,6 +602,10 @@ getwchan = 1; break; + case MRMSPACES: /* remove spaces from command */ + rmspaces = 1; + break; + default: /* gather other flags */ flaglist[i++] = c; } @@ -1071,6 +1083,8 @@ MCALCPSS); printf("\t -%c determine WCHAN (string) per thread\n", MGETWCHAN); printf("\t -P generate parseable output for specified label(s)\n"); + printf("\t -%c no spaces in parseable output for command (line)\n", + MRMSPACES); printf("\t -L alternate line length (default 80) in case of " "non-screen output\n"); diff -Nru atop-2.6.0/atopconvert.c atop-2.7.1/atopconvert.c --- atop-2.6.0/atopconvert.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atopconvert.c 2022-01-08 11:49:00.000000000 +0000 @@ -11,7 +11,7 @@ ** E-mail: gerlof.langeveld@atoptool.nl ** Initial: July/August 2018 ** -------------------------------------------------------------------------- -** Copyright (C) 2018-2020 Gerlof Langeveld +** Copyright (C) 2018-2021 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 @@ -74,6 +74,9 @@ #include "prev/photosyst_26.h" #include "prev/photoproc_26.h" +#include "prev/photosyst_27.h" +#include "prev/photoproc_27.h" + /////////////////////////////////////////////////////////////// // Conversion functions @@ -105,9 +108,10 @@ memcpy(new, old, newsize > oldsize ? oldsize : newsize); } +// ///////////////////////////////////////////////////////////////// // Specific functions that convert an old sstat sub-structure to // a new sub-structure (system level) -// +// ///////////////////////////////////////////////////////////////// void scpu_to_21(void *old, void *new, count_t oldsize, count_t newsize) { @@ -168,9 +172,56 @@ } } +void +scpu_to_27(void *old, void *new, count_t oldsize, count_t newsize) +{ + // cfuture[2] --> cfuture[4] in struct percpu + // + struct cpustat_26 *c26 = old; + struct cpustat_27 *c27 = new; + int i; + + memcpy(c27, c26, (char *)&c26->all - (char *)c26); // base values + memcpy(&c27->all, &c26->all, sizeof(struct percpu_26)); + + for (i=0; i < MAXCPU_26; i++) + memcpy( &(c27->cpu[i]), &(c26->cpu[i]), sizeof(struct percpu_26)); +} + +void +smem_to_27(void *old, void *new, count_t oldsize, count_t newsize) +{ + struct memstat_26 *m26 = old; + struct memstat_27 *m27 = new; + + memcpy(m27, m26, sizeof *m26); + + m27->oomkills = -1; // explicitly define 'unused' +} + +void +sdsk_to_27(void *old, void *new, count_t oldsize, count_t newsize) +{ + struct dskstat_26 *d26 = old; + struct dskstat_27 *d27 = new; + int i; + + memcpy(d27, d26, oldsize); + + for (i=0; i < d27->ndsk; i++) + d27->dsk[i].ndisc = -1; // explicitly define 'unused' + + for (i=0; i < d27->nmdd; i++) + d27->mdd[i].ndisc = -1; // explicitly define 'unused' + + for (i=0; i < d27->nlvm; i++) + d27->lvm[i].ndisc = -1; // explicitly define 'unused' +} + +// ///////////////////////////////////////////////////////////////// // Specific functions that convert an old tstat sub-structure to // a new sub-structure (process level) -// +// ///////////////////////////////////////////////////////////////// void tgen_to_21(void *old, void *new, count_t oldsize, count_t newsize) { @@ -245,6 +296,7 @@ m26->vlock = 0; } + /////////////////////////////////////////////////////////////// // conversion definition for various structs in sstat and tstat // @@ -270,6 +322,7 @@ struct sstat_24 sstat_24; struct sstat_25 sstat_25; struct sstat_26 sstat_26; +struct sstat_27 sstat_27; struct sstat sstat; struct tstat_20 tstat_20; @@ -279,6 +332,7 @@ struct tstat_24 tstat_24; struct tstat_25 tstat_25; struct tstat_26 tstat_26; +struct tstat_27 tstat_27; struct tstat tstat; struct convertall { @@ -302,6 +356,8 @@ struct sconvstruct spsi; struct sconvstruct sgpu; struct sconvstruct sifb; + struct sconvstruct smnum; + struct sconvstruct scnum; // conversion definition for subparts within tstat struct tconvstruct tgen; @@ -327,6 +383,8 @@ {0, NULL, NULL}, {0, NULL, NULL}, {0, NULL, NULL}, + {0, NULL, NULL}, + {0, NULL, NULL}, {sizeof(struct gen_20), STROFFSET(&tstat_20.gen, &tstat_20), NULL}, @@ -356,6 +414,8 @@ {0, NULL, NULL}, {0, NULL, NULL}, {0, NULL, NULL}, + {0, NULL, NULL}, + {0, NULL, NULL}, {sizeof(struct gen_21), STROFFSET(&tstat_21.gen, &tstat_21), tgen_to_21}, @@ -385,6 +445,8 @@ {0, NULL, NULL}, {0, NULL, NULL}, {0, NULL, NULL}, + {0, NULL, NULL}, + {0, NULL, NULL}, {sizeof(struct gen_22), STROFFSET(&tstat_22.gen, &tstat_22), tgen_to_22}, @@ -414,6 +476,8 @@ {0, NULL, NULL}, {0, NULL, NULL}, {0, NULL, NULL}, + {0, NULL, NULL}, + {0, NULL, NULL}, {sizeof(struct gen_23), STROFFSET(&tstat_23.gen, &tstat_23), justcopy}, @@ -443,6 +507,8 @@ {0, &sstat_24.psi, NULL}, {0, &sstat_24.gpu, NULL}, {0, &sstat_24.ifb, NULL}, + {0, NULL, NULL}, + {0, NULL, NULL}, {sizeof(struct gen_24), STROFFSET(&tstat_24.gen, &tstat_24), justcopy}, @@ -473,6 +539,8 @@ {sizeof(struct pressure_25), &sstat_25.psi, justcopy}, {sizeof(struct gpustat_25), &sstat_25.gpu, justcopy}, {sizeof(struct ifbstat_25), &sstat_25.ifb, justcopy}, + {0, NULL, NULL}, + {0, NULL, NULL}, {sizeof(struct gen_25), STROFFSET(&tstat_25.gen, &tstat_25), justcopy}, @@ -503,6 +571,8 @@ {sizeof(struct pressure_26), &sstat_26.psi, justcopy}, {sizeof(struct gpustat_26), &sstat_26.gpu, justcopy}, {sizeof(struct ifbstat_26), &sstat_26.ifb, justcopy}, + {0, NULL, NULL}, + {0, NULL, NULL}, {sizeof(struct gen_26), STROFFSET(&tstat_26.gen, &tstat_26), justcopy}, @@ -517,6 +587,38 @@ {sizeof(struct gpu_26), STROFFSET(&tstat_26.gpu, &tstat_26), justcopy}, }, + + {SETVERSION(2,7), // 2.6 --> 2.7 + sizeof(struct sstat_27), &sstat_27, + sizeof(struct tstat_27), NULL, + + {sizeof(struct cpustat_27), &sstat_27.cpu, scpu_to_27}, + {sizeof(struct memstat_27), &sstat_27.mem, smem_to_27}, + {sizeof(struct netstat_27), &sstat_27.net, justcopy}, + {sizeof(struct intfstat_27), &sstat_27.intf, justcopy}, + {sizeof(struct dskstat_27), &sstat_27.dsk, sdsk_to_27}, + {sizeof(struct nfsstat_27), &sstat_27.nfs, justcopy}, + {sizeof(struct contstat_27), &sstat_27.cfs, justcopy}, + {sizeof(struct wwwstat_27), &sstat_27.www, justcopy}, + {sizeof(struct pressure_27), &sstat_27.psi, justcopy}, + {sizeof(struct gpustat_27), &sstat_27.gpu, justcopy}, + {sizeof(struct ifbstat_27), &sstat_27.ifb, justcopy}, + {0, &sstat_27.memnuma, NULL}, + {0, &sstat_27.cpunuma, NULL}, + + {sizeof(struct gen_27), + STROFFSET(&tstat_27.gen, &tstat_27), justcopy}, + {sizeof(struct cpu_27), + STROFFSET(&tstat_27.cpu, &tstat_27), justcopy}, + {sizeof(struct dsk_27), + STROFFSET(&tstat_27.dsk, &tstat_27), justcopy}, + {sizeof(struct mem_27), + STROFFSET(&tstat_27.mem, &tstat_27), justcopy}, + {sizeof(struct net_27), + STROFFSET(&tstat_27.net, &tstat_27), justcopy}, + {sizeof(struct gpu_27), + STROFFSET(&tstat_27.gpu, &tstat_27), justcopy}, + }, }; int numconvs = sizeof convs / sizeof(struct convertall); @@ -768,17 +870,19 @@ // memset(convs[i+1].sstat, 0, convs[i+1].sstatlen); - do_sconvert(&(convs[i].scpu), &(convs[i+1].scpu)); - do_sconvert(&(convs[i].smem), &(convs[i+1].smem)); - do_sconvert(&(convs[i].snet), &(convs[i+1].snet)); - do_sconvert(&(convs[i].sintf), &(convs[i+1].sintf)); - do_sconvert(&(convs[i].sdsk), &(convs[i+1].sdsk)); - do_sconvert(&(convs[i].snfs), &(convs[i+1].snfs)); - do_sconvert(&(convs[i].scfs), &(convs[i+1].scfs)); - do_sconvert(&(convs[i].spsi), &(convs[i+1].spsi)); - do_sconvert(&(convs[i].sgpu), &(convs[i+1].sgpu)); - do_sconvert(&(convs[i].sifb), &(convs[i+1].sifb)); - do_sconvert(&(convs[i].swww), &(convs[i+1].swww)); + do_sconvert(&(convs[i].scpu), &(convs[i+1].scpu)); + do_sconvert(&(convs[i].smem), &(convs[i+1].smem)); + do_sconvert(&(convs[i].snet), &(convs[i+1].snet)); + do_sconvert(&(convs[i].sintf), &(convs[i+1].sintf)); + do_sconvert(&(convs[i].sdsk), &(convs[i+1].sdsk)); + do_sconvert(&(convs[i].snfs), &(convs[i+1].snfs)); + do_sconvert(&(convs[i].scfs), &(convs[i+1].scfs)); + do_sconvert(&(convs[i].spsi), &(convs[i+1].spsi)); + do_sconvert(&(convs[i].sgpu), &(convs[i+1].sgpu)); + do_sconvert(&(convs[i].sifb), &(convs[i+1].sifb)); + do_sconvert(&(convs[i].smnum), &(convs[i+1].smnum)); + do_sconvert(&(convs[i].scnum), &(convs[i+1].scnum)); + do_sconvert(&(convs[i].swww), &(convs[i+1].swww)); // convert process-level statistics to newer version // diff -Nru atop-2.6.0/atopgpud atop-2.7.1/atopgpud --- atop-2.6.0/atopgpud 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atopgpud 2022-01-08 11:49:00.000000000 +0000 @@ -24,6 +24,22 @@ # -------------------------------------------------------------- # Author: Gerlof Langeveld # Date: July 2018 (initial) +# +# Copyright (C) 2018 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 +# Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ============================================================== import os diff -Nru atop-2.6.0/atop.h atop-2.7.1/atop.h --- atop-2.6.0/atop.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atop.h 2022-01-08 11:49:00.000000000 +0000 @@ -28,13 +28,18 @@ /* ** memory-size formatting possibilities */ -#define ANYFORMAT 0 +#define BFORMAT 0 #define KBFORMAT 1 -#define MBFORMAT 2 -#define GBFORMAT 3 -#define TBFORMAT 4 -#define PBFORMAT 5 -#define OVFORMAT 9 +#define KBFORMAT_INT 2 +#define MBFORMAT 3 +#define MBFORMAT_INT 4 +#define GBFORMAT 5 +#define GBFORMAT_INT 6 +#define TBFORMAT 7 +#define TBFORMAT_INT 8 +#define PBFORMAT 9 +#define PBFORMAT_INT 10 +#define OVFORMAT 11 typedef long long count_t; @@ -83,6 +88,7 @@ extern char getwchan; extern char rawname[]; extern char rawreadflag; +extern char rmspaces; extern time_t begintime, endtime, cursortime; // epoch or time in day extern char flaglist[]; extern struct visualize vis; @@ -164,8 +170,9 @@ int ifbcompar(const void *, const void *); int nfsmcompar(const void *, const void *); int contcompar(const void *, const void *); +int memnumacompar(const void *, const void *); +int cpunumacompar(const void *, const void *); -count_t subcount(count_t, count_t); int rawread(void); char rawwrite (time_t, int, struct devtstat *, struct sstat *, diff -Nru atop-2.6.0/atopsar.c atop-2.7.1/atopsar.c --- atop-2.6.0/atopsar.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atopsar.c 2022-01-08 11:49:00.000000000 +0000 @@ -1484,9 +1484,9 @@ unsigned int mbadness, sbadness; if (membadness) - mbadness = ((ss->mem.physmem - ss->mem.freemem - - ss->mem.cachemem - ss->mem.buffermem) - * 100.0 / ss->mem.physmem) + mbadness = ((ss->mem.physmem - ss->mem.freemem + - ss->mem.cachemem - ss->mem.buffermem + + ss->mem.shmem) * 100.0 / ss->mem.physmem) * 100 / membadness; else mbadness = 0; @@ -1521,7 +1521,7 @@ static void swaphead(int osvers, int osrel, int ossub) { - printf("pagescan/s swapin/s swapout/s " + printf("pagescan/s swapin/s swapout/s oomkill" " commitspc commitlim _swap_"); } @@ -1552,10 +1552,11 @@ preprint(badness); - printf("%10.2lf %9.2lf %9.2lf %9lluM %9lluM", + printf("%10.2lf %9.2lf %9.2lf %7lld %9lluM %9lluM", (double)ss->mem.pgscans / deltasec, (double)ss->mem.swins / deltasec, (double)ss->mem.swouts / deltasec, + ss->mem.oomkills, ss->mem.committed * (pagesize / 1024) / 1024, ss->mem.commitlim * (pagesize / 1024) / 1024); @@ -1695,8 +1696,10 @@ char *pn; int len; - if ( (iotot = dp->nread + dp->nwrite) == 0 && - !firstcall && !allresources ) + iotot = dp->nread + dp->nwrite + + (dp->ndisc != -1 ? dp->ndisc : 0); + + if (iotot == 0 && !firstcall && !allresources) continue; /* no activity on this disk */ /* @@ -1921,12 +1924,12 @@ continue; /* - ** convert byte-transfers to bit-transfers (* 8) - ** convert bit-transfers to megabit-transfers (/ 1000000) + ** convert byte-transfers to bit-transfers (* 8) + ** convert bit-transfers to gigabit-transfers (/ 1000000000) ** per second */ - ival = ss->ifb.ifb[i].rcvb*ss->ifb.ifb[i].lanes/125000/deltasec; - oval = ss->ifb.ifb[i].sndb*ss->ifb.ifb[i].lanes/125000/deltasec; + ival = ss->ifb.ifb[i].rcvb*ss->ifb.ifb[i].lanes/125000000/deltasec; + oval = ss->ifb.ifb[i].sndb*ss->ifb.ifb[i].lanes/125000000/deltasec; /* ** calculate busy-percentage for port @@ -2853,7 +2856,7 @@ {0, "n", 't', tcphead, tcpline, "tcp (general)", }, {0, "n", 'T', TCPhead, TCPline, "tcp (errors)", }, #if HTTPSTATS - {0, "n", 'h', httphead, httpline, "HTTP activity", }, + {0, "n", 'o', httphead, httpline, "HTTP activity", }, #endif {0, "", 'O', topchead, topcline, "top-3 processes cpu", }, {0, "", 'G', topmhead, topmline, "top-3 processes memory", }, diff -Nru atop-2.6.0/atop.service atop-2.7.1/atop.service --- atop-2.6.0/atop.service 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/atop.service 2022-01-08 11:49:00.000000000 +0000 @@ -3,10 +3,11 @@ Documentation=man:atop(1) [Service] -Environment=LOGOPTS="" -Environment=LOGINTERVAL=600 -Environment=LOGGENERATIONS=28 -Environment=LOGPATH=/var/log/atop +Type=simple +Environment="LOGOPTS=" +Environment="LOGINTERVAL=600" +Environment="LOGGENERATIONS=28" +Environment="LOGPATH=/var/log/atop" EnvironmentFile=/etc/default/atop ExecStartPre=/bin/sh -c 'test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"' ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"' diff -Nru atop-2.6.0/ChangeLog atop-2.7.1/ChangeLog --- atop-2.6.0/ChangeLog 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/ChangeLog 2022-01-08 11:49:00.000000000 +0000 @@ -1,371 +1,373 @@ -commit 462cc2ba23dfb0e36d41c6ff2e04f4c67f8aa0bc +commit 115b355cb52eee4b11ce00e5b01decde37796e90 Author: Gerlof Langeveld -Date: Mon Dec 21 20:38:17 2020 +0100 +Date: Wed Jan 5 19:12:27 2022 +0100 - Set new process-related fields to zero during conversion + Explicit type definition in atop.service (issue #180) -M atopconvert.c +M atop.service -commit 2b674f9d7c58f5e58d52b3416e3504f4c97741e2 +commit 9afc5ad3d714ea09f9ffdebd79b345fe223c7e20 Author: Gerlof Langeveld -Date: Mon Dec 21 19:58:56 2020 +0100 +Date: Wed Jan 5 18:54:21 2022 +0100 - Added -Wno-stringop-truncation to CFLAGS. - Avoid warnings about truncating command strings with gcc version 8. + Correct disk stats in atopsar (issue #182) + A wrong disk report is shown with the -d/-l/-f flags. + When the kernel supports the discard counter per disk, + output lines are empty in the disk report. + When the kernel doesnot support the discard counter per disk, + output lines often show a negative value for for the average + access time (avserv). -M Makefile +M atopsar.c -commit 008f86b758514ac747b506a12a2196e4ba5e7ef1 +commit ffb30c62ad5a3e7844d3d9004c174af58eb3dc60 Author: Gerlof Langeveld -Date: Sat Dec 19 16:38:18 2020 +0100 +Date: Sat Jan 1 14:37:18 2022 +0100 - Avoid warnings with gcc 8 + Add information about service activation to README file -M atopacctd.c -M rawlog.c -M showsys.c +M README -commit 1bc1a03e5f88b5a11899876a752c3a83fbb671c4 +commit fdf3526bd35c1a84dd11bb73110c1a1f4148e39d Author: Gerlof Langeveld -Date: Sat Dec 19 15:06:35 2020 +0100 +Date: Fri Dec 31 11:25:13 2021 +0100 - Typo corrected. + Add directory to .gitignore -M rpmspec/atop.specsystemd +M .gitignore -commit 6ca80e13b074523f46516c5fef6414968f06db9f +commit 5dbe750eca1e468694dc4d4d0d251a485f58ad74 Author: Gerlof Langeveld -Date: Sat Dec 19 14:58:56 2020 +0100 +Date: Fri Dec 31 11:25:04 2021 +0100 - Update date in man pages. + Clarify relation between atop/atopacctd in man page M man/atop.1 -M man/atopacctd.8 -M man/atopcat.1 -M man/atopconvert.1 -M man/atopgpud.8 -M man/atoprc.5 -M man/atopsar.1 -commit 5f8e318def6882c866d3820cf608b6157afba767 +commit 1b4f7d6d2e14e768f310fc6041c05c5dcc69cee7 Author: Gerlof Langeveld -Date: Sat Dec 19 14:48:45 2020 +0100 +Date: Fri Dec 31 11:24:00 2021 +0100 - Prepare atop version 2.6 + Added license info -M version.h +M atopgpud +M netlink.c -commit e22eefa8b1e8a2064787a8ac9a4e7647fc2ff247 +commit a67368badc8b639f23268e636a1a3d8787ee90c5 Author: Gerlof Langeveld -Date: Sat Dec 19 14:45:24 2020 +0100 +Date: Fri Dec 31 11:23:18 2021 +0100 - Support file format of atop 2.6 + Added generic license info to README #179 -M atopconvert.c -A prev/photoproc_26.h -A prev/photosyst_26.h +M README -commit 8e2b5fbe5f853cabfe01f2be3860c84a1715d543 +commit c427419d975bd94f452aeabf5df0a5d4a6be241b Author: Gerlof Langeveld -Date: Sat Dec 5 11:12:12 2020 +0100 +Date: Sat Dec 18 11:24:21 2021 +0100 - Avoid error when stopping a stopped daemon (issue #139) - The -f flag has been added to the rm command to avoid an error - message when trying to stop a daemon that is not active. - -M atop.init -M atopacct.init - -commit 23642fcdac1fca9bddcb8cbcc2a443a18b2416d3 -Merge: af71985 ebc2fe4 -Author: Gerlof Langeveld -Date: Sat Nov 21 13:00:25 2020 +0100 + Switch to version 2.7 - Merge branch 'threadsort' +M version.h -commit ebc2fe442aa5de14974a2ccd78ead83719196c1f +commit 81b71b0791755dc73ba5fafdee6211090c5e0d93 Author: Gerlof Langeveld -Date: Sat Nov 21 12:56:58 2020 +0100 +Date: Sat Dec 18 11:21:12 2021 +0100 - Sort threads per process in threadview (option 'Y') - Threads per process (threadview) will be sorted according - to the current sort criterium when the 'Y' option is active. + Describe (un)restricted view in first screen M man/atop.1 -M man/atoprc.5 M showgeneric.c -M showgeneric.h -commit af7198583b27800f541464617902fcb7cc637f8e +commit b027bbaa29bb6403789840a03c8dbf22469c2ed3 Author: Gerlof Langeveld -Date: Sat Nov 7 11:16:43 2020 +0100 +Date: Sat Dec 18 11:17:39 2021 +0100 - Explicitly refer to python3 instead of python - Specifically needed for CentOS8 that only knows about python2 and python3. + Modified behavior of "make install" + Run "make install" to install atop on a systemd-based system and + run "make sysvinstall" to install atop on a system V based system. -M atopgpud -M rpmspec/atop.specsystemd +M Makefile +M README -commit 16aaba85e16b5e564362c9c6f109480632fd8313 +commit b1ada7e250ec910dcf63955e6a7ee91ffe4877c8 Author: Gerlof Langeveld -Date: Sat Oct 24 12:27:43 2020 +0200 +Date: Sat Dec 18 10:46:25 2021 +0100 - Additional fields for parseable output with label NET - The most important (error) counters related to TCP and UDP - have been added to the parseable output with label NET. - Solves issue #98 + Cosmetic change -M man/atop.1 -M parseable.c +M ifprop.c -commit 14c0e5c751f1cd00b7191a5a355199daf11e0ef7 +commit 0efb2365bbefb57a8987ddb3f0da42f8bed1a941 Author: Gerlof Langeveld -Date: Sat Oct 24 11:27:35 2020 +0200 +Date: Fri Dec 17 23:04:12 2021 +0100 - Correct man page of atop: parseable output for label PRD - The obsoleted value 'n' (one but last value) was not described - in the man page. This has been added now. Solves issue #136 + Determine (un)restricted view by verifying suid instead of euid. -M man/atop.1 +M showgeneric.c -commit 7760d5902451abbb52e45222b07af7667a806163 +commit 154ca1cd1b0fc5cea5c61fa5c5ebfb7a7a785067 Author: Gerlof Langeveld -Date: Sat Oct 24 11:06:35 2020 +0200 +Date: Thu Dec 16 22:13:24 2021 +0100 - Issue garbage collection, even when system clock modified - Even when the system clock (epoch) is decreased, garbare collection - should continue to avoid that too many shadow files will occupy - disk space. Solves issue #132 + Do not ignore unknown network interface -M atopacctd.c +M ifprop.c -commit 25c6d641e3b6c4f424003d70b40b0239c0c2b10b +commit 65832bf7b3c7c35f44e7e0461b33b01f1eff449e Author: Gerlof Langeveld -Date: Sat Oct 3 12:32:17 2020 +0200 +Date: Thu Dec 16 22:05:18 2021 +0100 - Size of swap cache added to SWP row (issue #117) + Parseable output: optionally exchange spaces in command and command line + When the -Z flag is combined with the -P... flag, the spaces in the + command and command line in the parseable output are exchanged by + underscores and the parenthesis are suppressed to ease space-based + parsing. -M deviate.c +M atop.c +M atop.h M man/atop.1 M parseable.c -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c +M showgeneric.h -commit 90fdd81607461095d7b42525d4924c18b513cd06 +commit ab1fbc012bc7e33594ce84c845a2cb43c5edd757 Author: Gerlof Langeveld -Date: Sat Oct 3 11:25:29 2020 +0200 +Date: Tue Dec 14 16:25:20 2021 +0100 - Show PPID for terminated processes (solves issue #120). - When the format of the process accounting record provides the PPID, - it should also be shown in the various info (key 'v'). + No setuid by default -M showprocs.c +M rpmspec/atop.specsystemd -commit 27dbe4e17634e58fdca5930e8cf2c2e06cd40821 +commit da9d8a9885e044897bc6f8445974eebf4e6ab20b Author: Gerlof Langeveld -Date: Sat Aug 29 11:50:17 2020 +0200 +Date: Mon Dec 13 19:53:53 2021 +0100 - When atopacctd restarts, it recreates the shadow directory - When atopacctd is killed and restarted afterwards, the shadow directory - /var/run/pacct_shadow.d still exists. The old directory will be renamed - to a unique name (containing the PID of the running atopacctd) because - files from this directory might still be opened by running atop processes. - After that, a new directory will be created without intervention. - Solved issue #121 + Correct conversion to 2.7 raw files -M atopacctd.c +M atopconvert.c +M deviate.c +M photosyst.c -commit 8c6b556a60048beafa40547dee1eff90ed728e79 +commit b35b9be1233a2d380c0093c645ff4b2e44e38b86 Author: Gerlof Langeveld -Date: Tue Aug 11 07:58:45 2020 +0200 +Date: Mon Dec 13 18:54:40 2021 +0100 - Skip empty lines in atoprc file + Corrected type -M atop.c -M atopsar.c -M various.c +M man/atop.1 -commit 4a215076767b4198a87dace45bdfd976d1da9c9f -Merge: 678431f 93877ad +commit c8e755b4bae02258810e996e388ee85d187997d9 Author: Gerlof Langeveld -Date: Tue Aug 11 07:37:35 2020 +0200 +Date: Sat Dec 11 21:46:11 2021 +0100 - Merge pull request #125 from bytedance/oom_score_fixed_adj - - Try to set the highest OOM priority for atop + Only show per-node NUMA stats when more than 1 node -commit 93877ad6dc5c80b97fc91fc1f8df20c064390895 -Author: zhenwei pi -Date: Tue Aug 11 10:08:37 2020 +0800 +M showlinux.c - Try to set the highest OOM priority for atop - - We usually expect that atop has highest OOM priority. when the system - runs out of memory, atop still could record necessary infomation. - Then we are able to analyze the OOM situation afterwards. - - The orignal verion of this feature: read config from atoprc, then - apply to atop process. But Gerlof considers that just trying to set - the highest priority is better. So rewrite this as Gerlof's advise. - - Signed-off-by: zhenwei pi +commit a0b48f8fe4641cc693cd198d3c241f507b2a29c4 +Merge: 070bf58 01cdbfb +Author: Gerlof Langeveld +Date: Sat Dec 11 21:41:13 2021 +0100 -M atop.c -M atop.h -M various.c + Merge branch 'adapt_conversion' -commit 678431f34ad49ef6ade6652eb0bb39f07dc42e6d -Merge: dd0fb8a 67ab9e3 +commit 01cdbfba8b4232a97ffc2d29401ac4503a949cec Author: Gerlof Langeveld -Date: Mon Aug 10 20:49:35 2020 +0200 +Date: Sat Dec 11 21:39:58 2021 +0100 - Merge pull request #124 from bytedance/fix-prusage - - Fix prusage segmentation fault when vis.show_usage is null + Prepare man pages for version 2.7 -commit 67ab9e3d6db1c39f5e5816690995e4503d99ec29 -Author: Fei Li -Date: Wed Aug 14 20:15:30 2019 +0800 +M man/atop.1 +M man/atopacctd.8 +M man/atopcat.1 +M man/atopconvert.1 +M man/atopgpud.8 +M man/atoprc.5 +M man/atopsar.1 - Fix prusage segmentation fault when vis.show_usage is null - - Signed-off-by: Fei Li +commit 3c3fb8611f85cedbbed1004e1e40bd60cfc99564 +Author: Gerlof Langeveld +Date: Sat Dec 11 21:39:35 2021 +0100 -M atop.c + Prepare atopconvert for version 2.7 + +M atopconvert.c +A prev/photoproc_27.h +A prev/photosyst_27.h + +commit 070bf58021b94d4bc7d03e97c6126f2b5af3a3bc +Merge: 1a8228c dd13f80 +Author: Gerlof Langeveld +Date: Thu Dec 2 10:29:45 2021 +0100 + + Merge branch 'acctcoop' -commit dd0fb8a41afcd9cc03323df33340a40cc6dba3ea +commit dd13f80e80e9063e9abaf062b26e4272c9671762 Author: Gerlof Langeveld -Date: Fri Jul 3 21:16:17 2020 +0200 +Date: Thu Dec 2 10:21:52 2021 +0100 - Add WCHAN to parseable output (PRC). + Detect logrotation for process accounting with psacct/acct + In case that the psacct/acct package is installed and the service is + enabled, atop will read the process accounting records from the + logfile related to that package (/var/(log/)account/pacct). + Atop notices the rotation of this file now, instead of using the + logrotation 'wrappers' psaccs_atop and psaccu_atop that were installed + before in the /etc/logrotate.d directory (these wrappers have been + removed now). +M Makefile +M README +M acctproc.c M man/atop.1 -M parseable.c +D psaccs_atop +D psaccu_atop +M rpmspec/atop.specsysv -commit 4739704df2449766ac1ac3f2b74f3dc5f1904709 -Merge: 9997130 f5742ac +commit 1a8228cb859fb754c3c9db4d08671e9ea7fbc207 Author: Gerlof Langeveld -Date: Fri Jul 3 20:34:40 2020 +0200 +Date: Sat Nov 20 14:53:46 2021 +0100 + + Speed and duplex mode not correctly filled for interface + In case of handshaked ETHTOOL_GLINKSETTINGS the speed and + duplex mode were not correctly filled. - Merge branch 'wchan' +M ifprop.c -commit f5742ac88ef2e554890bd9a418a403f1bc6b3912 +commit 0db2a32deea5135831c0fb74c9b8495c9930a291 Author: Gerlof Langeveld -Date: Fri Jul 3 20:26:52 2020 +0200 +Date: Mon Nov 15 23:58:13 2021 +0100 - Maintain WCHAN per thread - When the 'W' key or the -W flag is used, the wait channel will be - determined for every sleeping thread. Gathering of this value is optinal - because the determination of the WCHAN string is relatively CPU-intensive - for atop. - The WCHAN is shown when selecting the scheduling statistics (key 's'). + Bug solution related to discards -M atop.c -M atop.h -M deviate.c -M man/atop.1 -M photoproc.c -M photoproc.h -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showprocs.c +M photosyst.c -commit 99971301394dce410976de972b9536e6db03760e -Merge: ef62300 ed1f6d3 +commit c12ff9db0aec03c435c7a32df8b2fc12ad27a3b1 +Merge: 5c08726 06c84b1 Author: Gerlof Langeveld -Date: Thu Jul 2 16:22:41 2020 +0200 +Date: Mon Nov 15 16:54:13 2021 +0100 - Merge branch 'bytedance-schedstat' + Merge branch 'add_discard' -commit ed1f6d30bd359f4d264edfde4e65bcafb16ad32b +commit 06c84b1649ba3dc0c4603ff16460eddeecb301ee Author: Gerlof Langeveld -Date: Thu Jul 2 16:17:30 2020 +0200 +Date: Mon Nov 15 16:48:23 2021 +0100 - Show runqueue delay for process and threads - For every process (cumulated) and thread the time spent waiting on - a runqueue is shown (RDELAY). + Support discard counter for disks and skip unused disks + When the number of discards is separatedly by the kernel and provided + via /proc/diskstats, it will be shows as a separate counter by atop. + Furthermore, atop will ignore disks that have not been used at all + (#reads, #writes and #discards are all zero) as an alternative for + the solution provided by PR #170. +M atopsar.c M deviate.c M man/atop.1 +M man/atopsar.1 M parseable.c -M photoproc.c -M photoproc.h +M photosyst.c +M photosyst.h M showlinux.c -M showprocs.c +M showlinux.h +M showsys.c -commit 2119fe754f6a75e444c1c48d7303a6754210efbe -Merge: ef62300 0ffbcd9 +commit 98ccb68acf64bfe432e049f7665f424fe5aad8fb +Merge: 5c08726 fd29747 Author: Gerlof Langeveld -Date: Thu Jul 2 14:08:37 2020 +0200 +Date: Tue Nov 9 21:06:39 2021 +0100 - Merge branch 'schedstat' of git://github.com/bytedance/atop into bytedance-schedstat + Merge pull request #172 from bytedance/bytedance/fix-ioctl-parameter + + ifprop.c: fix ioctl parameter after handshaking with kernel -commit ef62300ffa08ca978ed6d1bfe7eb65fb242aa873 -Author: Gerlof Langeveld -Date: Mon Jun 15 14:03:49 2020 +0200 +commit fd29747a6539497146f779f5258032ccab154850 +Author: huteng.ht +Date: Mon Oct 18 22:50:52 2021 +0800 - Occasional segmentation fault when atop is combined with netatop - Even when the number of exited processes via netatop was zero, still - a malloc was issued. In certain circumstances a structure could have - been stored at the address that was returned by malloc, resulting in - a segmentation fault on a subsequent malloc. + ifprop.c: fix ioctl parameter after handshaking with kernel + + After handshaking with kernel completed, following ioctl syscalls with + SIOCETHTOOL request code and a positive value of link_mode_masks_nwords, + which indicates number of 32-bit words for the supported, advertising and + lp_advertising link mode bitmaps, would return with those three __u32 arrays + appended to the end of struct ethtool_link_settings. + + Accordingly, the ioctl parameter, ifreq, should be initialized with + ifreq.ifr_ifru.ifru_data pointing to a extended memory space to accommodate + those arrays. Otherwise, unexpected memory corruption would occur. -M netatopif.c +M ifprop.c -commit 7838d54e81070eedfe5c7362fcca9875fa8d81c5 +commit 5c08726ca1fe42513f05a1bc5fd06169226e899d Author: Gerlof Langeveld -Date: Mon Jun 15 13:58:47 2020 +0200 +Date: Sat Nov 6 12:27:28 2021 +0100 - Prevent race condition when last atop stops and new one is started - When the last atop incarnation terminates, the atopacctd issues a - cleanup of all accounting files and writes a new'current' file. - When a new atop is started meanwhile, a race condition might be - introduced, which is prevented by a semaphore. + Show gigabits/sec instead of megabits/sec for Infiniband #131 -M acctproc.c -M atopacctd.c +M atopsar.c -commit 19b0d7c12d708d788768c14b45a9ec1114334814 -Merge: ebf956c eba520e +commit ef00513d29fe7fed09b567f48262a6c4a9c8309b +Merge: 6d3109f ea332c6 Author: Gerlof Langeveld -Date: Sat Jun 6 11:54:48 2020 +0200 +Date: Sat Nov 6 10:44:58 2021 +0100 - Merge pull request #110 from xixiliguo/atop-rotate + Merge pull request #168 from xixiliguo/mem-busy - disable atop-rotate.timer when uninstall + Correct memory busy logic in atopsar -commit 0ffbcd91a346f6e3ac7a22af1b49dd956f00f0c9 -Author: zhenwei pi -Date: Fri May 22 19:54:09 2020 +0800 +commit 6d3109f9cf35abff4e73bc7e55506f449c8c1471 +Merge: 0d18f69 2a498f1 +Author: Gerlof Langeveld +Date: Sat Nov 6 10:39:56 2021 +0100 - Support time spent waiting on a runqueue collection + Merge pull request #173 from bytedance/execvp-CVE - Collect run delay information from /proc//schedstat, and show - in schedproc page. + CVE: use execvp with a specified path to avoid PATH hijacking + +commit 2a498f1dab5cd710fc228c708ceee8d6974b0ada +Author: Fei Li +Date: Tue Oct 19 16:08:21 2021 +0800 + + CVE: use execvp with a specified path to avoid PATH hijacking - It's helpful for latency spike trouble shooting case. + With the upgrade of atop, there are cases when we try to use the new + atop version to read the incompatible log files generated by the old + atop version. The current code uses execvp in try_other_version() to + implement this compatibility mechanism. + + However, the execvp is somehow risky. The following is an example. + - Preparation conditions: + 1. Forge a malicious binary named atop-2.4 under /home/test, and + add it to the global $PATH. + 2. Supposing there's no real /usr/bin/atop-2.4 or other executable + atop-2.4 except the malicious /home/test/atop-2.4. + 3. Forge a malformed /var/log/atop/atop_2.4, which can do harm to + current machine if called by the malicious /home/test/atop-2.4. + 4. Update atop to v2.6. + - Reproduce: + Use the current v2.6's atop to read /var/log/atop/atop_2.4, the code + will finally find out and call the malicious /home/test/atop-2.4 + (`strace` can show the detail), then trigger the hijacking risk. + - Fix: + Let's hard-code execvp's first parameter with '/usr/bin/atop' to + avoid the PATH hijacking. - Signed-off-by: zhenwei pi + Signed-off-by: Fei Li + Reported-by: yangqiushi.george@bytedance.com -M deviate.c -M photoproc.c -M photoproc.h -M showlinux.c -M showlinux.h -M showprocs.c +M rawlog.c + +commit ea332c676785f712e5682395e9a425166f1c1846 +Author: peter wang +Date: Sun Oct 3 22:35:41 2021 +0800 + + Correct memory busy logic in atopsar -commit ebf956cc28aef6e818e32b920e8e2e73577777f8 +M atopsar.c + +commit 0d18f694afca1c0268e63f60b5aed7cf95e00aed Author: Gerlof Langeveld -Date: Sat May 16 13:00:03 2020 +0200 +Date: Sun Sep 26 14:23:44 2021 +0200 - Show ARC size for ZFSonlinux - The new counter `zfarc` is introduced for memory analysis on system level - showing the current size of the ARC (cache) for ZFSonlinux. + Add parseable output for per-node NUMA counters M deviate.c M man/atop.1 @@ -376,4233 +378,858 @@ M showlinux.h M showsys.c -commit 62961a0190e8844f936ae52162127c58a87d6392 +commit d0b2de66b7f88664b2733f3bba1e9ace5b9b40b8 +Merge: dc71bc4 1fbda3f Author: Gerlof Langeveld -Date: Tue Apr 28 16:02:13 2020 +0200 +Date: Tue Sep 21 13:28:42 2021 +0200 - Add 'New Process' indicator to parseable output. - A new field is added to the output line of -PPRG indicating if the - process is newly started during the interval. - -M man/atop.1 -M parseable.c + Merge branch 'bytedance-add-per-numa-info' -commit 3ddaaa3324a1e2ee67b6c4d85f38c13ce6139d90 +commit 1fbda3f1081a3c2734a215082ff2d4f1870e5898 Author: Gerlof Langeveld -Date: Tue Apr 28 14:59:41 2020 +0200 +Date: Tue Sep 21 13:24:52 2021 +0200 - Correct handling of locale. + Additions to NUMA counters + Table overflow checks, bug fix and manual page has been added. -M README -M showgeneric.c +M deviate.c +M man/atop.1 +M photosyst.c +M photosyst.h +M showlinux.c +M showlinux.h +M showsys.c -commit eba520edfdcc4ddf6bd912447bba57ce13f099db -Author: root -Date: Wed Apr 22 19:35:40 2020 +0800 +commit 437beeb569aeaccc342184833473f9fb886da364 +Author: Fei Li +Date: Sat Aug 7 20:52:28 2021 +0800 - disable atop-rotate.timer when uninstall + Gather and show per numa cpu related statistics + + Currently there exists many scenarios of mixed services deployment, + like hybrid cloud, and generally different services are running in + different numa via cpu-pin technology. At this time, accumulate cpu + statistics for per numa is extremely meaningful. + + By default, the maxnumalines is set to be zero. Specify the + maxnumalines interactively if needed. + + Signed-off-by: Fei Li -M rpmspec/atop.specsystemd +M atop.c +M atop.h +M deviate.c +M photosyst.c +M photosyst.h +M showgeneric.c +M showgeneric.h +M showlinux.c +M showlinux.h +M showsys.c -commit 62dc8de0b9a5001268a75950d7d2594d56c4db4a -Author: Gerlof Langeveld -Date: Sat Mar 7 14:51:00 2020 +0100 +commit 3f5a5e523cd4ae37314c46aa479cf53e17911779 +Author: Fei Li +Date: Fri Jul 16 18:34:33 2021 +0800 - Modified locale to "C" to avoid failing sscanf for floats + Gather and show per numa memory related statistics + + Sometimes we need per numa memory related statistics to troubleshoot, + let's gather per numa info by reading the + /sys/devices/system/node/node$n/meminfo. By default, set maxnumalines + to be zero, in case there exists too many NUMA for one machine. + + Besides, show memory fragmentation level for each numa. + + Signed-off-by: Fei Li +M atop.c +M atop.h +M deviate.c +M photosyst.c +M photosyst.h M showgeneric.c +M showgeneric.h +M showlinux.c +M showlinux.h +M showsys.c -commit d87e22b6815d4036dae5f14bab6dca54f9c34e59 +commit dc71bc44af8feaf1ebc4b3e350330b2c63b2d891 +Merge: 02a7c5d 14b383a Author: Gerlof Langeveld -Date: Sat Mar 7 14:50:21 2020 +0100 - - Modified /usr/lib/systemd/system to /lib/systemd/system +Date: Mon Aug 9 13:19:54 2021 +0200 -M Makefile + Merge branch 'interfaces' -commit ff551421bff21c272de43e02b8179144f17b7fc9 +commit 14b383a824fad8f0edfb7c52875732fdc2e6196b Author: Gerlof Langeveld -Date: Fri Mar 6 07:51:00 2020 +0100 - - Atopcat: add flags -d (dryrun) and -v (verbose) +Date: Mon Aug 9 13:11:32 2021 +0200 + + Redesign of code to handle network interfaces + The old code that handles the properties of network interfaces + did not scale properly for a large number of interfaces and + contained bugs. + The new code regularly gathers information of the network interfaces + and stores it in a hash list. Besides, it takes care that stats + of physical interfaces take precedence over stats of virtual interfaces + in case that the number of interfaces of a system exceeds the maximum + supported by atop. -M atopcat.c -M man/atopcat.1 +M deviate.c +M ifprop.c +M ifprop.h +M photosyst.c +M photosyst.h -commit 2990fd589f5764fafe3abef2fb2e43002070562f +commit 02a7c5ddcf315148350474292755f4468d91372d Author: Gerlof Langeveld -Date: Mon Feb 24 19:10:09 2020 +0100 +Date: Sun Aug 8 10:11:02 2021 +0200 - Allow forward branches when reading raw data from a pipe. + Correction in handling of zswap and ksm counters -M man/atop.1 -M rawlog.c +M parseable.c +M photosyst.c +M showlinux.c -commit e86f32d200fa02dcaaf8bac066160768b48d7d68 +commit abc63c396192c60d03acd76e357ac4bce61a349e +Merge: 8b65a35 842844f Author: Gerlof Langeveld -Date: Mon Feb 24 18:19:46 2020 +0100 - - Introduction of command 'atopcat' to concatenate rawlog files - With the command 'atopcat' the contents of rawlog files can be - concatenated and written to stdout. The output of this command - can be redirected to a file or transferred via a pipe to atop or - atopsar. In this way weekly, monthly, ... reports or extractions - can be created in an easy way. +Date: Sun Aug 8 09:42:54 2021 +0200 -M .gitignore -M Makefile -A atopcat.c -M atopconvert.c -A man/atopcat.1 -M man/atopconvert.1 -A rawlog.h -M rpmspec/atop.specsystemd -M rpmspec/atop.specsysv + Merge branch 'podman' -commit 186ab18f0cf66252db7dbd7187c9efb55f4f4188 +commit 842844f299e577f30a9c0d90393c47de81c99a8b Author: Gerlof Langeveld -Date: Mon Feb 24 18:10:40 2020 +0100 - - Support reading raw log from pipe with option '-r -' - Atop and atopsar can read raw log data from a pipe via stdin - when the option '-r -' is used. Since a seek is not possible on a - pipe, no rewind is possible nor viewing of previous samples. - -M atop.c -M atopsar.c -M man/atop.1 -M man/atopsar.1 -M rawlog.c -M showgeneric.c +Date: Sun Aug 8 09:41:52 2021 +0200 -commit c43dc50eee1c9265340c8531db80a83ec1a06b84 -Merge: bc2e412 115feba -Author: Gerlof Langeveld -Date: Sat Feb 22 17:01:46 2020 +0100 + Support containers created by podman - Merge branch 'multiday' +M photoproc.c -commit 115febabe00a562bb40d11da697ff1e452281fce +commit 8b65a35be87e7524d39df206c7b63b0f43e74903 Author: Gerlof Langeveld -Date: Sat Feb 22 16:57:47 2020 +0100 +Date: Tue Aug 3 12:36:49 2021 +0200 - Support of logfiles that span multiple days - The time specification to define the begin time (-b flag) and - end time (-e flag) of both atop and atopsar is [YYYYMMDD]hhmm now. - This also applies to the branch key ('b') when using atop interactively. + Cleanup old messages -M atop.c -M atop.h -M atopsar.c -M man/atop.1 -M man/atopsar.1 -M netatopif.c -M rawlog.c -M showgeneric.c -M various.c +M showprocs.c -commit bc2e412791bf5b1d206a362ec1f9ce9f23beac42 -Merge: 8b9cd3f f202a31 +commit 334de688127f94774f4ef71b07a7c9f108053f89 +Merge: bbc5733 e3e9994 Author: Gerlof Langeveld -Date: Sat Feb 22 13:24:20 2020 +0100 +Date: Tue Aug 3 11:29:33 2021 +0200 - Merge pull request #100 from zlandau/loadavg_crash + Merge pull request #154 from ffontaine/master - Fix crash when system reports huge load averages + photosyst.c: fix build on musl -commit f202a317994f563a25a8c64a38ba4445a1d4606b -Author: Zachary P. Landau -Date: Sun Feb 16 12:33:30 2020 -0800 +commit bbc57336ecbd11a4858d626211415db634fed5e9 +Merge: 28201da ec2b21b +Author: Gerlof Langeveld +Date: Tue Aug 3 11:25:52 2021 +0200 - Fix crash when system reports huge load averages - - The load average reporting functions in showsys.c use static buffer - sizes. When the load averages on a machine are very large, this causes - the writes to extend past the buffer. With this commit, if a number is - too large then we just show '>NNNNNN'. I'm not sure if this is the best - choice, so I'm open to other ideas. - - This is what the output looks like when we exceed the maximums: - - CPL | avg1 >999999 | avg5 >999999 | avg15 >99999 | csw 103117e3 | intr 88296e3 | - - Note that this was triggered from a kernel that is reporting clearly - inaccurate numbers: - - $ cat /proc/loadavg - 1.25 2.40 368567045.47 1/589 53576 - - But regardless, crashing is no fun. + Merge pull request #162 from bytedance/fix-perf - For future reference, I narrowed down the issue by building with - -fsanitize=address. For example: - - ==55396==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55c527d6f14f at pc 0x7f4729942df9 bp 0x7ffe1fd30710 sp 0x7ffe1fd2fea0 - WRITE of size 10 at 0x55c527d6f14f thread T0 - #0 0x7f4729942df8 in __interceptor_vsprintf /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1627 - #1 0x7f47299432cf in __interceptor_sprintf /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1670 - #2 0x55c527d1c167 in sysprt_CPLAVG15 (/home/kapheine/projects/atop/atop+0x74167) - #3 0x55c527d2087a in showsysline (/home/kapheine/projects/atop/atop+0x7887a) - #4 0x55c527d1471f in prisyst (/home/kapheine/projects/atop/atop+0x6c71f) - #5 0x55c527d090ff in generic_samp (/home/kapheine/projects/atop/atop+0x610ff) - #6 0x55c527ce17c9 in main (/home/kapheine/projects/atop/atop+0x397c9) - #7 0x7f472952a022 in __libc_start_main (/usr/lib/libc.so.6+0x27022) - #8 0x55c527ce266d in _start (/home/kapheine/projects/atop/atop+0x3a66d) - - 0x55c527d6f14f is located 49 bytes to the left of global variable 'buf' defined in 'showsys.c:981:54' (0x55c527d6f180) of size 15 - 0x55c527d6f14f is located 0 bytes to the right of global variable 'buf' defined in 'showsys.c:1000:54' (0x55c527d6f140) of size 15 - -M showsys.c + Polish do_perfevents when atop built with NOPERFEVENT -commit 8b9cd3f8225d7d17828e42dd73f1e8b47176f11a +commit 28201dabbf443fb5edf0c9033e65d4741cf09162 Author: Gerlof Langeveld -Date: Sat Feb 15 12:00:45 2020 +0100 +Date: Tue Aug 3 11:20:28 2021 +0200 - Wrong checks on return values of write and pread syscalls + Do not change owner to root in Makefile (issue #76) -M atop.c -M atop.h -M atopacctd.c -M atopsar.c -M rawlog.c -M showgeneric.c -M various.c +M Makefile -commit 7bbfd140d2511cb9046905a51096376d7d9b0669 -Merge: d4769ab ffc8ba8 +commit f1edeaa967447fca9b887dafb45e13d1c74d7fc1 +Merge: 0e85cba b5330de Author: Gerlof Langeveld -Date: Sat Feb 15 10:20:54 2020 +0100 +Date: Tue Aug 3 10:58:39 2021 +0200 - Merge pull request #50 from Saur2000/master - - atop.daily, atop.init, atop-pm.sh, mkdate: Avoid using bash + Merge branch 'debaccounting' -commit d4769ab3882d1d74219564f415823e8d29877358 -Merge: dfa87a6 788c388 +commit b5330dee8fbfa24db10bc2fc85f23145e62ca522 Author: Gerlof Langeveld -Date: Sat Feb 15 10:13:55 2020 +0100 +Date: Tue Aug 3 10:55:02 2021 +0200 - Merge pull request #99 from bytedance/logopts-man - - Update man about default LOGOPT '-R' + Support process accounting log /var/log/account/pacct (issue #138) + The Debian acct package logs to the file /var/log/account/pacct + for process accounting. This file was not checked by atop when + looking for process accounting candidates. -commit 788c3883f5e1567bba572da92c17facd6332e898 -Author: zhenwei pi -Date: Tue Feb 11 09:55:13 2020 +0800 +M acctproc.c +M atopacct.init +M man/atop.1 +M psaccs_atop +M psaccu_atop + +commit ec2b21bbf99447a48aa5380e4d0d3c4fbfb64b72 +Author: Fei Li +Date: Mon Aug 2 22:20:51 2021 +0800 - Update man about default LOGOPT '-R' + Polish do_perfevents when atop built with NOPERFEVENT - Since 604b563a223130d9bcce3d3358537a6c5ce05e7a, atop has removed - default LOGOPT '-R', so update man page here. + The phenomenon is supposing one atop package whose code is older than + commit: 961a6ce13 has been installed and 'perfevents disable' is also + defined in atoprc. When trying to update to a version newer than that + commit, the new atop will crash saying 'atop built with NOPERFEVENT, + cannot use perfevents'. And the result is we have to remove the tag + in atoprc before we do update, which is quite inconvenient. + + Although perf is forbidden when atop is built with NOPERFEVENT, + defining 'perfevents disable' in atoprc can actually be allowed. Let's + avoid that unfriendly crash by making the check code tolerate with + the 'perfevents disable' tag in /etc/atoprc. - Signed-off-by: zhenwei pi + Signed-off-by: Fei Li -M man/atop.1 +M photosyst.c -commit dfa87a64a68acea86a470063c02be044fbfa518c -Merge: 14900df ad4b3c8 +commit 0e85cba6a6e27b80fc8ccde4c38440388895d283 +Merge: c72143f 9fc4536 Author: Gerlof Langeveld -Date: Sat Feb 8 10:25:31 2020 +0100 +Date: Mon Jul 26 09:17:50 2021 +0200 - Merge branch 'rpungartnik-StringManipulation' + Merge branch 'showsysclean' -commit ad4b3c8cd40b01a68f7e6bdc6bacfcf1117db1ae +commit 9fc4536d5470f470e50d7e59caee51574232f41c Author: Gerlof Langeveld -Date: Sat Feb 8 10:22:40 2020 +0100 +Date: Mon Jul 26 09:15:24 2021 +0200 - Avoid negative values to cause memory overflow, but do not set to 0. + Code cleanup showsys.c + Adapted calling parameters from void * to specific pointers and removed + unnecessary variables. -M photosyst.c +M showlinux.h M showsys.c -commit 2292e0b5b9327eeae2c1078f0e266d1febef7645 -Merge: 14900df e889c66 +commit c72143f7b3b3ebca1cd4a921823fd59ff293d524 +Merge: 799d800 ae2c756 Author: Gerlof Langeveld -Date: Sat Feb 8 10:00:09 2020 +0100 +Date: Sun Jul 25 14:39:13 2021 +0200 - Merge branch 'StringManipulation' of git://github.com/rpungartnik/atop into rpungartnik-StringManipulation + Merge branch 'dynamic2' -commit 14900df5b75bf4d97e0c47caa8ea08f9386230e1 -Merge: b3356e5 b2f804c +commit ae2c756721f09d45e2d1034df0072c453321a6ba Author: Gerlof Langeveld -Date: Sat Jan 18 12:07:42 2020 +0100 +Date: Sun Jul 25 14:28:50 2021 +0200 + + Do not use doconvert funtion to validate counter (#160) + The doformat function (formerly named 'doconvert') called all + sysprt_... functions to determine which fields were relevant and + which fields were not relevant during a run of atop. This might + lead to buffer overflows since not all variables used were + initialized. This issue has been solved now by introducing + a separate (optional) validation function per counter. - Merge branch 'rpungartnik-ResultCheck' +M showlinux.c +M showlinux.h +M showsys.c -commit b2f804c8b49501dc2d8e941bbdfe47e4ec2203e3 +commit 799d800173c4f374031066d1651434784bc5e9a9 Author: Gerlof Langeveld -Date: Sat Jan 18 12:05:06 2020 +0100 +Date: Mon Jun 21 21:52:50 2021 +0200 - Avoid compiler warnings due to unused results - Compiler warnings are given for return values of system calls - that are not verified, even if these system calls are allowed - to fail. + New counter for number of NUMA pages migrated -M atopacctd.c -M photosyst.c -M rawlog.c -M various.c - -commit 5a39c743c6094c3c4e141dfc7a109cecb46c0944 -Merge: b3356e5 2fd755b -Author: Gerlof Langeveld -Date: Sat Jan 18 11:49:13 2020 +0100 - - Merge branch 'ResultCheck' of git://github.com/rpungartnik/atop into rpungartnik-ResultCheck - -commit b3356e5c46d52f23d299b885de8095add0008ac2 -Merge: 95e2525 68b2a90 -Author: Gerlof Langeveld -Date: Sat Jan 18 11:41:14 2020 +0100 - - Merge branch 'master' of github.com:Atoptool/atop - -commit 95e252560e435f13fe4d8055de7cbdb1b6a164b5 -Author: Gerlof Langeveld -Date: Sat Jan 18 11:39:31 2020 +0100 - - Datatype double changed to long for percentage PSI percentage. - -M showsys.c - -commit 68b2a9008ef2aa72e4badd1eb2a0107555f404aa -Merge: 461ebee 604b563 -Author: Gerlof Langeveld -Date: Tue Jan 14 10:32:37 2020 +0100 - - Merge pull request #97 from bytedance/logopts - - Drop '-R' in default log option - -commit 604b563a223130d9bcce3d3358537a6c5ce05e7a -Author: zhenwei pi -Date: Mon Jan 13 10:14:08 2020 +0800 - - Drop '-R' in default log option - - '-R' option is implemented by reading '/proc/PID/smaps' or - '/proc/PID/smaps_rollup'. During atop reading smaps/smaps_rollup, - atop needs hold the task->mm->mmap_sem, reference linux source code, - - file linux/fs/proc/task_mmu.c - static void *m_start(struct seq_file *m, loff_t *ppos) - { - ... - down_read(&mm->mmap_sem); - ... - } - - then atop walks the page table of target process and release lock. - - The target also needs hold the lock when mmap/mumamp/page fault - handling. The lock race will hurt the performence of the target - process. A typical case is the latency spike of large size memory - of redis. - - Signed-off-by: zhenwei pi - -M atop.daily -M atop.default -M atop.service - -commit 461ebeecd1e5018d9b23ab6bef466232107f6833 -Author: Gerlof Langeveld -Date: Sat Jan 11 10:38:04 2020 +0100 - - Correct handling of atopsarflags from atoprc file - The default setting for the options of atopsar was not correct - (wrong calling parameter was used). Issue solved. - -M atopsar.c - -commit e889c66fbe1d0b7ae38fbcbaa46cea749257f486 -Author: Roberto -Date: Thu Jan 9 08:54:28 2020 -0300 - - Compilation warnings - String Manipulation - - Changed the size of path variable using system constant - Implemented data size check during message creation to avoid buffer overflow and problems when displaying messages. - - Now negative numbers are presented as 0(zero) and to big numbers are presented as maximum value(ex.9999). This will avoid problems in case of invalid or unexpected data. - - This was tested compiling in 32 and 64 bits. - -M photosyst.c -M showsys.c - -commit cd2c98dfc8f73b3c44c1df0743cf2f43f6ef7ef8 -Author: Gerlof Langeveld -Date: Thu Jan 9 11:41:17 2020 +0100 - - Show virtually locked memory per process - Per process the value LOCKSZ is maintained to show the amount of memory - being locked by the process (virtually). This value is shown for individual - processes (key 'm') but also as accumulated value for keys 'p', 'u' and 'j'. - -M deviate.c -M man/atop.1 -M parseable.c -M photoproc.c -M photoproc.h -M showgeneric.c -M showlinux.c -M showlinux.h -M showprocs.c - -commit e0a96a343e1b476cccd32a025d70421bdc754c2f -Merge: 0878ae4 4b0cc91 -Author: Roberto -Date: Mon Jan 6 10:13:58 2020 -0300 - - Merge pull request #1 from Atoptool/master - - update - -commit 4b0cc9133d9e8772a29f8a910ee48615577efd66 -Merge: bcbe687 91e0340 -Author: Gerlof Langeveld -Date: Sat Jan 4 10:53:37 2020 +0100 - - Merge branch 'master' of github.com:Atoptool/atop - -commit bcbe68712009663f3fe54214c0fe25dc07e668b5 -Merge: 7f4fa0f 5e14308 -Author: Gerlof Langeveld -Date: Sat Jan 4 10:52:50 2020 +0100 - - Merge branch 'rpungartnik-CompilationFlags' - -commit 5e14308568bf90d538fe9a0235df8341fe068d7b -Merge: 7f4fa0f 1d22fd8 -Author: Gerlof Langeveld -Date: Sat Jan 4 10:51:15 2020 +0100 - - Remove explicit compolations from Makefile (issue #91) - -commit 91e0340e704b4334df4c9d1e9dda9b0adb7399e8 -Merge: 7f4fa0f 95e5d72 -Author: Gerlof Langeveld -Date: Sat Jan 4 10:34:30 2020 +0100 - - Merge pull request #90 from rpungartnik/CompilationWarnings - - Solved some compilation warnings - -commit 7f4fa0f7fe3a20e0ba0e348529e1f94613d36d99 -Merge: 0878ae4 fa101b4 -Author: Gerlof Langeveld -Date: Sat Jan 4 10:26:09 2020 +0100 - - Merge branch 'db48x-avio-time-scaling' - -commit fa101b4dc5d3729d84466f708c29959570bd0919 -Author: Gerlof Langeveld -Date: Sat Jan 4 10:20:50 2020 +0100 - - Report disk average I/O in microseconds/nanoseconds (issue #89) - Very fast drives might show 0.0 ms as the average I/O time. Therefore, - average I/O unit will be adapted to the smallest possible unit. - Due to the use of microseconds (abbreviates to a multibyte character), - the ncursesw library is used instead of ncurses library (the latter - calculates the number of characters in a wrong way). - -M Makefile -M atopsar.c -M showgeneric.c -M showsys.c - -commit e47d9f7dbf0ffcd12ce2540097fa2fa87d8ab718 -Merge: 0878ae4 c20cbce -Author: Gerlof Langeveld -Date: Sat Jan 4 09:30:20 2020 +0100 - - Merge branch 'avio-time-scaling' of git://github.com/db48x/atop into db48x-avio-time-scaling - -commit 2fd755b83103a2cdda8c4bdd1765e2ac3a75a418 -Author: Roberto -Date: Fri Jan 3 22:31:07 2020 -0300 - - Compilation Warning - Unused Result on system calls - - Newer versions of gcc enforce to check the result of system calls - -M atopacctd.c -M photosyst.c -M rawlog.c -M various.c - -commit 95e5d72c5a311c356994ec0f4743095bbf8548cc -Author: Roberto -Date: Thu Jan 2 21:53:15 2020 -0300 - - Solved some compilation warnings - - Resolved warning from unused rcsid variable - Resolved "misleading indentation" warnings - - No changes in behaviour - - No changes in behaviour - -M atop.c -M atopsar.c -M deviate.c -M photoproc.c -M photosyst.c -M showgeneric.c -M showlinux.c -M showprocs.c -M showsys.c - -commit 1d22fd8f161e8db198f0f44fb3ce498d04f2f21b -Author: Roberto -Date: Thu Jan 2 20:56:32 2020 -0300 - - Use CFLAGS and LDFLAGS to all files - -M Makefile - -commit 0878ae435d65d2fdcf73a96bd8502fe754ea9af7 -Author: Gerlof Langeveld -Date: Tue Dec 31 12:44:26 2019 +0100 - - Show PSI pressure percentage during interval (issue #72) - Atop and atopsar show the pressure percentage during the interval - as most important percentage now. Atop still shows the average - percentages for the last 10, 60 and 300 seconds by widening the window. - -M atopsar.c -M man/atop.1 -M man/atopsar.1 -M showlinux.c -M showlinux.h -M showsys.c - -commit 08c622ecaa5bb0bb260984ceaddc4730d1b312a7 -Author: Gerlof Langeveld -Date: Tue Dec 24 12:20:02 2019 +0100 - - Suppress busy percentage for virtual network interface (issue #83) - Determine whether or not a network interface is virtual (for which - the interface driver usually returns 10 Mbit as speed) by checking - the physical address. - -M ifprop.c - -commit c20cbce6a3885ce9cba604de829c311909909e97 -Author: Daniel Brooks -Date: Wed Dec 11 12:45:09 2019 -0800 - - show disk avio values in microseconds or nanoseconds as appropriate - -M showsys.c - -commit 802fb3a235c5fd9aa4e6cdc0fb3c31e2dca8ea4a -Merge: e4343d3 1c45948 -Author: Gerlof Langeveld -Date: Sat Nov 23 12:45:08 2019 +0100 - - Merge branch 'bytedance-readahead-rawlog' - -commit 1c459481bbef630f335a7e6e1ec7e60daa94ebee -Merge: e4343d3 a34e347 -Author: Gerlof Langeveld -Date: Sat Nov 23 12:36:53 2019 +0100 - - Merge branch 'readahead-rawlog' of git://github.com/bytedance/atop into bytedance-readahead-rawlog - -commit e4343d34b0840212266838267e5370fb559354f4 -Merge: 1f21007 20443a3 -Author: Gerlof Langeveld -Date: Sat Nov 23 12:12:45 2019 +0100 - - Merge pull request #59 from arielnh56/patch-1 - - Make LOGPATH overrulable - -commit 1f210074196daaebd8ac3ceca5e74d9f353d67a7 -Author: Gerlof Langeveld -Date: Sat Nov 23 11:54:10 2019 +0100 - - Avoid overriding /etc/default/atop during RPM upgrade - The file /etc/default/atop should not be overwritten during - an RPM upgrade, so it is marked by %config(noreplace) in the - RPM spec (solved issue #86). - -M rpmspec/atop.specsystemd -M rpmspec/atop.specsysv - -commit 737ae433646fe789cc6f26f18f622e0ee799fe2c -Merge: d292f1b dfb9cb9 -Author: Gerlof Langeveld -Date: Sat Nov 23 11:02:00 2019 +0100 - - Merge pull request #81 from jubnzv/fix-infiniband - - photosyst.c: fix possible error in reading InfiniBand states - -commit d292f1b4f4dcc582f72d8e04d511897c543c6bca -Merge: 224ab67 485a453 -Author: Gerlof Langeveld -Date: Sat Nov 23 10:49:54 2019 +0100 - - Merge pull request #82 from BlackIkeEagle/defpath-not-created - - DEFPATH not created so touch fails - -commit 485a453d2ae5700874a57dffc297030254b5ae7c -Author: BlackEagle -Date: Mon Nov 4 09:00:54 2019 +0100 - - DEFPATH not created so touch fails - - ``` - touch /build/atop/pkg/atop/etc/default/atop - touch: cannot touch '/build/atop/pkg/atop/etc/default/atop': No such file or directory - ``` - - Add DEFPATH mkdir in genericinstall to make sure the folder - `$(DESTDIR)/etc/default` exits - - Signed-off-by: BlackEagle - -M Makefile - -commit 224ab67066810dcb3f80ab40c34bd4ab8d6a2ad7 -Author: Gerlof Langeveld -Date: Sat Nov 2 12:27:18 2019 +0100 - - Prepare for release 2.5 - -M .gitignore -M version.h - -commit e34478820e033a9e581ed601245fef2ae60878b2 -Author: Gerlof Langeveld -Date: Sat Nov 2 12:26:16 2019 +0100 - - Add default values for /etc/default/atop file - -A atop.default -M rpmspec/atop.specsystemd - -commit baf1458e07d37565f7aad469974c87ef0cabc547 -Author: Gerlof Langeveld -Date: Sat Nov 2 12:25:09 2019 +0100 - - Add new structs for version 2.5 to atopconvert - -M atopconvert.c -A prev/photoproc_25.h -A prev/photosyst_25.h - -commit 5089600aed667e01846c89fe0bf2c2b4d9b58f02 -Author: Gerlof Langeveld -Date: Sat Nov 2 12:23:45 2019 +0100 - - Modify manual dates - -M man/atop.1 -M man/atopacctd.8 -M man/atopconvert.1 -M man/atopgpud.8 -M man/atoprc.5 -M man/atopsar.1 - -commit 6fa0306b8966ac0210bb013de4289951f8499ab8 -Merge: a802f1a 43b50d0 -Author: Gerlof Langeveld -Date: Sat Oct 26 22:32:32 2019 +0200 - - Merge branch 'timers' - -commit 43b50d02d413aba226154d3ce8b4721b27b0a06c -Author: Gerlof Langeveld -Date: Sat Oct 26 22:28:37 2019 +0200 - - Modify man pages and spec files for added unit files - The atop.daily script is not used any more for systemd-based systems. - The man page of atop has been changed accordingly. Furthermore, the - spec files have been modified to install the new unit files. - -M Makefile -M atop-rotate.service -M atop-rotate.timer -D atop.cronsystemd -M atop.service -M man/atop.1 -M rpmspec/atop.specsystemd -M rpmspec/atop.specsysv - -commit dfb9cb957eb3464a435908e70d74533558d3aa09 -Merge: c1f68ba 0ee181b -Author: Georgy Komarov -Date: Fri Oct 25 07:41:20 2019 +0300 - - Merge pull request #1 from codebling/fix-infiniband-cleanup - - Move `ibc` property init to original location, revert whitespace changes - -commit 0ee181b084bca95cb98420737bd98a0f8779a6e4 -Author: Code Bling -Date: Thu Oct 24 16:01:15 2019 -0400 - - Move `ibc` property init to original location, revert whitespace changes - -M photosyst.c - -commit c1f68ba78275ebbc0da113acc97fc56c8f0cfd7f -Author: Georgy Komarov -Date: Thu Oct 24 14:52:59 2019 +0300 - - fixup uninitialized memory usage in ibstat - -M photosyst.c - -commit f8024a674203cec60ab311879b34292a10abff5d -Merge: a802f1a 97d7b82 -Author: Gerlof Langeveld -Date: Wed Oct 23 21:31:33 2019 +0200 - - Merge branch 'master' of git://github.com/SjonHortensius/atop into timers - -commit 791e4f8a9eeb1c1d5617f4696135ed0694366b43 -Author: Georgy Komarov -Date: Fri Oct 18 23:46:21 2019 +0300 - - photosyst: fix possible error in reading InfiniBand states - - Make sure that we read rate file successfully to avoid usage of - uninitialized local variables. - -M photosyst.c - -commit 97d7b8225d486211a0a02521a406f83780262253 -Author: Justin Kromlinger -Date: Fri Oct 11 13:37:27 2019 +0200 - - Read environment file in systemd service, use atop defaults (#1) - - Read environment file in systemd service, use atop defaults instead of hardcoded - -M atop.service - -commit a34e3478e1dabe06877881abd9d808180f4c8058 -Author: zhenwei pi -Date: Fri Sep 27 17:27:54 2019 +0800 - - Readahead rawlog to make -b operation faster - - 1, use posix_fadvise POSIX_FADV_SEQUENTIAL to double kernel readahead buffer. - 2, HDD typically has a 100~200 IOPS, atop needs to read raw records more fastly - under low IOPS. So use pread syscall to load a large area(default every 4M) in - page-cache. - - Test env: - set disk iops as 200 for a virtual machine(KVM). - virsh blkdeviotune stretch sdb --write-iops-sec 200 --read-iops-sec 200 --live - - Test cases: - 1, test upstream atop without any page cache - ~# vmtouch -e /var/log/atop/atop_20190916 - ~# time /root/atop-upstream -r /var/log/atop/atop_20190916 -b 18:00 - real 0m54.639s - user 0m0.094s - sys 0m0.321s - - 2, test upstream atop with full page cache - ~# vmtouch -t /var/log/atop/atop_20190916 - ~# time /root/atop-upstream -r /var/log/atop/atop_20190916 -b 18:00 - real 0m1.266s - user 0m0.004s - sys 0m0.021s - - 3, test new atop without any page cache - ~# vmtouch -e /var/log/atop/atop_20190916 - ~# time /root/atop-new -r /var/log/atop/atop_20190916 -b 18:00 - real 0m3.818s - user 0m0.023s - sys 0m0.170s - - case 1 & case 2: speed of reading rawlog effects atop performance a lot. - case 1 & case 3: readahead makes performance better. - - Signed-off-by: zhenwei pi - -M rawlog.c - -commit a802f1a68ff0f3f06e6a4c609a87c0679bd07fce -Author: Gerlof Langeveld -Date: Wed Sep 18 21:43:20 2019 +0200 - - Allow raw data to be read from a named pipe - When reading raw data from a named pipe instead of from - a regular file, it is not possible to branch ('b'), reset ('r') - or go to a precious sample in an interactive session. With atopsar, - only one report can be generated (no combination of various reporting - flags). - -M atop.h -M atopsar.c -M man/atop.1 -M rawlog.c - -commit db74804d15e98af37ed62bfcad95a93959c9d277 -Merge: b10ee34 78f99bb -Author: Gerlof Langeveld -Date: Wed Sep 18 12:02:31 2019 +0200 - - Merge pull request #69 from gleventhal/fix-lseek-segfault-on-nonseekable-piped-rawlog - - Check that rawlog is seekable to prevent later segfaults - -commit b10ee3492ee232a600aa934a724c4c687c691e79 -Author: Gerlof Langeveld -Date: Wed Sep 18 11:46:58 2019 +0200 - - Improve determination of container ID - Many processes might use the cpuset cgroup without being a - container. The length of the basename is verified to be at - least 64 characters (length of SHA256 identifying a container). - -M photoproc.c - -commit fea96f0690f6694624d85b9cb4f216fafea09b79 -Author: Gerlof Langeveld -Date: Mon Sep 16 21:02:23 2019 +0200 - - Correction to avoid loosing first position of CID. - -M photoproc.c - -commit 3fe8f59d71cb8cd70d0fa8d4fd77f232be2922d1 -Merge: 3e0b68c a3db75e -Author: Gerlof Langeveld -Date: Mon Sep 16 20:57:26 2019 +0200 - - Merge branch 'bytedance-fix-docker-container-k8s' - -commit a3db75e174efbe95518f5a18fe89b9aa8154e177 -Author: Gerlof Langeveld -Date: Mon Sep 16 20:55:04 2019 +0200 - - Proposed solution for K8s containers modified. - Docker containers on RedHat/CentOS based systems have - a prefix 'docker-' behind the last '/' that should - be skipped. - -M photoproc.c - -commit 82f2fc889419555a9a1df868e6d1133c0b0169cc -Author: zhenwei pi -Date: Fri May 24 19:54:42 2019 +0800 - - Fix container compatibility for docker created by k8s - - Cpuset of a docker created by k8s looks like this: - /kubepods/burstable/pod07dbb922-[SNAP]/223dc5e15b[SNAP] - - Instead of checking prefix "docker", we usually get 12 char from - last '/'. - Test for docker and k8s, both of them work well. 'CID' row shows - the same string as the `docker ps`. - - Test result for k8s: - ~# docker ps - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - e978af4928f6 hub.byted.org/google_containers/pause-amd64:3.0 "/pause" 39 hours ago Up 39 hours k8s_POD_dp-9fe0dd7536-55fd89b474-[SNAP] - - ~# atop -j - NPROCS SYSCPU USRCPU VSIZE RSIZE PSIZE SWAPSZ RDDSK WRDSK RNET SNET CPU CID 1/1 - 557 1h42m 2h57m 29.6G 1.3G 1.1G 0K 1.9G 19.0G 0 0 11% host-------- - 1 0.00s 0.00s 1028K 4K 109K 0K 0K 0K 0 0 0% e978af4928f6 - - Signed-off-by: zhenwei pi - -M photoproc.c - -commit 3e0b68cb9858a16749c98c3d399d2373e239caa6 -Merge: 1b50456 086366f -Author: Gerlof Langeveld -Date: Sat Aug 10 12:20:13 2019 +0200 - - Merge branch 'bytedance-perfevent' - By default, suppress gathering of 'perf' counters on VM guests. - -commit 086366f9e008c711d51e8400ae9d54479224fae0 -Author: Gerlof Langeveld -Date: Sat Aug 10 12:18:46 2019 +0200 - - Adapt documentation to new keyword 'perfevents' in atoprc. - -M man/atop.1 -M man/atoprc.5 -M photosyst.c - -commit ea9e1814e255922dfedbb428bea48d2800f681f3 -Merge: 1b50456 16abcac -Author: Gerlof Langeveld -Date: Sat Aug 10 10:34:48 2019 +0200 - - Merge branch 'perfevent' of git://github.com/bytedance/atop into bytedance-perfevent - Avoid overhead using perf in VMs. - -commit 1b504568a4562ce6fca93275898e084a8f832d29 -Author: Gerlof Langeveld -Date: Sat Aug 3 12:47:11 2019 +0200 - - Error messages no longer wiped by clear screen - By introducing function mcleanstop, error messages are - shown after ncurses has closed the window (solves issue #67). - -M acctproc.c -M atop.c -M atop.h -M atopsar.c -M deviate.c -M netatopif.c -M photoproc.c -M photosyst.c -M rawlog.c -M showlinux.c -M various.c - -commit 1e93ac6a8e486dfda633af049c950040020373c9 -Author: Gerlof Langeveld -Date: Sat Aug 3 09:52:18 2019 +0200 - - Exchanged a TAB by spaces in front of statement - (TAB was accepted by Python2 but refused by Python3). - -M atopgpud -M man/atopgpud.8 - -commit 78f99bbfb6d54a420c404fd8c37dc4f48b7f8110 -Author: gregg leventhal -Date: Mon Jun 24 16:25:58 2019 -0400 - - Check if rawlog is a regular, seekable file. If the user does atop -r <(gunzip atop_2019_06_10.gz) for example, a failing lseek will result in a later segfault - -M rawlog.c - -commit 16abcac132eec4755373aa673389e67219488844 -Author: zhenwei pi -Date: Wed Mar 20 14:58:18 2019 +0800 - - Auto detect hypervisor and apply to perfevents - - In virtualization case, PMU in guest is emulated by hypervisor, such as - vPMU is emulated by KVM. - Currently perf in guest has overhead, typically rdpmc/wrmsr cause a lot - of vm-exits, and guest will hit a performance drop. atop should be - careful while useing perf. - - Support "perfevents" config in atoprc, which supports 3 modes: - "enable": force using perf. - "disable": force disable perf. - "auto": default mode, atop will detect hypervisor. if atop is running in - guest, auto disable perf, otherwise enable perf. - - Signed-off-by: zhenwei pi - -M atop.c -M photosyst.c - -commit 7ebca1362e7158c769770006afd61b7e4ec67211 -Author: Gerlof Langeveld -Date: Fri Jun 7 16:06:30 2019 +0200 - - Cosmetic changes. - -M rawlog.c - -commit b55f28a740258e33206443612be2d4fb80464d96 -Merge: a4e3664 25007e9 -Author: Gerlof Langeveld -Date: Fri Jun 7 15:43:31 2019 +0200 - - Merge pull request #60 from bytedance/writev-record - - Use writev to write record data - -commit 25007e9d927f8d37a9f8659d5d2122435409ee7d -Author: zhenwei pi -Date: Tue Mar 19 16:18:15 2019 +0800 - - Use writev to write record data - - Currently atop writes 3 parts of one raw record by 3 write syscall. - atop may be killed during writing record, and continue to append records - after the original log. uncompleted record data is generated. Ex, - good case : ... rr,scompbuf,pcompbuf ... rr,scompbuf,pcompbuf ... - bad case : ... rr,scompbuf[missing] ... rr,scompbuf,pcompbuf ... - - 1-writev syscall makes writing record as a atomic operation, and make sure - each raw record is completed. - - Signed-off-by: zhenwei pi - -M rawlog.c - -commit a4e3664f78d8588136696102bb9624b2ec46a54d -Author: Gerlof Langeveld -Date: Sun May 26 16:55:01 2019 +0200 - - Added comment (cosmetic change) - -M photoproc.c - -commit 1338f5f47cc4e11b7afe8f6ce5543126754ae416 -Merge: b54801c eea28ab -Author: Gerlof Langeveld -Date: Sun May 26 16:49:16 2019 +0200 - - Merge pull request #54 from pacepi/use-smaps-rollup - - Prefer to use smaps_rollup instead of smaps - -commit b54801ca81c06b073126f7f941db1d922a2f1e1c -Merge: fa4db43 e7000f7 -Author: Gerlof Langeveld -Date: Sun May 26 16:28:08 2019 +0200 - - Merge pull request #57 from gleventhal/master - - Fix unchecked opendir to prevent dereferencing a NULL pointer - -commit 20443a367d225a466aeee77cdf549fb4bd615d87 -Author: Alastair Young -Date: Fri May 24 16:53:15 2019 -0700 - - Make LOGPATH overrulable - - Moved LOGPATH declaration to before DEFAULTSFILE source, so it can be overruled - -M atop.daily - -commit e7000f778465cf4e73a60604b799a4b1c0e80b15 -Author: gregg leventhal -Date: Thu May 2 15:03:02 2019 -0400 - - Fix unchecked opendir to prevent dereferrencing a NULL pointer - -M photoproc.c - -commit 65fb301d59208692da4fec1ead38e8efbed66c33 -Author: Sjon Hortensius -Date: Mon Mar 18 13:44:23 2019 +0100 - - For systemd - replace 5 files with rotate service and timer - -M Makefile -A atop-rotate.service -A atop-rotate.timer -M atop.service - -commit eea28abb735cbf941045ade56d2c22657bf014b7 -Author: zhenwei pi -Date: Mon Jan 28 20:27:47 2019 +0800 - - Prefer to use smaps_rollup instead of smaps - - Since Linux-4.14, kernel supports "/proc/PID/smaps_rollup" to count process - Pss. - Test case on CPU Intel i7-8700K : - 1, create a virtual machine with 12G memory. - 2, count Pss for 3 time with smaps : 7176, 7221, 7182. - average 7193(microseconds). - 3, count Pss for 3 time with smaps_rollup : 1963, 1985, 1972. - average 1973(microseconds). - - smaps_rollup has better performence than smaps. We check it in first call, - and prefer to use. - - Signed-off-by: zhenwei pi - -M photoproc.c - -commit ffc8ba8d324243a923abe48e9758adecb03d24a4 -Author: Peter Kjellerstedt -Date: Tue Feb 12 21:25:23 2019 +0100 - - atop.daily, atop.init, atop-pm.sh, mkdate: Avoid using bash - - Avoid using bash and bashisms when not necesary. On some systems, - e.g., embedded products, bash may not be available by default. - - Signed-off-by: Peter Kjellerstedt - -M atop-pm.sh -M atop.daily -M atop.init -M mkdate - -commit fa4db436865887f3e451692b9439d2943b4b2936 -Author: Gerlof Langeveld -Date: Thu Feb 7 12:03:42 2019 +0100 - - Correction of PSI value 'io full' - 'I/O full' showed the same value as 'I/O some', which has been - corrected now. - -M showsys.c - -commit 58a25af78314d432a7591e536fd2d5b23666ecb4 -Author: Gerlof Langeveld -Date: Tue Jan 22 17:32:37 2019 +0100 - - Atopconvert shows version of input file and copies if needed. - When only the name of the input file is given, then atopconvert - shows the version of the input file. - When the version of the input file is already up-to-date, still - the input file is copied to the output file. - -M atopconvert.c -M man/atopconvert.1 - -commit c3073ee609509857620c58aa4d050344b63696a2 -Merge: 41333c6 4b0a957 -Author: Gerlof Langeveld -Date: Sun Jan 13 00:04:29 2019 +0100 - - Merge branch 'master' of github.com:Atoptool/atop - -commit 41333c6dab5c16b60d610bfa79f33f1f56793307 -Author: Gerlof Langeveld -Date: Sat Jan 12 23:43:59 2019 +0100 - - Various corrections. - -M rpmspec/atop.specsystemd - -commit 3ca52a7c0c9948eedd6ba25a1a902ebc6488a79f -Author: Gerlof Langeveld -Date: Sat Jan 12 22:31:10 2019 +0100 - - Prepare for version 2.4 - -M README.md -M version.h - -commit 1929641c525c259bbc2563fa979ecb97063b219e -Author: Gerlof Langeveld -Date: Sat Jan 12 20:03:41 2019 +0100 - - Support for conversion of raw files to atop 2.4 - -M atopconvert.c -M man/atopconvert.1 -M photoproc.h -M photosyst.h -A prev/photoproc_24.h -A prev/photosyst_24.h - -commit 46000ef14ff2cbd755d4e1b620e68218ea55f81f -Author: Gerlof Langeveld -Date: Sat Jan 12 13:13:37 2019 +0100 - - Introduction of Pressure Stall Information (PSI). - The average percentages of CPU, memory and I/O are reported, - as provided by kernel 4.20 onwards. - -M atopsar.c -M deviate.c -M man/atop.1 -M man/atopsar.1 -M parseable.c -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 00ffc2f338ee038e3775846b7471228935afcf54 -Author: Gerlof Langeveld -Date: Thu Jan 10 18:56:52 2019 +0100 - - Introduction of Infiniband statistics - Maintain stats about bandwidth utilization of Infiniband ports, - with atopsar (-h) and in atop system statistics. - -M atop.c -M atop.h -M atopsar.c -M deviate.c -M gpucom.c -M man/atop.1 -M man/atopconvert.1 -M man/atopgpud.8 -M man/atoprc.5 -M man/atopsar.1 -M parseable.c -M photosyst.c -M photosyst.h -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 2f71beced5f061cb1b0b783e0ede3c85e8e54b35 -Author: Gerlof Langeveld -Date: Tue Jan 8 20:12:00 2019 +0100 - - Introduction of GPU statistics - A separate daemon 'atopgpud' has been developed to maintain - statistics of Nvidia GPUs in the system. When this daemon is - running, atop will connect to this daemon via a TCP socket. - With every intreval, atop gets GPU statistics from the daemon. - -M Makefile -M atop.c -M atop.h -A atopgpu.service -A atopgpud -M atopsar.c -M deviate.c -A gpucom.c -A gpucom.h -A man/atopgpud.8 -M parseable.c -M photoproc.c -M photoproc.h -M photosyst.h -M rawlog.c -M rpmspec/atop.specsystemd -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showprocs.c -M showsys.c - -commit 4b0a957aed6370c4268d592fa6bef78aa141fe82 -Author: Gerlof Langeveld -Date: Tue Jan 8 20:06:15 2019 +0100 - - Not enough entries created to register all tasks. - Calculation has been adapted. - -M atop.c -M photoproc.c - -commit 8fe68ff3ed14bd25da93ba0480ec116a7f36b731 -Author: Gerlof Langeveld -Date: Thu Jan 3 13:30:42 2019 +0100 - - Performance improvement when gathering scaling info of CPUs - Retrieving the frequency scaling information for every single - CPU on a system with lots of CPUs is extremely time consuming. - Therefore, frequency scaling info is only gathered on systems - with 8 CPUs or less. - -M photosyst.c - -commit 4297811aa2815b247e320a00236f0650e449c328 -Author: Gerlof Langeveld -Date: Thu Jan 3 13:26:07 2019 +0100 - - Performance improvement for gathering process/thread stats - Gathering the process and threads statistics was too time - consuming, especially for the first interval. This was - extremely noticeable on systems with a lot of multi-threaded - processes. - -M atop.c -M photoproc.c -M photoproc.h - -commit a11bf6746c7998eee7ca4b9204b536062948f91c -Merge: 725dc2c 0e43049 -Author: Gerlof Langeveld -Date: Sat Dec 8 14:29:47 2018 +0100 - - Merge pull request #43 from vinc17fr/master - - Fixed va_list usage. - -commit 725dc2cb0b2785a4fa77a98a5a204c977c2a6b53 -Author: Gerlof Langeveld -Date: Sat Dec 8 14:25:06 2018 +0100 - - Removed debugging statements - -M Makefile - -commit d858714ffb0e11ea88aa582d16bb2c948a3e2fce -Author: Gerlof Langeveld -Date: Sat Dec 8 14:24:21 2018 +0100 - - Removed debugging statements - -M acctproc.c -M atop.c - -commit 1a2fbeaa823f102e988a74123b660598f143d353 -Author: Gerlof Langeveld -Date: Thu Dec 6 21:48:49 2018 +0100 - - Only lock atop in memory when the hard and soft limits could be raised. - -M atop.c - -commit 0e43049493e65b412e1c0def62a09ceac2bb3110 -Author: Vincent Lefevre -Date: Tue Dec 4 14:17:46 2018 +0100 - - Fixed va_list usage. - -M atopconvert.c -M various.c - -commit b5e7e1cad051e909824ddc12cd82b6e8269d114e -Author: Gerlof Langeveld -Date: Sun Dec 2 07:49:58 2018 +0100 - - Added additional debug statements. - -M acctproc.c - -commit 7051f61691e1be8bf06a1301dda21236d60e9dc1 -Author: Gerlof Langeveld -Date: Sat Dec 1 20:21:48 2018 +0100 - - Consistent type usage for number of processes present and terminated - -M Makefile -M acctproc.c -M acctproc.h -M atop.c -M deviate.c -M photoproc.c -M photoproc.h - -commit e163fda6396b854adfbe027380444d0402e315e9 -Merge: 2fd27e4 bae7b24 -Author: Gerlof Langeveld -Date: Sat Dec 1 18:44:16 2018 +0100 - - Merge pull request #42 from vinc17fr/master - - Fixed type mismatch in format string. - -commit bae7b244b87b1af4dc0db4bc3a59532cb88cab5d -Author: Vincent Lefevre -Date: Mon Nov 19 14:22:16 2018 +0100 - - Fixed type mismatch in format string. - -M deviate.c - -commit e9a2c492f250700ed352a650d255b60deea5c18f -Author: Vincent Lefevre -Date: Mon Nov 19 14:04:01 2018 +0100 - - Fixed type mismatch in format string. - -M atop.c - -commit 2fd27e47d70920c4c61a54c311c229e11a93c9d6 -Author: Gerlof Langeveld -Date: Tue Oct 9 14:00:25 2018 +0200 - - Removed rcsid from source files. - -M acctproc.c -M atop.c -M atopsar.c -M deviate.c -M photoproc.c -M photosyst.c -M procdbase.c -M showgeneric.c -M showlinux.c -M showprocs.c -M showsys.c -M various.c - -commit 7f48aa0294bd9be1d25e930fd6269aa78394a74f -Author: Gerlof Langeveld -Date: Tue Oct 9 13:57:13 2018 +0200 - - Added atopsar to .gitignore - -M .gitignore - -commit 7f75dcaacdc341d9b3c191b47dc4f8bcc120bf3b -Author: Gerlof Langeveld -Date: Tue Oct 9 13:54:35 2018 +0200 - - Removed .gitignore from .gitignore - -A .gitignore - -commit 2f83c2fc572162ef36659f7715a2d3527b24ef8f -Merge: 6fabd47 2c0a960 -Author: Gerlof Langeveld -Date: Tue Oct 9 13:29:55 2018 +0200 - - Merge branch 'master' of github.com:Atoptool/atop - -commit 6fabd477c3d766a294da5fd70cf984ab58b9b9f8 -Author: Gerlof Langeveld -Date: Tue Oct 9 13:25:26 2018 +0200 - - Error message and other exit code for chdir/getcwd - Previously only exit code 53 is given in case of a failing - getcwd or chdir call, without further message. - Now an error message is given combined with exit code 53 (current - directory can not be saved), 54 (can not switch to /proc) - or 55 (can not switch back to former current directory). - -M photoproc.c -M photosyst.c - -commit 2c0a9606b1596a50489d4deef124d0b349ccbfbb -Merge: 9f705ab 414127c -Author: Gerlof Langeveld -Date: Tue Oct 9 12:41:00 2018 +0200 - - Merge pull request #35 from SjonHortensius/patch-1 - - Include sysmacros.h to compile with newer gcc - -commit 9f705abee3cc757f0ca5403c71bad8c2b2c532b2 -Author: Gerlof Langeveld -Date: Tue Oct 9 12:39:25 2018 +0200 - - Removed MAJOR and MINOR macro's for better solution via include - -M photosyst.c - -commit 4742978c79d8faf5b519487e11fc25164cb3cb33 -Author: Gerlof Langeveld -Date: Sat Sep 22 12:10:34 2018 +0200 - - Document the behavior of signals SIGUSR1 and SIGUSR2 - -M man/atop.1 - -commit 7bf30c52a37118ff4f211e67e1736099f3d1dcb3 -Author: Gerlof Langeveld -Date: Sat Sep 22 11:50:50 2018 +0200 - - Own macro's added to determine major/minor of logical volume. - The standard 'minor' and 'major' macro's are not available - any more in gcc8. - -M photosyst.c - -commit 20375c1a7a3622ba2fe776e146c1a2dfc6f17fa2 -Author: Gerlof Langeveld -Date: Sat Sep 15 10:53:37 2018 +0200 - - Wrong signal number as exit code in parseable output - The exit code (or signal number) in the output of the option -PPRG - was wrong. Now the value represents the exit code if it is less - than 256 and it represents a fatal signal number if the code - is larger then 256 (then subtract 256 for the signal number). - -M man/atop.1 -M parseable.c - -commit 414127c03669b4eedc85778a7bff80cf601311d8 -Author: SjonHortensius -Date: Fri Aug 24 18:26:58 2018 +0200 - - Include sysmacros.h to compile with newer gcc - - Older gcc throws a warning - ``` - photosyst.c: In function 'lvmmapname': - photosyst.c:1465:13: warning: In the GNU C Library, "major" is defined - by . For historical compatibility, it is - currently defined by as well, but we plan to - remove this soon. To use "major", include - directly. If you did not intend to use a system-defined macro - "major", you should undefine it after including . - dmp->major = major(statbuf.st_rdev); - ``` - - Newer gcc throws an error: - - ``` - photosyst.c: In function ‘lvmmapname’: - photosyst.c:1482:19: error: called object ‘major’ is not a function or function pointer - dmp->major = major(statbuf.st_rdev); - ^~~~~ - photosyst.c:1437:25: note: declared here - lvmmapname(unsigned int major, unsigned int minor, - ~~~~~~~~~~~~~^~~~~ - ``` - -M photosyst.c - -commit 8d2d68c0dc26d457871e120a57b71be91c6dcbd7 -Author: Gerlof Langeveld -Date: Sun Aug 5 19:34:47 2018 +0200 - - Added symlink atop.spec - -A atop.spec - -commit a891eddaf4d1fca4895dfb296b6092980c147aef -Author: Gerlof Langeveld -Date: Sun Aug 5 19:31:32 2018 +0200 - - Cosmetic changes to new tool atopconvert - -M atopconvert.c - -commit 21598140df014b38b1c57cdc9303386cbd869f62 -Author: Gerlof Langeveld -Date: Sun Aug 5 15:58:40 2018 +0200 - - Finalize the modification to introduce atopconvert - -M Makefile -M atopconvert.c - -commit 335922298a6b9e788f7b0b8d7582f8ef6878636e -Author: Gerlof Langeveld -Date: Sun Aug 5 15:48:24 2018 +0200 - - Modified RPM spec files to install new tool atopconvert - -M rpmspec/atop.specsystemd -M rpmspec/atop.specsysv - -commit acc29f246900234181abe5641ae67cecf6999dc5 -Author: Gerlof Langeveld -Date: Sun Aug 5 15:33:31 2018 +0200 - - Introduce new tool atopconvert to convert raw files - The command atopconvert expect the name of an existing raw - file as first argument and the name of an output raw file - as second argument. The input file will be converted to - the output file, which will be by default the raw format - of the newest atop version. - Raw input raw files created by atop 2.0 and higher are - supported. - -M Makefile -A atopconvert.c -M man/atop.1 -A man/atopconvert.1 -A prev/photoproc_20.h -A prev/photoproc_21.h -A prev/photoproc_22.h -A prev/photoproc_23.h -A prev/photosyst_20.h -A prev/photosyst_21.h -A prev/photosyst_22.h -A prev/photosyst_23.h - -commit 25db7dfbecc258757a83c31921e60e295bd48840 -Author: Gerlof Langeveld -Date: Thu Jul 12 15:04:42 2018 +0200 - - Adapt man pages to introduce new program atopconvert - -M man/atop.1 -M man/atopsar.1 - -commit 07aad3dbfc8458eb23213ecaf02ddeaf34b55a35 -Author: Gerlof Langeveld -Date: Wed Jul 11 09:54:13 2018 +0200 - - Value of '#proc' should not include exited processes - -M showsys.c - -commit 4a104c7377c2f0f694d75b0936f2722bab652e46 -Merge: c10ed57 3a8871b -Author: Gerlof Langeveld -Date: Sat Jun 9 13:40:34 2018 +0200 - - Merge pull request #21 from Zugschlus/makefile - - make sure that all rm operations are -f to allow consecutive cleans - -commit c10ed57346e359dafe80cda8b82ab7bf829fec1b -Author: Gerlof Langeveld -Date: Sat Jun 9 13:11:51 2018 +0200 - - Modified URL of atop website - -M rpmspec/atop.specsystemd -M rpmspec/atop.specsysv - -commit 68180d5e88d4aec665582ea3d9485a89ba29ec67 -Author: Gerlof Langeveld -Date: Sat Jun 9 13:11:30 2018 +0200 - - Added depencies to build and run atop - -M README - -commit bb23382c17ce228fce315d4c398f29e80dbd34b0 -Author: Gerlof Langeveld -Date: Sat Jun 9 12:09:55 2018 +0200 - - Adapt URL in man pages (from http to https) - -M man/atopacctd.8 -M man/atoprc.5 -M man/atopsar.1 - -commit 96287919c311a17ff3c5e3d4b5ebb4507a8ddadf -Author: Gerlof Langeveld -Date: Sat Jun 9 12:06:49 2018 +0200 - - Modify default values in atop.daily script - Add possibility to override all necessary default values - in the atop.daily script, i.e. variable LOGOPTS, - LOGINTERVAL and LOGGENERATIONS. - -M atop.daily -M man/atop.1 - -commit dad4dab702a75b95c8276dbfe199a0d7018f8821 -Merge: 2bb5204 a88a541 -Author: Gerlof Langeveld -Date: Sat Jun 9 10:57:11 2018 +0200 - - Merge branch 'configurable-options' of git://github.com/Zugschlus/atop - -commit 2bb5204b93d7649608b2a6525fae3c5e2e71a1e4 -Merge: 4516bd3 9d3011d -Author: Gerlof Langeveld -Date: Sat Jun 9 10:27:53 2018 +0200 - - Merge pull request #23 from natoscott/master - - Fix string malloc length in init_proc_prints, check result - -commit a88a54107142d057e36be15285c972031a0e8c0a -Author: Marc Haber -Date: Tue Apr 24 11:42:53 2018 +0200 - - make atop options configurable, introduce config file - -M atop.daily - -commit 4516bd3300e7865f8ec1bb69ba80d42928487633 -Author: Gerlof Langeveld -Date: Mon Apr 23 13:46:23 2018 +0200 - - Additional rule to make versdate.h file. - -M Makefile - -commit 9d3011d6b81bd7f2fa9e07892a2c5f24ee7f4449 -Author: Nathan Scott -Date: Fri Jan 19 15:40:47 2018 +1100 - - Fix string malloc length in init_proc_prints, check result - -M showlinux.c - -commit 3a8871b1ba108d6ccf46246625983d3f830e998b -Author: Marc Haber -Date: Sat Dec 30 16:24:42 2017 +0100 - - make sure that all rm operations are -f to allow consecutive cleans - -M Makefile - -commit 2d615475d922ae611f8cc00cdca79ed32bd3ff33 -Author: Gerlof Langeveld -Date: Sat Dec 16 11:59:31 2017 +0100 - - Recognize if current system supports PMC event counters. - -M man/atop.1 -M parseable.c -M photosyst.c -M showsys.c - -commit db7a23d193415fef62f889f285687910d675b11f -Author: Gerlof Langeveld -Date: Wed Nov 8 21:26:11 2017 +0100 - - Remove versdate.h - -D versdate.h - -commit de8179c9b483950b633753365a9889f9d4d0d149 -Author: Gerlof Langeveld -Date: Wed Nov 8 21:25:28 2017 +0100 - - Make perf_event counter for IPC optional at compile time - -M Makefile -M showsys.c - -commit 1a9c8eb7acac64fde33d72c036a3a487cb51baf3 -Author: Gerlof Langeveld -Date: Thu Oct 5 11:19:02 2017 +0200 - - Add SCHED_DEADLINE as scheduling policy possibility. - -M showprocs.c - -commit 6dd88897ba984e67a526e0a4278f7bc4d023bae1 -Author: Gerlof Langeveld -Date: Sat Sep 23 11:20:57 2017 +0200 - - Minor modifications in description of NFS output line. - -M man/atop.1 - -commit ba10627812c347460f650c877c3f3eaee194571e -Author: Gerlof Langeveld -Date: Fri Jun 30 13:13:22 2017 +0200 - - Include file versdate.h hould be ignored. - -M versdate.h - -commit f2f6717a9c633668f3ce3de4ebf8e521bd6bc01f -Author: Gerlof Langeveld -Date: Fri Jun 30 12:53:56 2017 +0200 - - Introduce CPU instructions per cycle - - For every CPU, the average number of instructions per - CPU cycle is shown as 'ipc'. Besides, a column is shown - with the number of cycles executed per second as `cycl` - (shown as effective Hz frequency). - -M deviate.c -M man/atop.1 -M parseable.c -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c -M various.c - -commit 33d561dcc766ca27cb7d1e09a9b0f99c3d98e124 -Author: Gerlof Langeveld -Date: Fri Jun 30 12:53:08 2017 +0200 - - Variable date of last build. - -M versdate.h - -commit 5f6813c11b58e307b9f2b8d0eb66a5c68ec613de -Author: Gerlof Langeveld -Date: Wed Jun 28 21:21:00 2017 +0200 - - Modify the date string for every new version of atop/atopacctd - -M Makefile -M atopacctd.c -A mkdate -A versdate.h -M version.c -M version.h - -commit 5bcf22b32a2b2bc83802a48ee05b3451066f1fbc -Author: Gerlof Langeveld -Date: Sat Sep 23 12:49:21 2017 +0200 - - Recognize nbd devices - -M photosyst.c - -commit 4df0bcf37f8ef698afad4a528c2665b427c8e74d -Author: Gerlof Langeveld -Date: Sat Sep 23 12:38:48 2017 +0200 - - atop.init: execute script with bash instead of sh - -M atop.init - -commit 06ec90d6fc3c7d608b03a3f3d000e97a9a847955 -Merge: 0a34810 7cac234 -Author: Gerlof Langeveld -Date: Sat Sep 23 11:37:52 2017 +0200 - - Merge pull request #5 from roadrunner2/add-nvme-support - - Recognize nvme disks as such too. - -commit 0a34810d1ce704311b62adaf97d30a2f02c94bd3 -Merge: d99c19f 6bb8d2d -Author: Gerlof Langeveld -Date: Sat Sep 23 11:22:54 2017 +0200 - - Merge pull request #3 from sylmarch/sylmarch-patch-nfm-parseable-output - - Fix bytestotwrite in NFM parseable output - -commit d99c19f2e64df15ebd54a7934a39a10bd8bb9ef0 -Merge: 2b1ad6a 1acea75 -Author: Gerlof Langeveld -Date: Sat Sep 23 10:40:19 2017 +0200 - - Merge pull request #1 from sylmarch/sylmarch-patch-nfs-parseable-output - - Fix rpcread / rpcwrite in NFS parseable output - -commit 7cac2341ba7e2419267a7e9ee5e5871de744bedb -Author: Ronald Tschalär -Date: Tue May 16 18:49:14 2017 -0700 - - Recognize nvme disks as such too. - - The pattern is based on name assignment in nvme_alloc_ns() in the linux - kernel in drivers/nvme/host/core.c . - -M photosyst.c - -commit 6bb8d2d1fc53a68c3b68c998feabddf1efde033e -Author: Sylvain -Date: Fri Apr 21 16:09:31 2017 +0200 - - Fix bytestotwrite in NFM parseable output - - Fix NFS total number of bytes physically written to the server in NFM parseable output - -M parseable.c - -commit 1acea756e9863d52f973907ac06abab333c7235f -Author: Sylvain -Date: Fri Apr 21 15:40:40 2017 +0200 - - Fix rpcread / rpcwrite in NFS parseable output - - Fix NFS read/write RPC calls counters in parseable output - -M parseable.c - -commit 2b1ad6a78db3f52aec17cf675f1edacefa46a2db -Author: Gerlof Langeveld -Date: Sat Mar 25 15:09:24 2017 +0100 - - Highlights added. - -M README.md - -commit 42e86fcc42ce60f8c92f3c7d5f3a6ccde47c0b33 -Author: Gerlof Langeveld -Date: Sat Mar 25 14:36:13 2017 +0100 - - Preparation for github - -M Makefile -A version.h - -commit 2d2cf7e29fdc7ef66f005ed491477a8551c8f554 -Author: Gerlof Langeveld -Date: Sat Mar 25 14:11:32 2017 +0100 - - Markdown text addded - -A README.md - -commit a8d850d06efc8d70a19f55ec93fe83df51e99077 -Author: Gerlof Langeveld -Date: Sat Mar 25 13:06:05 2017 +0100 - - Preparation for github - -M Makefile -A version.c - -commit 6dac6bc7dc2adf27a3414955b8791db75c6a7397 -Author: Gerlof Langeveld -Date: Sat Mar 25 12:46:25 2017 +0100 - - Preparation to move atop to github - -D mkdistr -D mkversion - -commit 5f101e656a24271726d1e9cd672631b6033c36c1 -Author: Gerlof Langeveld -Date: Sat Mar 25 12:40:23 2017 +0100 - - Preparations to move atop to github - -D atop.specsystemd -D atop.specsysv -T netatop.h -T netatopd.h -A rpmspec/atop.specsystemd -A rpmspec/atop.specsysv - -commit 8ce799fdd3bb50978c00735cc72bbeb2c70d6844 -Author: Gerlof Langeveld -Date: Fri Mar 24 08:54:05 2017 +0100 - - Adapt man page for showing full process list for memory sorting - -M man/atop.1 - -commit 3105ce8d46562cb48081cb92eaee0afbda05166c -Author: Gerlof Langeveld -Date: Fri Mar 24 08:35:17 2017 +0100 - - Show full process list when sorting on memory is active - -M showgeneric.c - -commit 35869466fc30f318ac404454c322bad039033251 -Author: Gerlof Langeveld -Date: Fri Mar 17 16:32:30 2017 +0100 - - Solved segmentation fault - - Segmentation fault occurred in case of a selection - (e.g. on user) in combination with switching from - active processes to all processes. - -M atop.h -M photoproc.c -M rawlog.c -M showgeneric.c -M showprocs.c - -commit eaeb7c500820cccc7bf25606a86c4843cd70ad31 -Author: Gerlof Langeveld -Date: Fri Mar 17 11:25:46 2017 +0100 - - Type in man page - -M man/atop.1 - -commit 630d66700ca38ddda24d1797636d498e1e600866 -Author: Gerlof Langeveld -Date: Thu Mar 9 08:30:57 2017 +0100 - - Corrected accumulated disk writes - - When accumulating disk writes for programs, users or - containers, values were accumulated twice per process. - -M showgeneric.c - -commit 989185c62c3a023e80bb9b2a5bb2e5563cda1651 -Author: Gerlof Langeveld -Date: Tue Mar 7 14:10:33 2017 +0100 - - Determine containerid per process generically - - The containerid of a process is determined via - the file /proc/PID/cpuset that sometimes contains - ".../docker-CONTAINERID" (on e.g. Redhat/CentOS) - and sometimes "/docker/CONTAINERID" (e.g. Ubuntu). - Both layouts should be supported. - -M photoproc.c - -commit 6678463533947894e06b178c84213c17a5faae98 -Author: Gerlof Langeveld -Date: Tue Mar 7 10:23:21 2017 +0100 - - Code optimizations releated to Docker containers - -M photoproc.c -M showlinux.c - -commit fae417d905f6425035df0d3a4c99ddfa61b54e60 -Author: Gerlof Langeveld -Date: Mon Mar 6 19:20:37 2017 +0100 - - Smaal correction on the man page description of CID. - -M man/atop.1 - -commit ef95f26bdad331b441fbeae2148b0352889256fd -Author: Gerlof Langeveld -Date: Mon Mar 6 15:51:47 2017 +0100 - - Introduce Docker container statistics - - Maintain the Docker container id (12 positions) per - process and per thread. This container id will be shown - in various lists as CID, but only if at least one Docker - container is present. - Furthermore, it is possible to select all processes - and threads that are related to a specific container id - (keystroke 'J') and to accumulate the resource consumption - for all processes/threads per container (keystroke 'j'). - -M atop.h -M man/atop.1 -M parseable.c -M photoproc.c -M photoproc.h -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showprocs.c - -commit 0dc5a116cdbe8b1ccd6a0c3784e23a0e7e7abe41 -Author: Gerlof Langeveld -Date: Fri Feb 24 15:55:28 2017 +0100 - - Solved segmentation fault in case of threadview - - Sometimes a process is considered to be inactive while one of its - threads appears to be active. This situation could lead to a - segmentation fault in case of threadview of only active tasks. - It has been solved by marking the inactive process as active when - later on a thread is discovered that appears to be active. - -M deviate.c - -commit b4811a24801d8c35b64ab3c1b919418e934bb957 -Author: Gerlof Langeveld -Date: Fri Feb 24 13:16:06 2017 +0100 - - Determine maximum number of digits in PID/TID - - Since the maximum PID number may vary (/proc/sys/kernel/pid_max), - the width of PID/PPID/TID/... columns should be determined dynamically. - -M showlinux.c -M showprocs.c - -commit eb30f1d229cb5ac2c4b3ffe639c1efc8cbf70b72 -Author: Gerlof Langeveld -Date: Fri Feb 24 09:58:40 2017 +0100 - - Add dependency between version.c and version.h - -M Makefile - -commit fc0a5d5f15d5ffcf2203f95d290ce4e046ad1840 -Merge: f498827 0aa208a -Author: Gerlof Langeveld -Date: Thu Feb 23 13:57:46 2017 +0100 - - Polling mode when NETLINK refuses with error EINVAL - - Due to kernel bug 190711, the NETLINK interface gives EINVAL when - it is activated. Since atopacctd misses a trigger then to read the - process accounting records when processes in the system terminate, - a polling loop has to be used to verify the existance of new - process accounting records. - -commit f49882721e5dbb065038ba74ae44b85457f50645 -Merge: 17b2911 51d6285 -Author: Gerlof Langeveld -Date: Thu Feb 23 13:53:53 2017 +0100 - - Retry activation of process accounting after failure - - According to kernel bug 190271 (process accounting sometimes - does not work), the kernel sometimes returns SUCCESS to switching - on process accounting while it does not work at all. - -commit 17b2911b172eaeafe9f0b8e0bd7e721d1766b81e -Merge: e402891 e743f1b -Author: Gerlof Langeveld -Date: Thu Feb 23 13:52:43 2017 +0100 - - Modified version numbering (without dashes) - -commit e4028912e77cb1b092cae20173b4c3dea34971fe -Author: Gerlof Langeveld -Date: Thu Feb 23 13:34:09 2017 +0100 - - Modify the date in the man pages - -M man/atop.1 -M man/atopacctd.8 -M man/atoprc.5 -M man/atopsar.1 - -commit eb10042167d1d3b72049619c36deeaf7f272d4fe -Merge: c873d6c c8e2e3f -Author: Gerlof Langeveld -Date: Thu Feb 23 13:29:45 2017 +0100 - - Improved error handling on the NETLINK interface - - Properly check the error values that are returned via the - field nlmsg_type. - -commit c873d6c1eddcbfb3bd84a350684d7d7163aae377 -Merge: 5ad6f1d 2b6aab6 -Author: Gerlof Langeveld -Date: Thu Feb 23 13:27:49 2017 +0100 - - Also show xvd... disk drives without a digit at the end of the name - -commit 5ad6f1dffae71cae39685e2883a8a178a40a6531 -Merge: 78c478a 51b4a83 -Author: Gerlof Langeveld -Date: Thu Feb 23 13:25:06 2017 +0100 - - Atopacctd should terminate upon receipt of SIGTERM signal - - When activating a signal catcher via the signal() function, - the SA_RESTART flag is implicitly set. This means that a - pending system call is automatically restarted after the - received signal is handled. Instead, the sigaction() system - call is used now to activate a signal catcher avoiding system - calls to be restarted automatically. - -commit 78c478a56f4281ce5e2d28d0fa9822ad4b7d6a37 -Merge: 46bc6d7 2a6f792 -Author: Gerlof Langeveld -Date: Thu Feb 23 13:21:03 2017 +0100 - - Improved activation and deactivation of process accounting - - When atopacctd is started, it forks itself for proper daemonizing - purposes. The first process no longer exits immediately, but is - killed by the child process at the moment that atopacctd has - finished the initialization phase. - -commit 46bc6d7da1d47eeb73f55497e562019b59c527f7 -Author: Gerlof Langeveld -Date: Wed Feb 22 15:52:15 2017 +0100 - - Script atop.daily located in /usr/share/atop instead of /etc/atop.d - -M Makefile -M atop.cronsysv -M atop.init -M atop.service -M atop.specsystemd -M atop.specsysv -M man/atop.1 -M psaccu_atop - -commit 0aa208a0af7bb384010f7332b3131c0884edcdd8 -Author: Gerlof Langeveld -Date: Mon Dec 19 19:17:28 2016 +0100 - - Implemented polling mode in case NETLINK refuses with error EINVAL. - - Due to kernel bug 190711, the NETLINK interface gives EINVAL when - it is activated. Since atopacctd misses a trigger then to read - the process accounting records when processes in the system terminate, - a polling loop has to be used to verify the existance of new - process accounting records. - -M README -M atopacctd.c - -commit 51d6285f97b2adf8f0efbea7121f4eb2a4b4f75d -Author: Gerlof Langeveld -Date: Mon Dec 19 16:05:18 2016 +0100 - - Retry activation of process accounting if it appears not to work. - - According to kernel bug 190271 (process accounting sometimes does not work), - the kernel sometimes returns SUCCESS to switching on process accounting - while it does not work at all. - -M atopacctd.c - -commit e743f1b749d3fccb95bcef6028c238560a81d805 -Author: Gerlof Langeveld -Date: Thu Dec 15 10:13:48 2016 +0100 - - Modified version numbering. - -M mkdistr - -commit 96f0613201da8cb7e8ebd1120dd18f83abc83536 -Author: Gerlof Langeveld -Date: Thu Dec 15 09:12:15 2016 +0100 - - Adapt date in man-pages. - -M man/atop.1 -M man/atopacctd.8 -M man/atoprc.5 -M man/atopsar.1 - -commit c8e2e3f80fc46463c3e2c798b8a4d2a106ac98a5 -Author: Gerlof Langeveld -Date: Thu Dec 15 09:11:25 2016 +0100 - - Improved error handling on the NETLINK interface. - -M atopacctd.c -M netlink.c - -commit 2b6aab6454c39903a5ead4c3d5d819393ec1cea1 -Author: Gerlof Langeveld -Date: Wed Nov 16 14:42:49 2016 +0100 - - Allow xvd... disk drives without a digit at the end of the name. - -M photosyst.c - -commit 51b4a83b2babf9ca944da892092e5559d9588594 -Author: Gerlof Langeveld -Date: Thu Oct 27 22:05:43 2016 +0200 - - Take care that atopacctd terminates upon receipt of SIGTERM signal. - When activating a signal catcher via the signal() function, the SA_RESTART - flag is implicitly set. This means that a pending system call is - automatically restarted after the received signal is handled. - Instead, the sigaction system call is used now to activate a signal catcher - avoiding system calls to be restarted automatically. - -M atopacctd.c - -commit f0516657b3c7261c336f1b6e869afd9baa43d197 -Author: Gerlof Langeveld -Date: Mon Oct 24 16:13:46 2016 +0200 - - Changed 'rotate 1' into 'rotate 0' (no need for another dummy file). - -M psaccs_atop -M psaccu_atop - -commit 7617354131f9a9bb1503b89b82cc8ca939c0f472 -Author: Gerlof Langeveld -Date: Mon Oct 24 16:12:35 2016 +0200 - - Changed 'rotate 1' into 'rotate 0' (no need for another dummy file). - -M psaccs_atop -M psaccu_atop - -commit 2a6f792ad71410a75ca633ff38cb52a678cc05ed -Author: Gerlof Langeveld -Date: Fri Oct 14 21:34:08 2016 +0200 - - Improved activation and deactivation of process accounting. - -M atopacctd.c - -commit 6484680418827937064c2aba11619369e189d94d -Author: Gerlof Langeveld -Date: Sat Oct 8 15:23:43 2016 +0200 - - Script atop.daily located in /usr/share/atop instead of /etc/atop.d - -M Makefile -M atop.cronsysv -M atop.init -M atop.service -M atop.specsystemd -M atop.specsysv -M psaccu_atop - -commit 101c0139e1a703479f7fb779bc258cf199eaa9fb -Author: Gerlof Langeveld -Date: Sat Oct 8 14:31:52 2016 +0200 - - Raw logging: Determine features per sample - Define per sample whether or not process accounting is active and - whether or not disk I/O statitics are maintained. - In previous versions, this was determined for the entire log file - which implied that it was impossible to append to an existing logfile - when one of these features had changed. - -M atop.h -M rawlog.c - -commit 36b9b09ac15519187717481ac79da25e66bce8eb -Author: Gerlof Langeveld -Date: Sat Oct 8 14:21:42 2016 +0200 - - Moved accounting file from /tmp to /var/cache. - -M acctproc.c -M man/atop.1 - -commit a44bafe1895515e92881225079d56bb04053c9cf -Author: Gerlof Langeveld -Date: Sat Oct 8 14:18:13 2016 +0200 - - Added -r y... flag to usage message. - -M atopsar.c - -commit 2f7369f6911cc0fe6bb79dfa11ea845ebb036ea0 -Author: Gerlof Langeveld -Date: Sat Oct 8 14:16:29 2016 +0200 - - The flag -V has been added to the help-output. - -M atop.c - -commit a31b5a516e0dcfa5352e1047defbd6abf3c22444 -Author: Gerlof Langeveld -Date: Sat Oct 8 14:12:13 2016 +0200 - - Modified column name SNETBW to BANDWO. - Modified column name RNETBW to BANDWI. - -M showlinux.c -M showlinux.h -M showprocs.c - -commit 5b21d88014fe4e53a5ab8f01d03ae00a2de56a18 -Author: Gerlof Langeveld -Date: Sat Oct 8 14:05:15 2016 +0200 - - Cosmetic changes in distribution script. - -M mkdistr - -commit b96168f473ca8a69884d900464cfb5f641e18d26 -Author: Gerlof Langeveld -Date: Sat Oct 8 14:03:55 2016 +0200 - - Cosmetic change. - -M various.c - -commit 90a3f939d5db6a41e1352f847f8719a89e5ddf78 -Author: Gerlof Langeveld -Date: Sat Oct 8 14:03:35 2016 +0200 - - Recalculate length of nodename when reading raw logfile. - -M rawlog.c - -commit 3fd998d0f2e43e57ff8d5d22b747efb14c1da554 -Author: Gerlof Langeveld -Date: Sat Oct 8 14:03:18 2016 +0200 - - Remove include of termio.h (not needed at all). - -M showgeneric.c -M showlinux.c -M showprocs.c -M showsys.c - -commit 2820b1144ce403c7917cd2e09b05e78d2c9dbc07 -Author: Gerlof Langeveld -Date: Sun Sep 18 14:36:54 2016 +0200 - - Moved accounting file from /tmp to /var/cache. - -M acctproc.c -M man/atop.1 - -commit e5a1be40373ebedf5bffede8968304fd3e0e8a18 -Author: Gerlof Langeveld -Date: Sat Sep 17 10:12:29 2016 +0200 - - Raw logging: dDetermine features per sample - - Define per sample whether or not process accounting is active and - whether or not disk I/O statitics are maintained. - In previous versions, this was determined for the entire log file - which implied that it was impossible to append to an existing logfile - when one of these features had changed. - -M atop.h -M rawlog.c - -commit fec3f38c9b08459dea1a86fcdef56e97d211c1b6 -Author: Gerlof Langeveld -Date: Tue Sep 13 18:50:31 2016 +0200 - - Added -r y... flag to usage message. - -M atopsar.c - -commit e721b7194acb0f3de893d22e733f96c93172b5b7 -Author: Gerlof Langeveld -Date: Thu Sep 1 19:06:44 2016 +0200 - - Improved performance data gathering: - All process and thread related data is stored now - by function deviattask(), independent if the user - wants to view all data. In this way, immediate - reaction is garanteed for the 'a' key which allows - the user to view all processes/threads or to view - only the active processes/threads (previously, - the 'a' key was only effective after taking a new - sample). - Together with this modification, the behaviour of - the 'm' key (memory view) has changed by showing - automatically all processes instead of only the - active processes. After all, when viewing the memory - consumption of the processes, it is not relevant - whether or not that process has been active in the - last interval. - -M 45atoppm -M atop.c -M atop.daily -M atop.h -M atopsar.c -M deviate.c -M man/atop.1 -M parseable.c -M parseable.h -M photoproc.h -M rawlog.c -M showgeneric.c -M showgeneric.h -M showlinux.c - -commit 9f1bfee3f0babf88e86c8258bad977885eef279e -Author: Gerlof Langeveld -Date: Thu Aug 11 15:55:50 2016 +0200 - - The flag -V has been added to the help-output. - -M atop.c - -commit ba0cdc1474cebcbdac52b3ee9cc8516b33eeb0e8 -Author: Gerlof Langeveld -Date: Thu Aug 11 15:55:18 2016 +0200 - - With 'make clean' also the executable files are removed now. - -M Makefile - -commit 057c27d5f7b5e2b9ab06a91bed831d14dd7fe16b -Author: Gerlof Langeveld -Date: Mon Mar 7 12:16:06 2016 +0100 - - Modified column name SNETBW to BANDWO. - Modified column name RNETBW to BANDWI. - -M showlinux.c -M showlinux.h -M showprocs.c - -commit 835d9a22dd88756709d75104550b206147c4151f -Author: Gerlof Langeveld -Date: Mon Mar 7 12:15:31 2016 +0100 - - Cosmetic change in distribution script. - -M mkdistr - -commit d600eac843b87cdfb91a6e1807d3aff5915dfdea -Author: Gerlof Langeveld -Date: Wed Jan 13 08:42:58 2016 +0100 - - Cosmetic fix. - -M various.c - -commit c2370bda4689217cefe60d1760d29fe1397436a4 -Author: Gerlof Langeveld -Date: Mon Nov 30 15:26:21 2015 +0100 - - Recalculate length of nodename when reading raw logfile. - -M rawlog.c - -commit a2306c0e1c83f5a123ce521a34d9efaa2297c26d -Author: Gerlof Langeveld -Date: Mon Nov 30 15:24:17 2015 +0100 - - Remove include of termio.h (not needed at all). - -M showgeneric.c -M showlinux.c -M showprocs.c -M showsys.c - -commit 1c72c7dfe0843087440598e4df9dc844c2eff1eb -Author: Gerlof Langeveld -Date: Tue Nov 24 10:21:49 2015 +0100 - - The top-3 of CPU, disk and network consuming processes now only shows - processes that really used capacity of that resource. Implicitly, a - segmentation fault bug has been solved that occurred when less than - 3 processes were available anyhow. - -M atopsar.c - -commit 1c5cac40d0bec5ea9b9625a8c61a4ad38899aad9 -Author: Gerlof Langeveld -Date: Tue Nov 24 08:59:37 2015 +0100 - - Column that show interface speed is shifted to the right, to keep - input and output packets for all layers aligned. - -M showlinux.c - -commit 29012c89cacd30aa3c0f83e9f4c92b720ceda901 -Author: Gerlof Langeveld -Date: Tue Aug 4 19:11:36 2015 +0200 - - Execpath has been changed to /usr/sbin instead of /sbin - (wrong directory location). - -M atopacct.service - -commit 0f502b2633bb00a340daf8ff0ac3506d486a1e09 -Author: Gerlof Langeveld -Date: Tue Aug 4 19:08:25 2015 +0200 - - Bug solution: - When starting atop via sudo, atop runs into - the stopped state. Caused by earlier modification - to make atop a process group leader (needed for systemd). - Problem solved by making atop only a process group leader - when it doesn't operate interactively. - -M atop.c - -commit c0062f3e5a2604b3e8f0723e50c0cea0931d3e01 -Author: Gerlof Langeveld -Date: Thu Jun 25 12:54:30 2015 +0200 - - Modified handling of release number. - -M mkdistr - -commit 8becf63a08ba68ece7543512426cffa36e5c9c01 -Author: Gerlof Langeveld -Date: Thu Jun 25 12:53:44 2015 +0200 - - Modified handling of release number. - -M atop.specsystemd -M atop.specsysv - -commit c213a40de6884129877b1519400de362a64b1f37 -Author: Gerlof Langeveld -Date: Thu Jun 25 12:53:14 2015 +0200 - - Added some blank fields for interfaces. - -M showlinux.c - -commit 67f5b44cbd2ef5ad3a59e09a6e192af489300a52 -Author: Gerlof Langeveld -Date: Tue Jun 23 16:55:30 2015 +0200 - - Minor bug-fixes. - -M man/atop.1 -M showgeneric.c - -commit 6f0105972808ffd852b833ed81c222f259bc762a -Author: Gerlof Langeveld -Date: Tue Jun 23 16:32:16 2015 +0200 - - New selection possibilities for processes: - Key 'I' can be used to specify one or more PIDs of processes - to be selected. - Key '/' can be used to specify a command line search string for processes - to be selected. - -M man/atop.1 -M showgeneric.c -M showgeneric.h - -commit d8f641ecca0ac117c2eacd33cc6517944461a0af -Author: Gerlof Langeveld -Date: Tue Jun 23 14:44:49 2015 +0200 - - Bugfix for buffer overflow: snprintf instead of sprintf (credits: Nathan Scott). - -M showsys.c - -commit 8b82505a8125cf5b351b6de841cf6cd35740b133 -Author: Gerlof Langeveld -Date: Tue Jun 9 12:30:36 2015 +0200 - - Fine-tune statistics about data transfer to/from NFS servers. - -M atopsar.c -M man/atop.1 -M man/atopsar.1 - -commit 7c2b2cb6615a20e7e130a2fe00d4d029e0f5f3fa -Author: Gerlof Langeveld -Date: Tue Jun 9 11:03:10 2015 +0200 - - Bug solutions and small modifications for nfs4 mountstats. - -M atop.h -M deviate.c -M man/atop.1 -M photosyst.c -M showlinux.c -M showprocs.c -M showsys.c -M various.c - -commit e3d0e1f03ac0cc48c5add560377933a3abf8ddbe -Author: Gerlof Langeveld -Date: Mon Jun 8 17:31:58 2015 +0200 - - Added statistics per mounted NFS filesystem (label NFM). - -M atop.c -M atop.h -M atopsar.c -M deviate.c -M man/atop.1 -M man/atoprc.5 -M man/atopsar.1 -M parseable.c -M photosyst.c -M photosyst.h -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 314a64d9c62b27747d23c6f85011411076482f51 -Author: Gerlof Langeveld -Date: Mon Jun 8 10:01:05 2015 +0200 - - Solved various small bugs found by clang-analyzer. - -M atopsar.c -M parseable.c -M rawlog.c -M showlinux.c -M various.c - -commit 9b621bcac274df21012a42a2d131143e5857a47a -Author: Gerlof Langeveld -Date: Fri May 29 08:42:05 2015 +0200 - - Added buffers for formatting HTTPSTATS-specific output. - -M showlinux.c - -commit 66e4b0326d8663b8cc26cde42c9d1232e1742714 -Author: Gerlof Langeveld -Date: Fri May 22 09:58:22 2015 +0200 - - Accept 'xvd[a-z]' disks with a number behind it (they always seem to - end with a number). - -M photosyst.c - -commit 7d5f789ddbbaea7ae0e4d2c3f78a3f735ca3a36f -Author: Gerlof Langeveld -Date: Mon May 18 08:58:41 2015 +0200 - - Rebuild of lost spec file for systemd. - -M atop.specsystemd - -commit 94f3da8d2740aaa3abfa7974afa900d985b8a9be -Author: Gerlof Langeveld -Date: Mon May 18 08:55:18 2015 +0200 - - Maintain current speed (rate) for wireless interfaces. - -M atopsar.c -M deviate.c -M ifprop.c -M ifprop.h -M man/atop.1 -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 4ae902d49e3207c70153db2bbb8a3eed775c7c4a -Author: Gerlof Langeveld -Date: Sat May 9 18:01:12 2015 +0200 - - Support systemV and systemd RPMs. - -M atop.specsystemd -M atop.specsysv -M mkdistr - -commit b7b704f4406c92d9c5cda53a4c72bb37afeea744 -Author: Gerlof Langeveld -Date: Sat May 9 17:58:00 2015 +0200 - - Added defined value SPEED_UNKNOWN for older releases. - -M ifprop.c - -commit ab95f1a444a5e796641012bf3aa85a70f8056760 -Author: Gerlof Langeveld -Date: Sat May 9 16:27:17 2015 +0200 - - Support of systemv and systemd RPMs. - -M mkdistr - -commit 0f9e3cfeb31450ced24375631c6130e9fef60ae8 -Author: Gerlof Langeveld -Date: Sat May 9 16:21:31 2015 +0200 - - Support for OpenVZ containers. - -M atop.c -M atop.h -D atop.spec -M deviate.c -M man/atop.1 -M man/atoprc.5 -M parseable.c -M photoproc.c -M photoproc.h -M photosyst.c -M photosyst.h -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showprocs.c -M showsys.c - -commit b77825747f165a7c3bd76353d8f428676732cedd -Author: Gerlof Langeveld -Date: Sat May 9 16:20:24 2015 +0200 - - Separate RPM spec files for SystemV init and systemd. - -A atop.specsystemd -A atop.specsysv - -commit 8f0148d9946344fe9b8a5eeee5a20588e0b149dd -Author: Gerlof Langeveld -Date: Tue Apr 7 13:02:58 2015 +0200 - - Addition of NFS (server/client) statistics on system level. - -M Makefile -M atopsar.c -M deviate.c -M man/atop.1 -M man/atopsar.1 -M parseable.c -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 6e133e74acd987e915d7edeb4dab281ed8a055e2 -Author: Gerlof Langeveld -Date: Tue Mar 24 15:52:11 2015 +0100 - - Add NFS client and NFS server statistics. - -M atopsar.c -M deviate.c -M man/atop.1 -M man/atopacctd.8 -M man/atoprc.5 -M man/atopsar.1 -M parseable.c -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 6da40d213f14865356956b196475c080be1c79e6 -Author: Gerlof Langeveld -Date: Tue Mar 24 08:36:51 2015 +0100 - - Minor modification related to systemd-based install. - -M Makefile - -commit 04276882956a196e872fca17fb1dd73289eb3d1f -Author: Gerlof Langeveld -Date: Wed Feb 25 15:26:55 2015 +0100 - - Prepare atop and atopacct for use on systemd-based systems. - -M Makefile -M README -A atop-pm.sh -M atop.service -M atopacct.init -A atopacct.service -M atopacctd.c -M atopacctd.h -M mkdistr - -commit 1e2fc1c2275d71114a62fe95ca7363a6d9d1cd8a -Author: Gerlof Langeveld -Date: Wed Feb 25 15:20:05 2015 +0100 - - Avoid negative utilization counters for disks and logical volumes. - These negative values might cause buffer overflows within atop. - -M showsys.c -M various.c - -commit 2c5327f1a0a6797383785e6893b46f39d3a67c85 -Author: Gerlof Langeveld -Date: Tue Feb 24 09:34:52 2015 +0100 - - Avoid that process accounting is reactivated too frequently - (and unnecessary). - -M atopacctd.c - -commit cfda21540a2a9b6545259ed612f8afc22b2218b8 -Author: Gerlof Langeveld -Date: Tue Feb 24 09:32:41 2015 +0100 - - Added creation of the SBINPATH directory for atopacctd. - -M Makefile - -commit 688f446ab5fb81dc6c44c065f956913682d1b03f -Author: Gerlof Langeveld -Date: Mon Feb 2 08:32:57 2015 +0100 - - Prepare systemd-based installation. - -A atop.cronsystemd -A atop.cronsysv - -commit ab8db5f44f1b4edff624c4698849e391588e0cbd -Author: Gerlof Langeveld -Date: Mon Feb 2 08:31:33 2015 +0100 - - Prepare systemd-based installation. - -M Makefile -M atop.c -D atop.cron -M atop.daily -M atop.init -M atop.service -M mkdistr -M psaccs_atop -M psaccu_atop - -commit a5e0d6d0c758ce8ecc3ba6f8df2c30df8af64cc2 -Author: Gerlof Langeveld -Date: Mon Dec 8 09:38:47 2014 +0100 - - Define proper line speed for network interfaces faster than 1 Gbit/sec. - -M ifprop.c - -commit d18f067446deb39933b21ba7b2874ea63cb47e71 -Author: Gerlof Langeveld -Date: Fri Oct 17 14:31:27 2014 +0200 - - Minor change. - -M mkdistr - -commit 52e9c4a0f05f76ab81d46dc1f42ac69f5e123ae5 -Author: Gerlof Langeveld -Date: Fri Oct 17 14:28:10 2014 +0200 - - Minor correction in man-page. - -M man/atopacctd.8 - -commit c18d1354898e8871f75dedc8e8427694606b3832 -Author: Gerlof Langeveld -Date: Thu Aug 28 13:52:57 2014 +0200 - - Correction of typo's in the man pages, including a wrong counter name - in the output of atop ('udpie' for UDP input errors). - -M Makefile -M man/atop.1 -M man/atopacctd.8 -M man/atoprc.5 -M man/atopsar.1 -M showsys.c - -commit 4e739738da3aa5931cc0f66c7d402dea50ca6f6f -Author: Gerlof Langeveld -Date: Thu Aug 28 11:51:13 2014 +0200 - - OpenVZ support: virtual environment identifier per process (envID). - -M photoproc.c -M photoproc.h -M showlinux.c -M showlinux.h -M showprocs.c - -commit 3bd1bab7bd6fb0ec110922afbb169264a335a74f -Author: Gerlof Langeveld -Date: Fri Jul 25 15:31:42 2014 +0200 - - Activate atopacctd before activating the atop daemon. - -M atop.spec - -commit 0d02d0565b6d0df1c22be3237d145b7e0b7e68eb -Author: Gerlof Langeveld -Date: Fri Jul 25 14:58:19 2014 +0200 - - Improved help screen handling: use space bar to get next page. - -M showgeneric.c - -commit 5cebf4101c11d4680e57250635c6148b104bf4f9 -Author: Gerlof Langeveld -Date: Fri Jul 25 13:48:37 2014 +0200 - - Bug solution: when the screen-width is larger than the total number of - columns to be printed, empty columns are added, however one column too many. - -M showsys.c - -commit b25ef4ec59240c58e929c93d17d42c91cf70121e -Author: Gerlof Langeveld -Date: Fri Jul 25 13:48:09 2014 +0200 - - Removed useless empty column for memory statistics. - -M showlinux.c - -commit 38163c1230c5e58890e783dd1cb29e14640e6099 -Author: Gerlof Langeveld -Date: Fri Jul 25 13:47:36 2014 +0200 - - Cosmetic change. - -M atopacctd.c - -commit 636fa8df11c99b3d6468f4c13c830c29ba79638d -Author: Gerlof Langeveld -Date: Thu Jul 24 16:07:01 2014 +0200 - - Detect if process accounting has been switched off by some other - program and switch it on again. - -M atopacctd.c -M atopacctd.h - -commit 268750adfc4e4a00050501d9c70d56436b4bb0a6 -Author: Gerlof Langeveld -Date: Sat Jun 28 11:15:17 2014 +0200 - - Add a warning about the aggregation of disk transfer to the parent process - for the RDDSK and WRDSK counters. - -M man/atop.1 - -commit 1396164f8a5c880dc14658cc69a685babf040739 -Author: Gerlof Langeveld -Date: Fri Jun 20 14:51:53 2014 +0200 - - Add automatic start of atopacctd daemon. - -M Makefile - -commit 0dcc489d0ded0b2d2241cd9a625fd5206ddb7cd6 -Author: Gerlof Langeveld -Date: Fri Jun 20 14:06:08 2014 +0200 - - Add man page of atopacctd. - -M atop.spec -M mkdistr - -commit 5295539f7b7ba1e725d20caf92eb9d28e1dd87ce -Author: Gerlof Langeveld -Date: Fri Jun 20 13:52:16 2014 +0200 - - Add man page for the atopacct daemon. - -A man/atopacctd.8 - -commit 027c748ffcb1a4ee926a3c14f2241342a2e6c5bd -Author: Gerlof Langeveld -Date: Fri Jun 20 13:49:14 2014 +0200 - - Modify the man pages and installation procedures for the introduction - of the atopacctd daemon. - -M Makefile -M atop.spec -M atopacctd.c -M man/atop.1 -M man/atoprc.5 -M man/atopsar.1 - -commit 366622d86d3716661ad36b86bbe833bc9ce29496 -Author: Gerlof Langeveld -Date: Wed Jun 18 13:24:49 2014 +0200 - - Introduce the 'G' key to suppress showing/accumulating exited processes - in the output. - -M man/atop.1 -M man/atoprc.5 -M showgeneric.c -M showgeneric.h - -commit a7668eb60ebda954dd8223e4a501b21afdea4cec -Author: Gerlof Langeveld -Date: Fri Jun 13 07:55:33 2014 +0200 - - Support CPU frequencies for systems with Intel P-state driver. - Credits: Sjon Hortensius - -M photosyst.c - -commit 8e269cc3a8df55852490b8b99148b0f973e3d334 -Author: Gerlof Langeveld -Date: Fri Jun 13 07:51:55 2014 +0200 - - Cosmetic change. - -M atopacctd.c - -commit f12727d632052e6a82149d6e4804e354f2caae54 -Author: Gerlof Langeveld -Date: Fri Jun 13 07:50:25 2014 +0200 - - Remove rc-scripts with old sequence numbers (if any). - -M Makefile - -commit 7cec49a8d095e4d520ffe7f21499a7996137fc78 -Author: Gerlof Langeveld -Date: Sat Jun 7 12:47:29 2014 +0200 - - Doubled the %-signs to get the proper date string. - -M atop.service - -commit 9b699e1c0aea4842609f53ba0df061b568aa6d13 -Author: Gerlof Langeveld -Date: Sat Jun 7 12:11:52 2014 +0200 - - Source file netlink.c compiled without -O2 due to a strict-aliasing - warning. - -M Makefile - -commit c1963ca5c51ccc8dba9866238376d49ffece962a -Author: Gerlof Langeveld -Date: Sat Jun 7 12:09:34 2014 +0200 - - Source file netlink.c compiled without -O2 due to a strict-aliasing - warning. - -D atopacctd - -commit f2f369b2c79117aa03ce393e9cb54eab3bc36009 -Author: Gerlof Langeveld -Date: Sat Jun 7 11:29:36 2014 +0200 - - Rename variables to clearly distinghuish between the two - semaphore groups. - -M acctproc.c - -commit 35ded9cabe93b4f6a126711d31dbe3fdfd3d3ebe -Author: Gerlof Langeveld -Date: Sat Jun 7 11:28:46 2014 +0200 - - Add the -R flag to gather PSIZE info in the background. - -M 45atoppm -M atop.service - -commit d2a545c15bf4e3099d4391f24d20b079a5759872 -Author: Gerlof Langeveld -Date: Fri Jun 6 08:49:35 2014 +0200 - - Introduction of new daemon atopacctd. This daemon switches on - process accounting and transfers every accounting record to an - accounting shadow file. The source accounting file will regularly - be truncated, while the shadow files are written with a limited - size in a queued way. Non-used shadow files are deleted regularly. - -A atopacct.init -A atopacctd -A atopacctd.c -A atopacctd.h -A netlink.c - -commit b3909dd3243a7011ee605ed387692dcb0d8e17de -Author: Gerlof Langeveld -Date: Fri Jun 6 08:44:54 2014 +0200 - - Introduction of new daemon atopacctd. This daemon switches on - process accounting and transfers every accounting record to - an accounting shadow file. The source accounting file will - regularly be truncated, while the shadow files are written - with a limited size in a queued way. Non-used shadow files - are deleted regularly. - -M Makefile -M acctproc.c -M acctproc.h -M atop.c -M atop.init -M atop.spec -M man/atoprc.5 -M showgeneric.c - -commit 65abbee8fe9f4ea4ec7c875e897d1aa3a5b2763d -Author: Gerlof Langeveld -Date: Thu May 29 13:24:55 2014 +0200 - - Add the -R flag for monitoring in the background. - -M atop.service - -commit 295585730cbbe322d0dd556c45413e2ab0737099 -Author: Gerlof Langeveld -Date: Wed May 28 16:59:54 2014 +0200 - - Usage message of atop and atopsar extended with reference - to the man-page. - -M atop.c -M atopsar.c - -commit 7df1f797fa27f5dd53298f7511bb36811dc51e14 -Author: Gerlof Langeveld -Date: Wed May 28 16:46:00 2014 +0200 - - Added a function prototype for priline to verify the calling - (cause of earlier problems). - -M atopsar.c - -commit b495b78b8b120bcf266440f6ed1f0e133573e76b -Author: Gerlof Langeveld -Date: Wed May 28 14:29:02 2014 +0200 - - Bug-solution: segmentation fault when one of the process names - in the system contains a newline. - -M photoproc.c - -commit 216c4ccc9e26d1d195985f8b2c45c4008492a341 -Author: Gerlof Langeveld -Date: Wed May 28 13:54:36 2014 +0200 - - Introduce configurable colors: in the atoprc file, colors can - be defined for information messages (default green), threads - (default yellow), almost critical resources (default cyan) and - critical resources (default red). - -M atop.c -M man/atop.1 -M man/atoprc.5 -M man/atopsar.1 -M showgeneric.c -M showgeneric.h -M showsys.c - -commit fd2bb81e07dbb1ac97a559e7099e717e05b80642 -Author: Gerlof Langeveld -Date: Wed May 28 12:17:08 2014 +0200 - - Cosmetic change to message. - -M showgeneric.c - -commit dc1ef5d83b72095536cfabd53adcfcfc8ec37a01 -Author: Gerlof Langeveld -Date: Wed May 28 12:15:56 2014 +0200 - - Solve floating point exception in case that the process accouting - file was not open. - -M acctproc.c - -commit a94a6170476406d1ca85aa018ea71eea6d41f5bd -Author: Gerlof Langeveld -Date: Wed May 28 11:27:05 2014 +0200 - - Limit the names of network interfaces to six characters max. - -M atopsar.c - -commit 19826d8ae098b21cf733cf4e69bfb1936cddc7dd -Author: Gerlof Langeveld -Date: Wed May 28 11:01:13 2014 +0200 - - Modified names for RPM files. - -M mkdistr - -commit b71978ea7ec610305a239529345e816e1323a02b -Author: Gerlof Langeveld -Date: Wed May 28 10:19:16 2014 +0200 - - Added Requires and BuildRequires. - -M atop.spec - -commit f6d0eae38d1e9f093d15fb6fa74d353e59efd05d -Author: Gerlof Langeveld -Date: Wed May 28 10:18:35 2014 +0200 - - Cosmetic change. - -M Makefile - -commit 318890acda8a7cab6bba829fa3276e774f1bd4e0 -Author: Gerlof Langeveld -Date: Sun May 25 22:01:54 2014 +0200 - - Correction for PSIZE calculation: - regain and drop root privileges. - -M photoproc.c - -commit 01be030273991089b6ded31d6a28855bf874d7be -Author: Gerlof Langeveld -Date: Sat May 24 14:10:55 2014 +0200 - - Introduction of proportional memory size (PSIZE) per process. - For the resident memory parts used by a process that are shared with - other processes, only a proportional part (shared memory part divided - by the number of sharers) is accounted to the process. Since the - gathering of this value is rather time-consuming (reading the - smaps file of every process), it is optional ('R' key or '-R' flag). - -M atop.c -M atop.daily -M atop.h -M deviate.c -M man/atop.1 -M parseable.c -M photoproc.c -M photoproc.h -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showprocs.c - -commit 899cdbd18447ce29f901d43531a1702416ab22ad -Author: Gerlof Langeveld -Date: Sat May 24 11:02:18 2014 +0200 - - Increased number of LVMs and disks supported. - -M photosyst.h - -commit e2f7fb5bc45510b2ec14269e71a0b8ca7ae5a454 -Author: Gerlof Langeveld -Date: Fri May 23 23:33:40 2014 +0200 - - Resize message shows new dimensions. - -M showgeneric.c - -commit 0f54b4c1ebca739cda28ae5793475b06e90e0b88 -Author: Gerlof Langeveld -Date: Fri May 23 15:39:46 2014 +0200 - - The guest percentage that is shown for CPUs, is not a separate - category that should be totalized with the other categories. In fact, - it overlaps with the user mode percentage. So if one of the virtual - machines executes a looping process, on the KVM hypervisor the - user percentage and guest percentage should both show 100% instead - of both 50%. - -M atopsar.c -M deviate.c -M man/atop.1 -M man/atopsar.1 -M procdbase.c -M showlinux.c - -commit 3149aa8f4720e615148179ae8cc5146b8c3f5433 -Author: Gerlof Langeveld -Date: Fri May 23 13:28:20 2014 +0200 - - Useless buffer formatting removed. - -M atopsar.c - -commit e96c1fff1c7a7ca292f3aedaaa28b92d2e7b9629 -Author: Gerlof Langeveld -Date: Fri May 23 13:19:21 2014 +0200 - - Removed double disk entry for 'vd...' disks. - -M photosyst.c - -commit 239bd26a925d54d184248f00df35586d4d8d441d -Author: Gerlof Langeveld -Date: Sun Jan 26 15:42:31 2014 +0100 - - Solve segmentation vioalation with atopser (wrong number of - arguments passed to priline function). - -M atopsar.c - -commit 3829e7382f348489f61f01b4e19fb4fb12bc36ef -Author: Gerlof Langeveld -Date: Sun Jan 26 15:37:12 2014 +0100 - - Solve segmentation violation when making summaries: - Extra parameter added to priline-function call. - -M atopsar.c -M man/atop.1 -M rawlog.c - -commit fbce79c76ddb6a38a2bc22b44a95edcf9cf78a36 -Author: Gerlof Langeveld -Date: Sat Dec 7 12:17:07 2013 +0100 - - When process accounting is switched on and a child process - has been created and terminated, it still might occur that - no process accounting record has been written (kernel failure?). - This situation resulted in a Floating Point Exception signal. - -M acctproc.c - -commit 2c7fe393518d861ff2fac3b38888389dd13c9b67 -Author: Gerlof Langeveld -Date: Sat Oct 26 13:07:18 2013 +0200 - - Add a space between two columns, that were show without white space. - -M parseable.c - -commit 948581cce702ffdf93d8e632c6ef12aa3ff6a31b -Author: Gerlof Langeveld -Date: Sat May 11 16:58:05 2013 +0200 - - Add new counter for memory that is claimed by the vmware balloon - driver (to be withdrawn from this virtual machine in favour of - other virtual machines). - -M deviate.c -M man/atop.1 -M parseable.c -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 3a82bbeda1627a8a133f64f4434edaeefe413759 -Author: Gerlof Langeveld -Date: Wed Apr 24 10:47:39 2013 +0200 - - Support for huge pages (total and in use). - -M deviate.c -M man/atop.1 -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 22295853af2f10701f6da3243b75f55fc2eb5f6d -Author: Gerlof Langeveld -Date: Tue Apr 23 14:42:24 2013 +0200 - - Documentation improvements. - -M man/atop.1 -M showgeneric.c - -commit 05266573ea93a9866121909b4bd61856103e9a28 -Author: Gerlof Langeveld -Date: Tue Apr 2 10:59:24 2013 +0200 - - Documentation improved concerning top-3 of processes (atopsar) - and the netatop module (atop). - -M man/atop.1 -M man/atopsar.1 - -commit 9be21d695f218120e501d459ae1bdf112b4dbba5 -Author: Gerlof Langeveld -Date: Thu Jan 10 13:54:08 2013 +0100 - - Cosmetic change: rename some variables to ease future maintenance. - -M atop.c -M deviate.c -M photoproc.h - -commit ffd892d16dc60950a637db45bf2af692a3d2a91e -Author: Gerlof Langeveld -Date: Wed Dec 19 15:45:40 2012 +0100 - - Under certain circumstances, the number of exited processes might - be less than requested, so correct the counter nrexit. - -M acctproc.c -M atop.c - -commit ba35522fbfb1c4fdb90d0dc68b0ac50e95cae73f -Author: Gerlof Langeveld -Date: Tue Dec 11 23:16:36 2012 +0100 - - Solution for the following bug: - When process accounting type 2 is used by the kernel (i.e. - no PID is the accounting record), atop crashes when thread - view is enabled. - Credits: Alex Samorukov - -M showgeneric.c - -commit c34bb60f74c25c3da24ab485ff6d41b8435609b1 -Author: Gerlof Langeveld -Date: Wed Nov 21 21:50:55 2012 +0100 - - Corrected value 'curproc' in -P report. - -M atopsar.c - -commit 321e5288151db22e643569f8b71709d1f5da6bf4 -Author: Gerlof Langeveld -Date: Mon Nov 19 09:26:32 2012 +0100 - - Maintain total number of bytes transferred for accumulated - per-user/per-program view (key 'u'/'p') to show proper - NET-percentage and get proper sorting order. - -M showgeneric.c - -commit cc2824f244ae33c3628dc5bc8a96bf1e64088bb7 -Author: Gerlof Langeveld -Date: Fri Nov 16 22:47:29 2012 +0100 - - Extended the number of positions for the RNET/SNET counters - from 4 to 5, and shrinked SYSCPU/USRCPU from 7 to 6. - -M showprocs.c -M showsys.c -M various.c - -commit 57fb7e206e36e131093c7d0c4cbffe0f07d4bb20 -Merge: 55b51fe 8f5f6cc -Author: Gerlof Langeveld -Date: Fri Nov 16 21:42:32 2012 +0100 - - Merge branch '2.0.1' - - Conflicts: - mkdistr - mkversion - version.h - -commit 8f5f6ccc03b9b8ebaf8b2d65a18d3b56cb58c483 -Author: Gerlof Langeveld -Date: Fri Nov 16 19:27:04 2012 +0100 - - Version update - -M version.h - -commit 8c17df29c0d6dc82bec807cc2af8c50d69a2fbdb -Author: Gerlof Langeveld -Date: Fri Nov 16 19:23:20 2012 +0100 - - Release modification. - -M version.h - -commit b5f5f9c05343c0b818b2afef291fd27d35aa690c -Author: Gerlof Langeveld -Date: Wed Nov 7 08:54:04 2012 +0100 - - Required modifications for distribution. - -M atop.spec -M mkdistr -M mkversion -M version.h - -commit e4f27ff6ba3585b82155af29665c017e146e5c75 -Author: Gerlof Langeveld -Date: Tue Nov 6 08:19:44 2012 +0100 - - Remark about netatop in README and solved rendering problem in atoprc.5 - -M README -M man/atoprc.5 - -commit 41696c91407d65454769d8c0c94d65b410791963 -Author: Gerlof Langeveld -Date: Fri Nov 2 11:14:52 2012 +0100 - - Sequence regainprivs-fopen-dropprivs-fread-... does not work for - files under /proc, so the /proc/PID/io files could not be accessed - when atop is not started by a root-user. Sequence has been changed - to regainprivs-fopen-fread-...-dropprivs. - -M photoproc.c -M various.c - -commit 55b51feda3e2ffa450adb72203ecd9afc3474d30 -Author: Gerlof Langeveld -Date: Fri Nov 2 11:08:40 2012 +0100 - - Sequence regainprivs-fopen-dropprivs-fread-... does not work for - files under /proc, so the /proc/PID/io files could not be accessed - when atop is not started by a root-user. Sequence has been changed - to regainprivs-fopen-fread-...-dropprivs. - -M photoproc.c -M various.c - -commit 8e75554bb8f98269912ebb85a457df3fab35a54f -Author: Gerlof Langeveld -Date: Sat Oct 27 11:59:24 2012 +0200 - - Adapt to correct month. - -M man/atop.1 -M man/atoprc.5 -M man/atopsar.1 - -commit 1a256253c472ccca37ee1dd93ac7d6d1f3fd7e48 -Author: Gerlof Langeveld -Date: Sat Oct 27 11:53:49 2012 +0200 - - Bug fixes. - -M mkdistr -M mkversion -M version.h - -commit 6f61e0e5dbb3f48fd10d52b34eaac6ca49e19b31 -Author: Gerlof Langeveld -Date: Thu Oct 25 17:22:39 2012 +0200 - - Added update-rc.d - -M Makefile - -commit 643941fd3ff2055fcdcb979cdeeab62cef5771c8 -Author: Gerlof Langeveld -Date: Wed Oct 24 13:12:21 2012 +0200 - - Dynamically switch per sample to show network stats or not. In this - way a running atop (e.g. the daily atop running in the background) - immediately reacts on loading or unloading of the netatop module. - -M atop.c -M atop.h -M deviate.c -M man/atop.1 -M netatopif.c -M photoproc.c -M rawlog.c -M showgeneric.c -M showgeneric.h -M showlinux.c - -commit f36eb4be1d7e26ed233bb101613df1a6363f8891 -Author: Gerlof Langeveld -Date: Mon Oct 22 09:27:14 2012 +0200 - - Consider Shmem value in /proc/meminfo. - -M man/atop.1 -M showlinux.c - -commit fc06911932186159fd190f53379462a1a5b05147 -Author: Gerlof Langeveld -Date: Mon Oct 22 09:22:42 2012 +0200 - - Add counter shmem as total shared memory including tmpfs. - Som miscellaneous cosmetic changes. - -M acctproc.c -M deviate.c -M man/atop.1 -M man/atoprc.5 -M man/atopsar.1 -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 1e3c18350475135d11c300801647b5ea8aa6b204 -Author: Gerlof Langeveld -Date: Sat Oct 20 17:06:33 2012 +0200 - - Modified formula to determine if memory is critically low: - the page cache counter implies the resident shared memory (and that - should not be subtracted). - -M showlinux.c - -commit 58c0aae74341a337397859854dfcf826b21ca3ef -Author: Gerlof Langeveld -Date: Sat Oct 20 16:59:30 2012 +0200 - - Gather and display the value SReclaimable from /proc/meminfo - to give more adequate coloring of the MEM-line. - -M deviate.c -M man/atop.1 -M parseable.c -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showsys.c - -commit 213f3e1160046000858edd33c59952be802d5058 -Author: Gerlof Langeveld -Date: Sun Oct 14 15:07:48 2012 +0200 - - Get rid of warnings from ignored return values (with (void)) - -M acctproc.c -M atop.c -M atop.h -M atopsar.c -M photoproc.c -M photosyst.c -M rawlog.c -M various.c - -commit a7a17cfc03f6e4b82840bce4d61bbcdd20db52e0 -Author: Gerlof Langeveld -Date: Sun Oct 14 13:29:05 2012 +0200 - - Cosmetic change. - -M mkdistr - -commit f683dfb6c76ff6df2d68031e19d37532843509f9 -Author: Gerlof Langeveld -Date: Sun Oct 14 13:23:01 2012 +0200 - - Various modifications to cooperate properly with the netatop kernel - module and the netatopd daemon. - Update of man-page. - Simplified the generation of the version number. - -M Makefile -A atopsar -M deviate.c -M man/atop.1 -M mkversion -M netatopif.c -M photosyst.c -M showlinux.c -D version.SKEL -A version.h - -commit 6807de7c036f1f375b7f80a33525b6eff02b03f8 -Author: Gerlof Langeveld -Date: Sat Sep 15 12:15:31 2012 +0200 - - Boot time is determined now with a high resolution clock to be able - to determine the start time of a process more precise (needed to make - a better match with process accounting/netatop). - -M Makefile -M atop.c -M atop.h -M deviate.c -M photoproc.c -M photosyst.c -M procdbase.c -M various.c - -commit 6526ea3da42807c7c94a055c5d90252899f8b059 -Author: Gerlof Langeveld -Date: Fri Sep 14 23:18:06 2012 +0200 - - Further cooperation implemented between atop and netatop/netatopd. - -M Makefile -M acctproc.c -M atop.c -M atop.h -D atopnetif.c -M atopsar.c -M deviate.c -A netatopd.h -A netatopif.c -M parseable.c -M photoproc.c -M photoproc.h -M showgeneric.c -M showlinux.c -M showprocs.c -M various.c - -commit cc8cd6572d7541dfc82d0df09690b5b93bcdcf25 -Author: Gerlof Langeveld -Date: Fri Sep 14 23:06:54 2012 +0200 - - When pid is in the process accounting record, no further check on - the btime (begin-time) is required. - -M procdbase.c - -commit 129895d44071290750f13ce08df7cf80f534136a -Author: Gerlof Langeveld -Date: Wed Aug 29 09:03:46 2012 +0200 - - Remove source code related to the kernel patches. - Insert new code to support the kernel module 'netatop'. - Add shared memory figures to MEM line. - -M Makefile -M atop.c -D atopnet.h -M atopnetif.c -M atopsar.c M deviate.c M man/atop.1 -A netatop.h M parseable.c -M photoproc.c M photosyst.c M photosyst.h -M showgeneric.c M showlinux.c M showlinux.h -M showprocs.c M showsys.c -commit 73bffb6f37e02d5272fbfeb64ada43773fd585e6 +commit 90d7c082728b1e74eb2be657f2836bddbfe2ea94 +Merge: b06b837 b005365 Author: Gerlof Langeveld -Date: Wed Aug 8 16:53:07 2012 +0200 +Date: Mon Jun 21 21:32:35 2021 +0200 - WRDSK is normalized with WCANCEL to determine how much real disk transfer - is done per process. + Merge branch 'pizhenwei-vmstat-migrate' + +commit b005365f87f03b491105e40dbb701261dfe94a8d +Author: Gerlof Langeveld +Date: Mon Jun 21 21:31:18 2021 +0200 + + Modify field order and priority of paging counters -M showgeneric.c M showlinux.c -M showlinux.h -M showprocs.c -commit 361f1d2c877d6316b6339239d81c94aadde62617 +commit 94499112dffb455e2989a18f45dbe9f8395bedf2 Author: Gerlof Langeveld -Date: Wed Aug 8 16:01:12 2012 +0200 +Date: Mon Jun 21 21:25:42 2021 +0200 - Removed unused counters for raw network sends/receives. + Small text modification for migrated counter -M acctproc.c -M atopsar.c -M deviate.c -M parseable.c -M photoproc.c -M photoproc.h -M showgeneric.c -M showlinux.c -M showlinux.h -M showprocs.c +M man/atop.1 -commit e11e259fd35c7be4fcab96d48a818ca222b7fa51 +commit b06b8375b713aafb9245d1a87a6024e336bca723 +Merge: 87248c3 4b0b717 Author: Gerlof Langeveld -Date: Wed Aug 8 15:49:20 2012 +0200 +Date: Sat Jun 19 17:58:33 2021 +0200 - Remove code for kernel patches and introduce kernel module 'atopnet'. + Merge branch 'correctdeviation' + +commit 4b0b7174dc85f7b432b1c9a0338d208eca1933d3 +Author: Gerlof Langeveld +Date: Sat Jun 19 17:56:32 2021 +0200 + + Avoid non-initialized prestat by introducing extra pointer -M Makefile -M acctproc.c -M atop.c -M atop.h -A atopnet.h -A atopnetif.c -M atopsar.c M deviate.c -M parseable.c -M photoproc.c -M showgeneric.c -M showlinux.c -M showlinux.h -M showprocs.c -commit 8c9de7a781247b2591d00fc9e5c9a4f3674b0491 +commit 8f05cf05e20072dd49dc0a2414515d028fdf4cbc Author: Gerlof Langeveld -Date: Mon Jul 23 11:12:33 2012 +0200 +Date: Sat Jun 19 17:39:56 2021 +0200 - Removed unused variable 'columnprefix'. + Function 'calcdiff' (deviate.c) used uninitialized prestat struct -M Makefile -M showlinux.c +M deviate.c -commit eb5da90ccb0246ba9040c158c82589c9e5fffe39 +commit 87248c33f95e4aecdfd515356795da640783e8a2 +Merge: a81d5a5 fc405dc Author: Gerlof Langeveld -Date: Mon Jul 23 11:04:45 2012 +0200 +Date: Sat Jun 19 16:29:56 2021 +0200 + + Merge pull request #157 from MeinhardZh/nvme-multipath + + Support NVMe multipath disk statistics - Minor corrections. +commit a81d5a5f2be2088fe907cf605a650aa1486fab77 +Merge: 8419f02 cf383b0 +Author: Gerlof Langeveld +Date: Sat Jun 19 16:27:42 2021 +0200 -M Makefile -M mkdistr + Merge pull request #159 from bytedance/Clean-up-ignored-files + + Clean up ignored files -commit 9c0c2287ed60619dc2a688b2e4242c7ded582026 +commit a070595212f22ff197a6901b9418c57ee0b41de0 Author: Gerlof Langeveld -Date: Sun Jul 22 11:30:51 2012 +0200 +Date: Sat Jun 19 16:20:30 2021 +0200 - Improved RPM handling. + Reserver space for future counters. -M Makefile -M mkdistr +M photosyst.c +M photosyst.h -commit b1bb45f1d9a61fcd81cebf417cccadac68ddde67 +commit 84d6b2abe404d3746fcf7e6e994512d3676b971d +Merge: 8419f02 508e51c Author: Gerlof Langeveld -Date: Fri Jul 20 15:19:35 2012 +0200 +Date: Sat Jun 19 10:50:51 2021 +0200 + + Merge branch 'vmstat-migrate' of https://github.com/pizhenwei/atop into pizhenwei-vmstat-migrate - Add service file for systemd without installing. +commit cf383b011c4b8b6d37cf779133a1f2e8466eadf6 +Author: Fei Li +Date: Wed Jun 9 21:19:46 2021 +0800 + + Clean up ignored files + + Fix #145, and supplement commit e81b1d9c. + + Signed-off-by: Fei Li + +D atopsar + +commit 8419f02f5daad1f0c09b518029780a203df50b36 +Merge: 33072ab 77c87ee +Author: Gerlof Langeveld +Date: Thu Jun 3 16:46:44 2021 +0200 -A atop.service -M mkdistr + Merge branch 'varsortitem' -commit 409be5867b31d37f138447110d234b2325902cdf +commit 77c87ee6fbc8fb2f0c4b640e453405fd76e51999 Author: Gerlof Langeveld -Date: Fri Jul 20 15:18:10 2012 +0200 +Date: Thu Jun 3 16:41:02 2021 +0200 - Corrected typo in help messages. + Variable number of positions for sortitem + The sort criterion for the process list is a percentage of + CPU, memory, disk, etc utilization of the process concerned. + The number of positions for the percentage was fixed 3, considering + a maximum of 100% (maximum 999%). However, when a process has 10 + threads (or more) on a system with 10 CPUs (or more) the CPU utilization + of that process can be greater than 999%. Therefore, the number of + positions for the percentage depends on the number of CPUs now. M showgeneric.c +M showgeneric.h +M showlinux.c +M showprocs.c -commit 4ea9f1ab0c500d47ae74544f90353c6190b8e317 +commit 33072abd452860d4fa76e3d5ec4b9a0d92bcb284 Author: Gerlof Langeveld -Date: Fri Jul 20 12:09:17 2012 +0200 +Date: Thu Jun 3 15:06:45 2021 +0200 - Modified description. + Adapt man page of atop for state selection (add state 'I'). -M atop.spec M man/atop.1 -M man/atopsar.1 -commit a98a0d1ad85aaa082fda535cbb9844a0a4591034 +commit 8d8f9b0ea3e3cd387652f7ab6aef85ad10d1cfa4 Author: Gerlof Langeveld -Date: Fri Jul 20 12:02:17 2012 +0200 +Date: Thu Jun 3 14:53:33 2021 +0200 - ChangeLog removed (not needed any more when using git). + Allow thread state 'I' with state selection (key 'Q') -D ChangeLog +M showgeneric.c -commit af0f1fad5438374912c167f284653b87c62a3142 +commit bb38fd80633cf11475fc18191d4cc8bf3f0e67ba Author: Gerlof Langeveld -Date: Fri Jul 20 12:01:06 2012 +0200 +Date: Thu Jun 3 14:40:17 2021 +0200 - Added LSB header. + Count idle threads as non-interruptible threads + Sofar threads in state 'I' (TASK_IDLE) were not counted on process + level (thread categories shown with key 's') and system level (PRC line). + Idle threads will now be counted as uninterruptible threads. -M atop.init +M photoproc.c -commit d5a9b854674ae451636815e539c4c056365708b2 +commit f1431502fbaf22f22ee6f5a1d0b817eca53dd692 Author: Gerlof Langeveld -Date: Fri Jul 20 10:12:31 2012 +0200 +Date: Thu Jun 3 14:29:24 2021 +0200 - Clarified comments about the use of coloring. + Uninitialized index might cause segmentation fault. -M showsys.c +M showlinux.c -commit 1b38444596097776f88415091d27efee4f2dee9f -Author: Gerlof Langeveld -Date: Fri Jul 20 10:01:38 2012 +0200 +commit fc405dc34f280889eb31820e2e673b6a2f3e03d0 +Author: zhouenhua +Date: Wed May 26 17:39:34 2021 +0800 - Solved division-by-zero when maxfreq=0 and - more precise coloring of concerning CPU-values when CPU overloaded. + Support NVMe multipath disk statistics + + When NVMe disk multi-path is turned on, the kernel only records IO statistics + for each multi-path. + + Ex, read statistics from /proc/diskstatus: + 0 0 nvme0c0n1 34706049 74843 4815165730 93876201 4187610 1925219 6989322264 47813633 0 45557635 118897696 312571 0 11200562376 857547 + 259 1 nvme0n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + + For this case, we usually expect the right statistics from nvme0c0n1 instead of nvme0n1. + + Signed-off-by: enhua zhou zhouenhua@bytedance.com -M showsys.c +M photosyst.c -commit 826caafb1aaf892e0692d4315a324093ece2da32 -Author: Gerlof Langeveld -Date: Fri Jul 20 10:00:53 2012 +0200 +commit 508e51cd82cffd213feb8294ec58200175533227 +Author: zhenwei pi +Date: Tue May 25 09:55:03 2021 +0800 - Correct typo's in description of frequency scaling. + Support page migration counter + + The kernel may migrate pages between NUMA nodes to make memory access + faster, but during migration the kernel need hold the memory lock of + target process and trigger TLB flush. It hurts the performance a lot. + + Add pgmigrate counter to show/record it for trouble shooting. + + Signed-off-by: zhenwei pi +M deviate.c M man/atop.1 +M parseable.c +M photosyst.c +M photosyst.h +M showlinux.c +M showlinux.h +M showsys.c -commit f266aafb596880c8fe8bcf6f4ae662889803b7c3 -Author: Gerlof Langeveld -Date: Thu Jul 19 08:24:33 2012 +0200 +commit e3e99949d2a95d3f9a39bfe8fb49354613ee918d +Author: Fabrice Fontaine +Date: Mon May 24 21:08:52 2021 +0200 + + photosyst.c: fix build on musl + + Build on musl is broken since version 2.6.0 and + https://github.com/Atoptool/atop/commit/e889c66fbe1d0b7ae38fbcbaa46cea749257f486 + because limits.h is not included: + + photosyst.c: In function ‘lvmmapname’: + photosyst.c:1624:14: error: ‘PATH_MAX’ undeclared (first use in this function); did you mean ‘AF_MAX’? + char path[PATH_MAX]; + ^~~~~~~~ + AF_MAX + + Signed-off-by: Fabrice Fontaine - If setuid-root is set for atop, root-privileges are regained when reading - /proc/pid/io (nowadays only readable for root) to obtain the disk stats - per process. +M photosyst.c -M photoproc.c +commit b004daf963939c925dd775fca9f3cebff7381bd1 +Merge: feb220c a4503da +Author: Gerlof Langeveld +Date: Mon May 24 12:15:06 2021 +0200 + + Merge branch 'ffontaine-master' -commit 9e77a3bccfa345eb8a4a7b1a417343f80a5ae792 +commit a4503da46769329318ee3483ae818d8ff4bf5de7 Author: Gerlof Langeveld -Date: Thu Jul 19 07:51:43 2012 +0200 +Date: Mon May 24 12:12:48 2021 +0200 - Email address updated in README and ChangeLog added to package. + Use of struct ethtool_link_settings should be conditional -M README -M mkdistr +M ifprop.c -commit 1ee760110035966d444f057cdaf2f0784244b4c8 +commit 1d28e46c2f6d1ca856303d1252f24ad0e5db833e +Merge: feb220c aff473e Author: Gerlof Langeveld -Date: Wed Jul 18 11:37:29 2012 +0200 +Date: Mon May 24 11:06:46 2021 +0200 - Added EMC Power device recognition. + Merge branch 'master' of https://github.com/ffontaine/atop into ffontaine-master -M photosyst.c +commit feb220c77f16030428a28e0365633fde2d34219d +Merge: 69adbd1 918868e +Author: Gerlof Langeveld +Date: Sat May 8 14:29:51 2021 +0200 -commit 4aa9c986f8bb469ad38e46db46d7bc1766f4cea0 + Merge branch 'yk144-average-per-second-rounding' + +commit 918868e49948df6c7f2ce7ee3fe86e4b23eee2b5 Author: Gerlof Langeveld -Date: Wed Jul 18 09:25:42 2012 +0200 +Date: Sat May 8 14:28:45 2021 +0200 - Better recognition of version of process accounting file. + Cosmetic change (source code layout) -M acctproc.c +M atop.h -commit 9c8dcc365631a38df69ddc98a94b28ca71666679 +commit 8b0f03e55f9fe555ed9a6e64e8e2c6bc9c113c36 +Merge: 69adbd1 5c9c88a Author: Gerlof Langeveld -Date: Wed Jul 18 09:21:36 2012 +0200 +Date: Sat May 8 14:09:00 2021 +0200 - Improved error handling when not enough columns or lines. + Merge branch 'average-per-second-rounding' of https://github.com/yk144/atop into yk144-average-per-second-rounding -M man/atop.1 -M man/atopsar.1 -M showgeneric.c +commit 69adbd109a8111daba53bbaa8680677d3f65fa86 +Merge: 48df66d d66ff0e +Author: Gerlof Langeveld +Date: Sat May 8 13:57:39 2021 +0200 + + Merge branch 'natoscott-state-filter' -commit ab6f072b5b85df575c40fd68583052833c09bd48 +commit d66ff0e48fb6ec90ab84f786c4016fda7cd0644b Author: Gerlof Langeveld -Date: Tue Jul 17 14:29:08 2012 +0200 +Date: Sat May 8 13:56:35 2021 +0200 - Suppress sorting of system resources by key F or flag -F (toggle). + Various bug fixes and in general add 'thread' to all messages M man/atop.1 -M man/atoprc.5 M showgeneric.c -M showgeneric.h -commit 3b0922c3c371ffecab00f6df72bc8b8852ae8e15 +commit 441e6f72e7c59974dbd036230afa70523e3c3cde +Merge: 48df66d 44ea948 Author: Gerlof Langeveld -Date: Tue Jul 17 13:29:45 2012 +0200 +Date: Sat May 8 13:11:30 2021 +0200 - Give clearer error message if the format of the rawlog is incompatible. + Merge branch 'state-filter' of https://github.com/natoscott/atop into natoscott-state-filter -M rawlog.c +commit 48df66d570e640c683a2239016b0fd3ecbd41821 +Merge: fed5bd5 0aa920e +Author: Gerlof Langeveld +Date: Sun Apr 25 15:06:43 2021 +0200 -commit 7c17a309ef97a59a8ee1f5a593f48eeac9d46bc8 + Merge branch 'bytedance-fix-initifprop' + +commit 0aa920ea2b130e0cfae9c38817e88549cfc6c4fc Author: Gerlof Langeveld -Date: Tue Jul 17 12:57:25 2012 +0200 +Date: Sun Apr 25 15:06:14 2021 +0200 - Create unique /tmp name for decompressed raw file. + Properly define if interface is virtual or physical -M man/atop.1 -M rawlog.c +M ifprop.c -commit 0f693c1f651c02ecbfbedf49bafdc879c2479184 +commit cafda7ac55e60996bba6d376f6e977821ca40982 +Merge: fed5bd5 ef183ff Author: Gerlof Langeveld -Date: Tue Jul 17 11:28:20 2012 +0200 +Date: Sun Apr 25 14:45:23 2021 +0200 - Numerous cosmetic changes and man-page updates. + Merge branch 'fix-initifprop' of https://github.com/bytedance/atop into bytedance-fix-initifprop -M acctproc.c -M deviate.c -M man/atop.1 -M man/atoprc.5 -M man/atopsar.1 -M photosyst.c -M photosyst.h -M showlinux.c -M showlinux.h -M showprocs.c -M showsys.c +commit fed5bd53a291483c4d2e56ea9cf53b62e8eea5af +Merge: d2ca9f2 95412fa +Author: Gerlof Langeveld +Date: Sun Apr 25 14:38:14 2021 +0200 -commit 2a637eaa2ba734c1ae2cdc2d6caab8bc66bf7782 + Merge pull request #150 from natoscott/deprecated-function + + Switch to using curses vw_printw as vwprintw is deprecated + +commit d2ca9f2954a25b4955c661bb892817988fd03b2e Author: Gerlof Langeveld -Date: Fri Jun 15 10:41:45 2012 +0200 +Date: Sun Apr 25 14:21:38 2021 +0200 - Improved screen handling. - Limited maximum file-size for process accounting file (200 MiB). + Add license info to various include files (solves issue #144) -M acctproc.h -M showgeneric.c +M atopacctd.h +M gpucom.h +M ifprop.h +M netatop.h +M netatopd.h +M netstats.h +M parseable.h +M rawlog.h -commit 86e9448c2cd8e0f3bc1b138dfc98b6701f0afa2c +commit 961a6ce137eedc722a27b6002f1ffb3c6ba86842 Author: Gerlof Langeveld -Date: Thu Jun 14 17:09:15 2012 +0200 +Date: Sun Apr 25 13:23:24 2021 +0200 - Improved handling of process accounting: - - Per sample not more than 50 MiB are allowed for process accounting records, - which means about 72000 processes. This avoids atop to explode in memory - when a huge amount of processes died within one sample. - - When only one atop-process is busy and it detects that the process accounting - file exceeds .5 GiB, it will truncate the accounting file to zero. + HTTP statistics modified from -h flag to -o flag (solves issue #152) + The -h flag was used for the HTTP stats and Infiniband stats. For HTTP + statistics (by default not activated) the -o flag can be used now. -M acctproc.c -M acctproc.h -M atop.c -M atop.h M atopsar.c -M deviate.c -M mkdistr -M parseable.c -M parseable.h -M photoproc.h -M rawlog.c -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showsys.c +M photosyst.c -commit 0178cdeba8f654816c082118c046978c94869343 +commit db9eef1d4a3d9414ed00f6c0da0e5dad55f2b9af Author: Gerlof Langeveld -Date: Wed Jun 13 15:43:55 2012 +0200 +Date: Thu Apr 22 08:24:29 2021 +0200 - Cosmetical changes. + Possible buffer overflow with huge number of seconds + Number of seconds will be limited to 5 positions. -M atop.c M showsys.c -commit 428524129548ede14d535a8c2c23ff5e0af2d54c +commit aa85ccbe1ed475b1be010ba254bf327a0c12a725 Author: Gerlof Langeveld -Date: Wed Jun 13 13:12:39 2012 +0200 +Date: Thu Apr 22 08:07:06 2021 +0200 - New key 'S' to make selections of system resources like logical volumes, - disks and network interfaces (regular expression). + Possible buffer overflow with average disk I/O + The rounding algorithm has been improved and the buffer has been enlarged. + +M showsys.c + +commit 44ea948e94f665b5b0c1459b7323759f8944aaf8 +Author: Nathan Scott +Date: Mon Mar 22 16:42:45 2021 +1100 + + Allow process selection based on specific process states. M man/atop.1 M showgeneric.c M showgeneric.h -M showlinux.c -commit 3fff5cfc8e01fceb1e69ff067e73a5d86ae12c48 +commit 9cb119713b5e6be43671fe1856fb4bd49ff91fa7 Author: Gerlof Langeveld -Date: Wed Jun 13 12:16:54 2012 +0200 +Date: Tue Mar 23 16:50:48 2021 +0100 - Use of arrow-keys and PgUp/PgDown for vertical scroll. - Use of -> and <- keys for horizontal scroll of command line. - Increment of maximum number of system resources (e.g. MAXCPU). + Correct definition of environment variable LOGOPTS + The former definition of the empty environment variable LOGOPTS + in the atop.service file (Environment=LOGOPTS="") causes an + empty command line parameter for atop running in the background. + This empty parameter results in an interval timer definition of 0 seconds + which means that atop only writes one single sample to the daily logfile + and after that no more! + When the environment variable is overruled by the definition LOGOPTS="" + (or another value) in the file /etc/default/atop the problem is bypassed. -M photoproc.h -M photosyst.h -M showgeneric.c -M showprocs.c +M atop.service -commit 7671b76506743c0a9d82f77674788a045ea0a427 -Author: Gerlof Langeveld -Date: Sat Jun 9 12:28:58 2012 +0200 +commit 95412fa4a3eac31e759fbec1030c6ba233514ccb +Author: Nathan Scott +Date: Fri Mar 12 10:45:52 2021 +1100 - Improved generation of new version. + Switch to using curses vw_printw as vwprintw is deprecated + + Resolves the following compiler warning - + + showgeneric.c: In function ‘printg’: + showgeneric.c:2724:3: warning: ‘vwprintw’ is deprecated [-Wdeprecated-declarations] -A atop.spec -M mkdistr +M showgeneric.c -commit 2c87df01b06c588ce205c1dcdf8bd30889e27b1b +commit 5c580bee1fbfa32fef5558cb3beadb5583952c98 Author: Gerlof Langeveld -Date: Sat Jun 9 11:07:03 2012 +0200 +Date: Sat Mar 6 12:10:15 2021 +0100 - Support statistics for virtio disks (vd*). + Support multiple counters 'allocstall_' in /proc/vmstat. M photosyst.c -commit c0c9238f3667d4916cad4eeb16baa861de7e4527 +commit 12984d6defae1643ed8683f8a09cbf4997bd0949 +Merge: dc6856a e4e82b4 Author: Gerlof Langeveld -Date: Sat Jun 9 11:04:22 2012 +0200 +Date: Sat Mar 6 11:51:47 2021 +0100 - Uniform handling of failing mallocs. + Merge branch 'bytedance-add-compact_stall' -M atop.c -M atop.h -M atopsar.c -M deviate.c -M mkdistr -M photoproc.h -M procdbase.c -M rawlog.c -M showgeneric.c -M various.c +commit e4e82b4827f49ebf3d4b68128d2cb1231e91b333 +Merge: dc6856a d0ae258 +Author: Gerlof Langeveld +Date: Sat Mar 6 11:46:31 2021 +0100 + + Merge branch 'add-compact_stall' of https://github.com/bytedance/atop into bytedance-add-compact_stall -commit 0682920a7b41e2007dac1470996d945e55b0fc21 +commit dc6856a1f53be7a322f585ac30690239d0416e25 Author: Gerlof Langeveld -Date: Tue Jun 5 15:44:04 2012 +0200 +Date: Sat Feb 20 11:07:20 2021 +0100 - Fetching and displaying of individual threads. + Avoid integer overflow when calculating PSI percentages. -M acctproc.c -M acctproc.h -M atop.c -M atop.h -M atopsar.c -M deviate.c -M man/atop.1 -M parseable.c -M parseable.h -M photoproc.c -M photoproc.h -M procdbase.c -M rawlog.c -M showgeneric.c -M showgeneric.h -M showlinux.c -M showlinux.h -M showprocs.c M showsys.c -commit 10f54f1caa904b98f270a92d5fdcafe259d88773 +commit 67eadc5b2aa22d562480c5b197f58f259eb46f66 +Merge: e81b1d9 09935eb Author: Gerlof Langeveld -Date: Mon May 28 11:23:43 2012 +0200 - - Increase maximum number of disks, lvm's, interfaces and CPUs. +Date: Sat Feb 20 10:57:43 2021 +0100 -M photosyst.c -M photosyst.h + Merge branch 'dynamic' -commit 27fe64e140a62220a0e7fee04431be4756c0047d +commit 09935eb6e35cc7408a29e11c5026b67378edfa3e Author: Gerlof Langeveld -Date: Mon May 28 11:22:49 2012 +0200 +Date: Sat Feb 20 10:49:44 2021 +0100 - Show message instead of #exits when process accounting could not - be switched on. + Suppress irrelevant counters (solves issue #148) + In the output of atop, counters will be suppressed when they do not + contain a relevant value to avoid unnecessary column space to be used. + A counter does not contain a relevant value when it is not supported + by the kernel in use, when it relates to a kernel mechanism that is not + in use on this machine or when the user running atop does not have + enough privileges to read specific counters. + To make the user aware that certain counters are missing due to a lack + of privileges, a message is shown during the first sample. +M atop.h +M deviate.c +M man/atop.1 +M man/atopsar.1 +M parseable.c +M photosyst.c +M showgeneric.c +M showlinux.c M showsys.c -commit 90b7a438c226fd0ce4e8f8680ece4b67ea5a87a8 +commit fa9e907d4174df94935606bb9e84dd38bda87f8c Author: Gerlof Langeveld -Date: Mon May 28 11:21:53 2012 +0200 +Date: Sat Feb 20 10:42:17 2021 +0100 - Proper handling of lock added. + Add the number of OOM kills to the -s report. + The number of OOM kills are shown as an additional column in the + 'atopsar -s' report. In contradiction to the other frequency columns + the OOM kills are not shown as a per-second value because a single + OOM kill during a longer interval might result in 0.00 kills/sec + in that case. -M atop.init +M atopsar.c -commit 30165361059b75acbae534b21eee2465727f05f7 -Author: Gerlof Langeveld -Date: Mon Mar 5 09:06:57 2012 +0100 +commit d0ae2589d1ff48ce796b76867c0f96cd63ce7cbf +Author: Fei Li +Date: Sun Mar 8 11:37:34 2020 +0800 - Add various details about the memory usage of processes, like - stack size, data size, shared library size and size used on swap. + Record the number of process stalls to run memory compaction + + Signed-off-by: Fei Li -M acctproc.c M deviate.c M man/atop.1 M parseable.c -M photoproc.c -M photoproc.h +M photosyst.c M photosyst.h -M showgeneric.c +M prev/photosyst_20.h +M prev/photosyst_21.h +M prev/photosyst_22.h +M prev/photosyst_23.h +M prev/photosyst_24.h M showlinux.c M showlinux.h -M showprocs.c +M showsys.c -commit 5c65b96129124fcdd9105d90d11bc46a46b0ec9a +commit e81b1d9cb405482b6706aeea774b2ad8fe6718ff Author: Gerlof Langeveld -Date: Tue Sep 13 10:20:22 2011 +0200 +Date: Sat Jan 30 12:34:14 2021 +0100 - Show new value about swap space usage per process. + Make clean removes atopsar now (issue 145) + +M Makefile + +commit 9decbba5980249129a0cb5ba3b186d07e3590c57 +Author: Gerlof Langeveld +Date: Sat Jan 30 12:29:54 2021 +0100 + + Add counter for the number of OOM kills to the PAG line -M acctproc.c M deviate.c M man/atop.1 M parseable.c -M photoproc.c -M photoproc.h -M showgeneric.c +M photosyst.c +M photosyst.h M showlinux.c M showlinux.h -M showprocs.c +M showsys.c -commit 25ffd8313a499b480f38e493eb50bf4c5a8bec1b +commit f62fdc8429a7f170415f4bf58befee9d06ff6c0b +Merge: 462cc2b c0623c0 Author: Gerlof Langeveld -Date: Tue Sep 13 07:52:15 2011 +0200 - - Color vmlim and vmcom adapted. +Date: Sat Jan 30 12:10:24 2021 +0100 -M showsys.c + Merge branch 'ksmzswap' -commit eff004b034980224bff10baf14eee598fdd5f470 +commit c0623c070733953d46e4783ffd35f65714602efb Author: Gerlof Langeveld -Date: Wed Sep 7 15:34:12 2011 +0200 +Date: Sat Jan 30 12:07:58 2021 +0100 - Colors are shown now for separate system-level counters instead - of for the entire line with counters. + Add counters for zswap and KSM. + For zswap the counters stored_pages and pool_total_size are added. + For KSM the counters pages_shared and pages_sharing are added. -M showgeneric.c -M showgeneric.h +M deviate.c +M man/atop.1 +M parseable.c +M photosyst.c +M photosyst.h M showlinux.c M showlinux.h M showsys.c -commit 2358e3fe0445973c78226d25aa13da02f1dd61d9 -Author: Gerlof Langeveld -Date: Tue Sep 6 09:54:42 2011 +0200 - - Git-based determination of the version of atop. +commit aff473ee28903775e1bb35793b9c4c50ee0c7270 +Author: Fabrice Fontaine +Date: Tue Dec 22 12:23:33 2020 +0100 -A mkdistr -A mkversion -A version.SKEL -D version.c + ifprop.c: fix build with kernel < 4.6 + + Build fails with kernel headers < 4.6 since version 2.6.0 and + https://github.com/Atoptool/atop/commit/08c622ecaa5bb0bb260984ceaddc4730d1b312a7 + + Indeed, ethtool_link_settings and ETHTOOL_GLINKSETTINGS are only + available since + https://github.com/torvalds/linux/commit/3f1ac7a700d039c61d8d8b99f28d605d489a60cf + + Signed-off-by: Fabrice Fontaine -commit 87852e1b1b2d87b26c222fe7abec024570465a48 -Author: Gerlof Langeveld -Date: Tue Sep 6 08:59:36 2011 +0200 +M ifprop.c - Enhanced security: improved dropping of root privileges. +commit ef183ffd59fdfd108f6d2f65ea9153c4a032d6d6 +Author: Fei Li +Date: Tue Apr 21 10:40:21 2020 +0800 -M acctproc.c -M atop.c -M atop.h -M atopsar.c -M deviate.c -M rawlog.c -M various.c + Fix initifprop() when obtaining properties of all interfaces + + This patch fixes two issues: + - Correctly set link_mode_masks_nwords when using + ETHTOOL_GLINKSETTINGS to query devices, or else we can only obtain + base fields from kernel function: ethtool_get_link_ksettings() + without any link_settings filed is stored. + - Considering not all net drivers realize the "phy_address" field in + kernel, to determine whether or not a network interface is virtual, + let's read /sys/devices/virtual/net/xxx to obtain all virtual + interfaces' name, and then do compare with each ifprops[i].name to + filter it. + + Fixes: 08c622ecaa5bb0bb260984ceaddc4730d1b312a7 + Signed-off-by: Fei Li -commit 1f0c1bb1b9ad52abfc62147465ccf61e25f5a7f8 -Author: Gerlof Langeveld -Date: Mon Sep 5 15:59:44 2011 +0200 +M ifprop.c - Avoid error messages during startup of atop about not being able to - activate process accounting (e.g. when starting without root privs). - The reason of the error will now be displayed instead of the '#exit' counter. +commit 5c9c88ad15a863a2194abf1b3b8ce44f832df4d9 +Author: Yaroslav K +Date: Fri Jun 14 16:31:57 2019 +0300 + + Fixed rounding problems in the average-per-second mode. + + problem example: + WRDSK,RDDSK sometimes displayed as 0.0G/s 0.0M/s in the average-per-second mode. + + solution: + - more accurate rounding (llround) when calculating values for the 1/s intervals, and while converting to KB MB GB .. + - values<=9 are displayed as before as float ex.:1.1M/s,3.3G/s + - values 10-999 are display as int (llround) ex.:123M/s 999M/s -M acctproc.c -M atop.c M atop.h -M man/atop.1 -M showsys.c - -commit fb9ed3f5079344a93cdc29bd415710ef753fcbf8 -Author: Gerlof Langeveld -Date: Mon Sep 5 14:04:31 2011 +0200 - - Initial version - -A 45atoppm -A AUTHOR -A COPYING -A ChangeLog -A Makefile -A README -A acctproc.c -A acctproc.h -A atop.c -A atop.cron -A atop.daily -A atop.h -A atop.init -A atopsar.c -A deviate.c -A ifprop.c -A ifprop.h -A man/atop.1 -A man/atoprc.5 -A man/atopsar.1 -A netstats.h -A parseable.c -A parseable.h -A photoproc.c -A photoproc.h -A photosyst.c -A photosyst.h -A procdbase.c -A psaccs_atop -A psaccu_atop -A rawlog.c -A showgeneric.c -A showgeneric.h -A showlinux.c -A showlinux.h -A showprocs.c -A showsys.c -A various.c -A version.c +M showprocs.c +M various.c diff -Nru atop-2.6.0/debian/atop.default atop-2.7.1/debian/atop.default --- atop-2.6.0/debian/atop.default 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/atop.default 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# /etc/default/atop -# see man atoprc for more possibilities to configure atop execution - -LOGOPTS="-R" -LOGINTERVAL=600 -LOGGENERATIONS=28 - diff -Nru atop-2.6.0/debian/atop.maintscript atop-2.7.1/debian/atop.maintscript --- atop-2.6.0/debian/atop.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/debian/atop.maintscript 2022-01-10 10:44:14.000000000 +0000 @@ -0,0 +1,3 @@ +rm_conffile /etc/logrotate.d/psaccs_atop +rm_conffile /etc/logrotate.d/psaccu_atop + diff -Nru atop-2.6.0/debian/atop.postinst atop-2.7.1/debian/atop.postinst --- atop-2.6.0/debian/atop.postinst 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/debian/atop.postinst 2022-01-10 10:44:14.000000000 +0000 @@ -0,0 +1,18 @@ +#!/bin/sh +# +# post-installation script for AIDE +# A whole lot of this is "borrowed" from tripwire's postinst +# + +set -e + +#DEBHELPER# + +case "$1" in + configure) + rm -f /var/log/atop/dummy_after /var/log/atop/dummy_before + ;; +esac + +# vim:sw=4:sts=4:et: + diff -Nru atop-2.6.0/debian/changelog atop-2.7.1/debian/changelog --- atop-2.6.0/debian/changelog 2021-02-16 15:09:47.000000000 +0000 +++ atop-2.7.1/debian/changelog 2022-01-10 10:44:14.000000000 +0000 @@ -1,8 +1,41 @@ -atop (2.6.0-2build1) hirsute; urgency=medium +atop (2.7.1-1) unstable; urgency=medium - * No change rebuild with fixed ownership. + * new upstream version 2.7.1 + * atop.service now defining type explicitly + * Correct disk stats in atopsar + * documentation changes + * refresh patches + * copyright clarification in upstream README + + -- Marc Haber Mon, 10 Jan 2022 11:44:14 +0100 + +atop (2.7.0-1) unstable; urgency=medium - -- Dimitri John Ledkov Tue, 16 Feb 2021 15:09:47 +0000 + * new upstream version 2.7.0 + * better handling of accounting data + * psacc[su]_atop is no longer necessary + * make systemdinstall is now make install + * remove rotation helper logrotate snippets + * don't start atop-rotate.service, it is invoked by timer + * remove helper log file imitations in postinst + * Janitor fixes: + * use debhelper-compat + * remove obsolete maintscript entry + * use secure URI in Homepage field + * trim trailing whitespace + * add basic salsa-ci. Thanks to Otto Kekäläinen + * add Upstream metadata + * create /etc/default/atop as patch from Upstreams file. + Thanks to Fei Li (Closes: #999448) + * remove conflicts on non-existing acct.service + * add first trivial autopkgtest + * debian/copyright: + * clarify license for files without explicit license + * fix double file name + * fix a typo + * update year for debian packagin + + -- Marc Haber Sun, 09 Jan 2022 23:27:42 +0100 atop (2.6.0-2) unstable; urgency=medium @@ -445,4 +478,3 @@ * Initial upload (Closes: #190729) -- Edelhard Becker Fri, 25 Apr 2003 14:27:39 +0200 - diff -Nru atop-2.6.0/debian/compat atop-2.7.1/debian/compat --- atop-2.6.0/debian/compat 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -13 diff -Nru atop-2.6.0/debian/control atop-2.7.1/debian/control --- atop-2.6.0/debian/control 2021-02-16 15:09:47.000000000 +0000 +++ atop-2.7.1/debian/control 2022-01-10 10:44:14.000000000 +0000 @@ -1,13 +1,12 @@ Source: atop Section: admin Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Marc Haber +Maintainer: Marc Haber Uploaders: Marc Haber -Build-Depends: debhelper (>= 13~), zlib1g-dev, libncurses5-dev +Build-Depends: debhelper-compat (= 13), zlib1g-dev, libncurses5-dev Standards-Version: 4.5.1 Rules-Requires-Root: binary-targets -Homepage: http://atoptool.nl/ +Homepage: https://atoptool.nl/ Vcs-Git: https://salsa.debian.org/debian/atop.git Vcs-Browser: https://salsa.debian.org/debian/atop diff -Nru atop-2.6.0/debian/copyright atop-2.7.1/debian/copyright --- atop-2.6.0/debian/copyright 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/copyright 2022-01-10 10:44:14.000000000 +0000 @@ -1,6 +1,3 @@ -NOTE: This cannot be uploaded unless the "License: None" files -have been cleared - Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: atop Upstream-Contact: Gerlof Langeveld @@ -14,14 +11,25 @@ Copyright: 2014 Gerlof Langeveld License: GPL-2 -Files: deviate.c +Files: atopacctd.h + gpucom.h + ifprop.h + netatop.h + netatopd.h + netstats.h + parseable.h photoproc.c rawlog.c + rawlog.h showgeneric.c various.c Copyright: 2000-2010 Gerlof Langeveld License: GPL-2+ +Files: deviate.c +Copyright: 2000-2021 Gerlof Langeveld +License: GPL-2+ + Files: photosyst.c procdbase.c Copyright: 2000-2012 Gerlof Langeveld @@ -33,16 +41,19 @@ Files: atopsar.c ifprop.c - parseable.c Copyright: 2007-2010 Gerlof Langeveld License: GPL-2+ +Files: parseable.c +Copyright: 2007-2021 Gerlof Langeveld +License: GPL-2+ + Files: atop.c Copyright: 2000-2018 Gerlof Langeveld License: GPL-2+ Files: atopconvert.c -Copyright: 2018-2020 Gerlof Langeveld +Copyright: 2018-2021 Gerlof Langeveld License: GPL-2+ Files: showprocs.c @@ -63,20 +74,13 @@ atop.service atopacct.service atopacct.init - atopacctd.h atopgpud atopgpu.service atop-pm.sh atop-rotate.service atop-rotate.timer - gpucom.h - ifprop.h Makefile - netatopd.h - netatop.h netlink.c - netstats.h - parseable.h versdate.h version.c version.h @@ -87,24 +91,19 @@ prev/photoproc_24.h prev/photoproc_25.h prev/photoproc_26.h - prev/protosyst_20.h + prev/photosyst_20.h prev/photosyst_21.h prev/photosyst_22.h prev/photosyst_23.h prev/photosyst_24.h prev/photosyst_25.h prev/photosyst_26.h - psaccs_atop - psaccu_atop - rawlog.h - versdate.h - version.c - version.h -License: None +Copyright: Gerlof Langeveld 2007-2021 +License: GPL-2+ Files: debian/* Copyright: 2003 Edelhard Becker - 2012-2020 Marc Haber + 2012-2022 Marc Haber License: GPL-2+ License: GPL-2 diff -Nru atop-2.6.0/debian/maintscript atop-2.7.1/debian/maintscript --- atop-2.6.0/debian/maintscript 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/maintscript 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -rm_conffile /etc/logrotate.d/atop 1.26-2~ diff -Nru atop-2.6.0/debian/patches/acct-compat atop-2.7.1/debian/patches/acct-compat --- atop-2.6.0/debian/patches/acct-compat 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/acct-compat 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -Description: better handle coexistence with acct, see #922224 -Author: Marc Haber -Forwarded: not yet -Last-Update: 2019-02-17 ---- a/acctproc.c -+++ b/acctproc.c -@@ -158,7 +158,8 @@ struct pacctadm { - struct stat stat; - } pacctadm[] = { - { "/var/log/pacct", {0, }, }, -- { "/var/account/pacct", {0, }, } -+ { "/var/account/pacct", {0, }, }, -+ { "/var/log/account/pacct", {0, }, } - }; - - /* ---- a/atopacct.init -+++ b/atopacct.init -@@ -29,7 +29,7 @@ case "$1" in - start) - # Check if process accounting already in use via psacct - # -- for PACCTFILE in /var/account/pacct /var/log/pacct -+ for PACCTFILE in /var/account/pacct /var/log/pacct /var/log/account/pacct - do - if [ -f "$PACCTFILE" ] # file exists? - then ---- a/man/atop.1 -+++ b/man/atop.1 -@@ -162,11 +162,14 @@ daemon is not active, - verifies if the process accounting mechanism has been switched on - via the separate - .B psacct --package. In that case, the file --.B /var/account/pacct --is in use as process accounting file and -+package. In that case, the files -+.B /var/account/pacct, -+.B /var/log/account/pacct -+and -+.B /var/log/pacct -+are considered to be in use as process accounting file and - .I atop --opens this file for reading. -+opens the respective file for reading. - .PP - .TP 4 - 4. ---- a/psaccs_atop -+++ b/psaccs_atop -@@ -10,11 +10,12 @@ - postrotate - # check if process accounting is installed - # -- if [ -e /etc/logrotate.d/psacct ] -- then -+ if grep -q 'savelog' /etc/cron.daily/acct 2>/dev/null; then - # check if process accounting is actually in use - # -- ACCTFILE=`awk '$2 == "{" {print $1}' /etc/logrotate.d/psacct` -+ # this is a heuristic that will fail once acct's cron.daily job changes -+ # please file a bug report against atop if you encounter this -+ ACCTFILE=$(sed -n "/savelog[^\/]\+\(\/[[:alnum:]\/]\+\).*/{s//\1/;p;q;}" /etc/cron.daily/acct) - - if [ -f "$ACCTFILE" ] - then ---- a/psaccu_atop -+++ b/psaccu_atop -@@ -8,7 +8,7 @@ - ifempty - create 0600 root root - postrotate -- if [ -e /etc/logrotate.d/psacct ] -+ if grep -q 'savelog.*/var/log/account/pacct' /etc/cron.daily/acct 2>/dev/null - then - # if the atop daemon does not run, restart it after - # accounting file is rotated diff -Nru atop-2.6.0/debian/patches/atopacct.service atop-2.7.1/debian/patches/atopacct.service --- atop-2.6.0/debian/patches/atopacct.service 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/atopacct.service 2022-01-10 10:44:14.000000000 +0000 @@ -1,13 +1,14 @@ -Description: don't depend on obsolete syslog target (syslog is socket activated) +Description: adapt upstreams service file to Debian Author: Marc Haber Forwarded: no Last-Update: 2016-08-07 --- a/atopacct.service +++ b/atopacct.service -@@ -2,7 +2,6 @@ +@@ -1,8 +1,6 @@ + [Unit] Description=Atop process accounting daemon Documentation=man:atopacctd(8) - Conflicts=psacct.service +-Conflicts=psacct.service -After=syslog.target Before=atop.service diff -Nru atop-2.6.0/debian/patches/atop-pm atop-2.7.1/debian/patches/atop-pm --- atop-2.6.0/debian/patches/atop-pm 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/atop-pm 2022-01-10 10:44:14.000000000 +0000 @@ -13,7 +13,7 @@ CFLAGS += -O2 -I. -Wall -Wno-stringop-truncation # -DNOPERFEVENT # -DHTTPSTATS OBJMOD0 = version.o -@@ -68,8 +68,8 @@ systemdinstall: genericinstall +@@ -66,8 +66,8 @@ install: genericinstall chmod 0644 $(DESTDIR)$(SYSDPATH)/atop-rotate.service cp atop-rotate.timer $(DESTDIR)$(SYSDPATH) chmod 0644 $(DESTDIR)$(SYSDPATH)/atop-rotate.timer diff -Nru atop-2.6.0/debian/patches/default atop-2.7.1/debian/patches/default --- atop-2.6.0/debian/patches/default 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/debian/patches/default 2022-01-10 10:44:14.000000000 +0000 @@ -0,0 +1,15 @@ +Description: create Debian's atop.default file as patched from Upstream's +Author: Marc Haber +Forwarded: no +Last-Update: 2019-02-17 +--- a/atop.default ++++ b/atop.default +@@ -1,4 +1,7 @@ +-LOGOPTS="" ++# /etc/default/atop ++# see man atoprc for more possibilities to configure atop execution ++ ++LOGOPTS="-R" + LOGINTERVAL=600 + LOGGENERATIONS=28 + LOGPATH=/var/log/atop diff -Nru atop-2.6.0/debian/patches/dh_installinit atop-2.7.1/debian/patches/dh_installinit --- atop-2.6.0/debian/patches/dh_installinit 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/dh_installinit 2022-01-10 10:44:14.000000000 +0000 @@ -4,7 +4,7 @@ Last-Update: 2016-08-07 --- a/Makefile +++ b/Makefile -@@ -92,8 +92,6 @@ sysvinstall: genericinstall +@@ -93,8 +93,6 @@ sysvinstall: genericinstall if [ ! -d $(DESTDIR)$(ROTPATH) ]; \ then mkdir -p $(DESTDIR)$(ROTPATH); fi # diff -Nru atop-2.6.0/debian/patches/dh_systemd_enable atop-2.7.1/debian/patches/dh_systemd_enable --- atop-2.6.0/debian/patches/dh_systemd_enable 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/dh_systemd_enable 2022-01-10 10:44:14.000000000 +0000 @@ -4,7 +4,7 @@ Last-Update: 2016-08-07 --- a/Makefile +++ b/Makefile -@@ -64,16 +64,10 @@ systemdinstall: genericinstall +@@ -62,16 +62,10 @@ install: genericinstall if [ ! -d $(DESTDIR)$(PMPATHD) ]; \ then mkdir -p $(DESTDIR)$(PMPATHD); fi # diff -Nru atop-2.6.0/debian/patches/handle-default-file atop-2.7.1/debian/patches/handle-default-file --- atop-2.6.0/debian/patches/handle-default-file 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/handle-default-file 2022-01-10 10:44:14.000000000 +0000 @@ -12,5 +12,5 @@ - chmod 644 $(DESTDIR)$(DEFPATH)/atop - # cp atop $(DESTDIR)$(BINPATH)/atop - chown root $(DESTDIR)$(BINPATH)/atop - chmod 04711 $(DESTDIR)$(BINPATH)/atop + chmod 0711 $(DESTDIR)$(BINPATH)/atop + ln -sf atop $(DESTDIR)$(BINPATH)/atopsar diff -Nru atop-2.6.0/debian/patches/logrotate-nomail atop-2.7.1/debian/patches/logrotate-nomail --- atop-2.6.0/debian/patches/logrotate-nomail 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/logrotate-nomail 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -Description: set nomail in logrotate files -Author: Marc Haber -Forwarded: no -Last-Update: 2016-08-11 ---- a/psaccs_atop -+++ b/psaccs_atop -@@ -3,6 +3,8 @@ - missingok - daily - rotate 0 -+ nomail -+ nocompress - ifempty - create 0600 root root - postrotate ---- a/psaccu_atop -+++ b/psaccu_atop -@@ -3,6 +3,8 @@ - missingok - daily - rotate 0 -+ nomail -+ nocompress - ifempty - create 0600 root root - postrotate diff -Nru atop-2.6.0/debian/patches/no-atopgpud atop-2.7.1/debian/patches/no-atopgpud --- atop-2.6.0/debian/patches/no-atopgpud 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/no-atopgpud 2022-01-10 10:44:14.000000000 +0000 @@ -4,20 +4,18 @@ Last-Update: 2019-01-18 --- a/Makefile +++ b/Makefile -@@ -152,9 +152,9 @@ genericinstall: atop atopacctd atopconve +@@ -150,8 +150,8 @@ genericinstall: atop atopacctd atopconve + ln -sf atop $(DESTDIR)$(BINPATH)/atopsar cp atopacctd $(DESTDIR)$(SBINPATH)/atopacctd - chown root $(DESTDIR)$(SBINPATH)/atopacctd chmod 0700 $(DESTDIR)$(SBINPATH)/atopacctd - cp atopgpud $(DESTDIR)$(SBINPATH)/atopgpud -- chown root $(DESTDIR)$(SBINPATH)/atopgpud - chmod 0700 $(DESTDIR)$(SBINPATH)/atopgpud + #cp atopgpud $(DESTDIR)$(SBINPATH)/atopgpud -+ #chown root $(DESTDIR)$(SBINPATH)/atopgpud + #chmod 0700 $(DESTDIR)$(SBINPATH)/atopgpud cp atopconvert $(DESTDIR)$(BINPATH)/atopconvert - chown root $(DESTDIR)$(BINPATH)/atopconvert chmod 0711 $(DESTDIR)$(BINPATH)/atopconvert -@@ -167,7 +167,7 @@ genericinstall: atop atopacctd atopconve + cp atopcat $(DESTDIR)$(BINPATH)/atopcat +@@ -162,7 +162,7 @@ genericinstall: atop atopacctd atopconve cp man/atopcat.1 $(DESTDIR)$(MAN1PATH) cp man/atoprc.5 $(DESTDIR)$(MAN5PATH) cp man/atopacctd.8 $(DESTDIR)$(MAN8PATH) diff -Nru atop-2.6.0/debian/patches/no-files-in-var-log atop-2.7.1/debian/patches/no-files-in-var-log --- atop-2.6.0/debian/patches/no-files-in-var-log 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/no-files-in-var-log 2022-01-10 10:44:14.000000000 +0000 @@ -4,10 +4,10 @@ Last-Update: 2016-08-07 --- a/Makefile +++ b/Makefile -@@ -97,8 +97,6 @@ sysvinstall: genericinstall +@@ -96,8 +96,6 @@ sysvinstall: genericinstall + cp atop.cronsysv $(DESTDIR)$(CRNPATH)/atop + cp atop.daily $(DESTDIR)$(SCRPATH) chmod 0711 $(DESTDIR)$(SCRPATH)/atop.daily - cp psaccs_atop $(DESTDIR)$(ROTPATH)/psaccs_atop - cp psaccu_atop $(DESTDIR)$(ROTPATH)/psaccu_atop - touch $(DESTDIR)$(LOGPATH)/dummy_before - touch $(DESTDIR)$(LOGPATH)/dummy_after # diff -Nru atop-2.6.0/debian/patches/no-version-symlinks atop-2.7.1/debian/patches/no-version-symlinks --- atop-2.6.0/debian/patches/no-version-symlinks 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/no-version-symlinks 2022-01-10 10:44:14.000000000 +0000 @@ -4,12 +4,12 @@ Last-Update: 2016-08-07 --- a/Makefile +++ b/Makefile -@@ -155,8 +155,6 @@ genericinstall: atop atopacctd atopconve +@@ -152,8 +152,6 @@ genericinstall: atop atopacctd atopconve + chmod 0700 $(DESTDIR)$(SBINPATH)/atopacctd cp atopgpud $(DESTDIR)$(SBINPATH)/atopgpud - chown root $(DESTDIR)$(SBINPATH)/atopgpud chmod 0700 $(DESTDIR)$(SBINPATH)/atopgpud - cp atop $(DESTDIR)$(BINPATH)/atop-$(VERS) - ln -sf atop-$(VERS) $(DESTDIR)$(BINPATH)/atopsar-$(VERS) cp atopconvert $(DESTDIR)$(BINPATH)/atopconvert - chown root $(DESTDIR)$(BINPATH)/atopconvert chmod 0711 $(DESTDIR)$(BINPATH)/atopconvert + cp atopcat $(DESTDIR)$(BINPATH)/atopcat diff -Nru atop-2.6.0/debian/patches/series atop-2.7.1/debian/patches/series --- atop-2.6.0/debian/patches/series 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/series 2022-01-10 10:44:14.000000000 +0000 @@ -9,8 +9,7 @@ no-files-in-var-log no-version-symlinks var-run -logrotate-nomail atop-pm no-atopgpud handle-default-file -acct-compat +default diff -Nru atop-2.6.0/debian/patches/var-run atop-2.7.1/debian/patches/var-run --- atop-2.6.0/debian/patches/var-run 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/patches/var-run 2022-01-10 10:44:14.000000000 +0000 @@ -80,7 +80,7 @@ status) --- a/atopacct.service +++ b/atopacct.service -@@ -6,7 +6,7 @@ Before=atop.service +@@ -5,7 +5,7 @@ Before=atop.service [Service] Type=forking @@ -102,7 +102,7 @@ ** Below this top-directory the source file pacct_source is created and --- a/atopacctd.h +++ b/atopacctd.h -@@ -7,7 +7,7 @@ +@@ -35,7 +35,7 @@ /* ** name of the PID file */ @@ -111,7 +111,7 @@ /* ** directory containing the source accounting file and -@@ -15,7 +15,7 @@ +@@ -43,7 +43,7 @@ ** this directory can be overruled by a command line parameter (atopacctd) ** or by a keyword in the /etc/atoprc file (atop) */ @@ -122,7 +122,7 @@ ** accounting file (source file to which kernel writes records) --- a/man/atop.1 +++ b/man/atop.1 -@@ -2386,7 +2386,7 @@ output about the CPU utilization: +@@ -2510,7 +2510,7 @@ output about the CPU utilization: .SH FILES .PP .TP 5 @@ -131,7 +131,7 @@ Directory containing the process accounting shadow files that are used by .I atop -@@ -2445,7 +2445,7 @@ All binary system and process level data +@@ -2569,7 +2569,7 @@ All binary system and process level data in compressed format. .PP .TP 5 @@ -185,7 +185,8 @@ daemon is started with an alternative topdirectory as command line argument. --- a/netatopd.h +++ b/netatopd.h -@@ -1,6 +1,6 @@ +@@ -28,7 +28,7 @@ + #define SEMAKEY 1541961 -#define NETEXITFILE "/var/run/netatop.log" @@ -193,25 +194,3 @@ #define MYMAGIC (unsigned int) 0xfeedb0b0 struct naheader { ---- a/psaccs_atop -+++ b/psaccs_atop -@@ -24,7 +24,7 @@ - # stop atop daemon before accounting file - # is rotated - # -- PIDFILE=/var/run/atop.pid -+ PIDFILE=/run/atop.pid - - if [ -e $PIDFILE ] && \ - ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null ---- a/psaccu_atop -+++ b/psaccu_atop -@@ -10,7 +10,7 @@ - then - # if the atop daemon does not run, restart it after - # accounting file is rotated -- PIDFILE=/var/run/atop.pid -+ PIDFILE=/run/atop.pid - - if [ -e $PIDFILE ] && \ - ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null diff -Nru atop-2.6.0/debian/rules atop-2.7.1/debian/rules --- atop-2.6.0/debian/rules 2021-02-09 14:34:09.000000000 +0000 +++ atop-2.7.1/debian/rules 2022-01-10 10:44:14.000000000 +0000 @@ -15,8 +15,13 @@ override_dh_auto_install: dh_auto_install make sysvinstall DESTDIR=$(shell pwd)/debian/atop - make systemdinstall DESTDIR=$(shell pwd)/debian/atop + make install DESTDIR=$(shell pwd)/debian/atop + cp atop.default debian/atop.default cp atop.service debian/atop.service cp atopacct.service debian/atopacct.service cp atop.init debian/atop.init cp atopacct.init debian/atopacct.init + +override_dh_installsystemd: + dh_installsystemd --no-enable --no-start atop-rotate.service + dh_installsystemd atop-rotate.timer atop.service atopacct.service diff -Nru atop-2.6.0/debian/salsa-ci.yml atop-2.7.1/debian/salsa-ci.yml --- atop-2.6.0/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/debian/salsa-ci.yml 2022-01-10 10:44:14.000000000 +0000 @@ -0,0 +1,2 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml diff -Nru atop-2.6.0/debian/tests/01-numcpus atop-2.7.1/debian/tests/01-numcpus --- atop-2.6.0/debian/tests/01-numcpus 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/debian/tests/01-numcpus 2022-01-10 10:44:14.000000000 +0000 @@ -0,0 +1,12 @@ +#!/bin/bash + +# atop reports number of CPU and two extra lines +ATOPSOPINION="$(atop -P cpu 5 1 | wc -l)" +TRUTH="$(lscpu | awk '/^CPU\(s\)/{print $2}')" + +if [ "$(( TRUTH + 2 ))" -ne "$ATOPSOPINION" ]; then + exit 1 +fi + exit 0 +fi + diff -Nru atop-2.6.0/debian/tests/control atop-2.7.1/debian/tests/control --- atop-2.6.0/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/debian/tests/control 2022-01-10 10:44:14.000000000 +0000 @@ -0,0 +1,2 @@ +Tests: 01-numcpus + diff -Nru atop-2.6.0/debian/upstream/metadata atop-2.7.1/debian/upstream/metadata --- atop-2.6.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/debian/upstream/metadata 2022-01-10 10:44:14.000000000 +0000 @@ -0,0 +1,7 @@ +--- +Bug-Database: https://github.com/atoptool/atop/issues +Bug-Submit: https://github.com/atoptool/atop/issues/new +Changelog: https://github.com/atoptool/atop/commits/master +Documentation: https://github.com/atoptool/atop +Repository: https://github.com/atoptool/atop.git +Repository-Browse: https://github.com/atoptool/atop diff -Nru atop-2.6.0/deviate.c atop-2.7.1/deviate.c --- atop-2.6.0/deviate.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/deviate.c 2022-01-08 11:49:00.000000000 +0000 @@ -12,7 +12,7 @@ ** Date: November 1996 ** LINUX-port: June 2000 ** -------------------------------------------------------------------------- -** Copyright (C) 2000-2010 Gerlof Langeveld +** Copyright (C) 2000-2021 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 @@ -28,144 +28,6 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** -------------------------------------------------------------------------- -** -** $Log: deviate.c,v $ -** Revision 1.45 2010/10/23 14:02:03 gerlof -** Show counters for total number of running and sleep (S and D) threads. -** -** Revision 1.44 2010/05/18 19:19:43 gerlof -** Introduce CPU frequency and scaling (JC van Winkel). -** -** Revision 1.43 2010/04/23 12:19:35 gerlof -** Modified mail-address in header. -** -** Revision 1.42 2010/03/04 10:52:08 gerlof -** Support I/O-statistics on logical volumes and MD devices. -** -** Revision 1.41 2009/12/31 11:34:21 gerlof -** Sanity-check to bypass kernel-bug showing 497 days of CPU-consumption. -** -** Revision 1.40 2009/12/17 11:58:25 gerlof -** Gather and display new counters: dirty cache and guest cpu usage. -** -** Revision 1.39 2008/02/25 14:51:18 gerlof -** Experimental code for HTTP-statistics. -** -** Revision 1.38 2008/01/07 11:33:43 gerlof -** Cosmetic changes. -** -** Revision 1.37 2008/01/07 10:17:24 gerlof -** Implement possibility to make summaries. -** -** Revision 1.36 2007/11/05 12:13:16 gerlof -** Match processes not only on pid, but also on start time. -** -** Revision 1.35 2007/11/05 11:42:47 gerlof -** Bug-solution for new-process indicator on 64-bits machines. -** -** Revision 1.34 2007/08/17 09:44:59 gerlof -** Experimental: gather info about HTTP statistics. -** -** Revision 1.33 2007/08/16 11:59:32 gerlof -** Add support for atopsar reporting. -** Concerns addition of lots of counters. -** -** Revision 1.32 2007/07/03 09:01:07 gerlof -** Support Apache-statistics. -** -** Revision 1.31 2007/03/20 13:02:03 gerlof -** Introduction of variable supportflags. -** -** Revision 1.30 2007/03/20 11:18:57 gerlof -** Add counter for cancelled writes. -** -** Revision 1.29 2007/02/13 09:21:04 gerlof -** Removed external declarations. -** -** Revision 1.28 2007/01/22 08:28:18 gerlof -** Support steal-time from /proc/stat. -** -** Revision 1.27 2007/01/18 10:43:18 gerlof -** Support for network-interface busy-percentage (speed and duplex). -** -** Revision 1.26 2006/11/13 13:47:26 gerlof -** Implement load-average counters, context-switches and interrupts. -** -** Revision 1.25 2006/02/07 06:45:33 gerlof -** Removed swap-counter. -** -** Revision 1.24 2006/01/30 09:13:33 gerlof -** Extend memory counters (a.o. page scans). -** -** Revision 1.23 2005/10/31 12:45:29 gerlof -** Support account-record version 3 (used by Mandriva). -** -** Revision 1.22 2005/10/21 09:49:38 gerlof -** Per-user accumulation of resource consumption. -** -** Revision 1.21 2004/12/14 15:05:47 gerlof -** Implementation of patch-recognition for disk and network-statistics. -** -** Revision 1.20 2004/10/28 08:30:51 gerlof -** New counter: vm committed space -** -** Revision 1.19 2004/09/24 10:02:01 gerlof -** Wrong cpu-numbers for system level statistics. -** -** Revision 1.18 2004/09/02 10:49:18 gerlof -** Added sleep-average to process-info. -** -** Revision 1.17 2004/08/31 13:27:04 gerlof -** Add new info for threading. -** -** Revision 1.16 2004/05/07 05:49:40 gerlof -** *** empty log message *** -** -** Revision 1.15 2004/05/06 09:46:55 gerlof -** Ported to kernel-version 2.6. -** -** Revision 1.14 2003/07/07 09:26:33 gerlof -** Cleanup code (-Wall proof). -** -** Revision 1.13 2003/07/03 11:17:49 gerlof -** Corrected calculations for exited processes. -** -** Revision 1.12 2003/06/30 11:30:57 gerlof -** Enlarge counters to 'long long'. -** -** Revision 1.11 2003/06/24 06:21:12 gerlof -** Limit number of system resource lines. -** -** Revision 1.10 2003/01/24 14:20:16 gerlof -** If possible, also show commandline when process has exited. -** -** Revision 1.9 2002/09/16 08:58:08 gerlof -** Add indicator for newly created processes. -** -** Revision 1.8 2002/08/27 04:47:46 gerlof -** Minor comment updates. -** -** Revision 1.7 2002/07/24 11:12:20 gerlof -** Redesigned to ease porting to other UNIX-platforms. -** -** Revision 1.6 2002/07/10 04:59:37 root -** Counters pin/pout renamed to swin/swout (Linux conventions). -** -** Revision 1.5 2002/01/22 13:39:20 gerlof -** Support for number of cpu's. -** -** Revision 1.4 2001/11/22 08:33:10 gerlof -** Add priority per process. -** -** Revision 1.3 2001/11/07 09:18:22 gerlof -** Use /proc instead of /dev/kmem for process-level statistics. -** -** Revision 1.2 2001/10/03 08:58:41 gerlof -** Improved subtraction which is overflow-proof -** -** Revision 1.1 2001/10/02 10:43:23 gerlof -** Initial revision -** */ #include @@ -187,10 +49,10 @@ #include "photoproc.h" #include "photosyst.h" -#define MAX32BITVAL 0x100000000LL - -static void calcdiff(struct tstat *, struct tstat *, struct tstat *, - char, count_t); +static void calcdiff(struct tstat *, const struct tstat *, + const struct tstat *, + char, count_t); +static inline count_t subcount(count_t, count_t); /* ** calculate the process-activity during the last sample @@ -203,7 +65,7 @@ { register int c, d, pall=0, pact=0; register struct tstat *curstat, *devstat, *thisproc; - struct tstat prestat; + struct tstat prestat, *pprestat; struct pinfo *pinfo; count_t totusedcpu; char hashtype = 'p'; @@ -294,6 +156,7 @@ ** no activity for task */ curstat->gen.wasinactive = 1; + pprestat = curstat; } else { @@ -303,6 +166,7 @@ ** the database with the current sample */ prestat = pinfo->tstat; + pprestat = &prestat; pinfo->tstat = *curstat; curstat->gen.wasinactive = 0; @@ -331,6 +195,7 @@ ** last interval */ memset(&prestat, 0, sizeof(prestat)); + pprestat = &prestat; curstat->gen.wasinactive = 0; devtstat->ntaskactive++; @@ -369,7 +234,7 @@ /* ** do the difference calculations */ - calcdiff(devstat, curstat, &prestat, newtask, totusedcpu); + calcdiff(devstat, curstat, pprestat, newtask, totusedcpu); } /* @@ -558,17 +423,21 @@ ** the previous sample for a task */ static void -calcdiff(struct tstat *devstat, struct tstat *curstat, struct tstat *prestat, - char newtask, count_t totusedcpu) +calcdiff(struct tstat *devstat, const struct tstat *curstat, + const struct tstat *prestat, + char newtask, count_t totusedcpu) { /* - ** for inactive tasks, set all counters to zero + ** for inactive tasks, set all counters to zero to avoid calculating + ** the deviations (after all, there are no deviations) */ if (curstat->gen.wasinactive) + { memset(devstat, 0, sizeof *devstat); + } /* - ** copy all static values from the current task settings + ** copy all STATIC values from the current task settings */ devstat->gen = curstat->gen; @@ -618,11 +487,15 @@ /* ** for inactive tasks, only the static values had to be copied, while - ** all use counters have been set to zero + ** all use counters have already been set to zero */ if (curstat->gen.wasinactive) return; + /* + ** calculate deviations for tasks that were really active + ** (i.e. modified) during the sample + */ devstat->cpu.stime = subcount(curstat->cpu.stime, prestat->cpu.stime); devstat->cpu.utime = @@ -642,9 +515,7 @@ devstat->cpu.rundelay = subcount(curstat->cpu.rundelay, prestat->cpu.rundelay); - /* - ** do further calculations - */ + devstat->dsk.rio = subcount(curstat->dsk.rio, prestat->dsk.rio); devstat->dsk.rsz = @@ -826,6 +697,10 @@ dev->mem.vmwballoon = cur->mem.vmwballoon; dev->mem.zfsarcsize = cur->mem.zfsarcsize; + dev->mem.ksmsharing = cur->mem.ksmsharing; + dev->mem.ksmshared = cur->mem.ksmshared; + dev->mem.zswstored = cur->mem.zswstored; + dev->mem.zswtotpool = cur->mem.zswtotpool; dev->mem.swouts = subcount(cur->mem.swouts, pre->mem.swouts); dev->mem.swins = subcount(cur->mem.swins, pre->mem.swins); @@ -834,7 +709,63 @@ dev->mem.allocstall = subcount(cur->mem.allocstall, pre->mem.allocstall); - dev->psi = cur->psi; + if (cur->mem.oomkills != -1) + dev->mem.oomkills = subcount(cur->mem.oomkills, pre->mem.oomkills); + else + dev->mem.oomkills = -1; + + dev->mem.compactstall = subcount(cur->mem.compactstall, + pre->mem.compactstall); + dev->mem.numamigrate = subcount(cur->mem.numamigrate, pre->mem.numamigrate); + dev->mem.pgmigrate = subcount(cur->mem.pgmigrate, pre->mem.pgmigrate); + + dev->memnuma.nrnuma = cur->memnuma.nrnuma; + + for (i=0; i < dev->memnuma.nrnuma; i++) + { + dev->memnuma.numa[i].totmem = cur->memnuma.numa[i].totmem; + dev->memnuma.numa[i].freemem = cur->memnuma.numa[i].freemem; + dev->memnuma.numa[i].filepage = cur->memnuma.numa[i].filepage; + dev->memnuma.numa[i].active = cur->memnuma.numa[i].active; + dev->memnuma.numa[i].inactive = cur->memnuma.numa[i].inactive; + dev->memnuma.numa[i].dirtymem = cur->memnuma.numa[i].dirtymem; + dev->memnuma.numa[i].shmem = cur->memnuma.numa[i].shmem; + dev->memnuma.numa[i].slabmem = cur->memnuma.numa[i].slabmem; + dev->memnuma.numa[i].slabreclaim = cur->memnuma.numa[i].slabreclaim; + dev->memnuma.numa[i].tothp = cur->memnuma.numa[i].tothp; + dev->memnuma.numa[i].frag = cur->memnuma.numa[i].frag; + } + + dev->cpunuma.nrnuma = cur->cpunuma.nrnuma; + + if (dev->cpunuma.nrnuma > 1) + { + for (i=0; i < dev->cpunuma.nrnuma; i++) + { + dev->cpunuma.numa[i].nrcpu = cur->cpunuma.numa[i].nrcpu; + + dev->cpunuma.numa[i].utime = subcount(cur->cpunuma.numa[i].utime, + pre->cpunuma.numa[i].utime); + dev->cpunuma.numa[i].ntime = subcount(cur->cpunuma.numa[i].ntime, + pre->cpunuma.numa[i].ntime); + dev->cpunuma.numa[i].stime = subcount(cur->cpunuma.numa[i].stime, + pre->cpunuma.numa[i].stime); + dev->cpunuma.numa[i].itime = subcount(cur->cpunuma.numa[i].itime, + pre->cpunuma.numa[i].itime); + dev->cpunuma.numa[i].wtime = subcount(cur->cpunuma.numa[i].wtime, + pre->cpunuma.numa[i].wtime); + dev->cpunuma.numa[i].Itime = subcount(cur->cpunuma.numa[i].Itime, + pre->cpunuma.numa[i].Itime); + dev->cpunuma.numa[i].Stime = subcount(cur->cpunuma.numa[i].Stime, + pre->cpunuma.numa[i].Stime); + dev->cpunuma.numa[i].steal = subcount(cur->cpunuma.numa[i].steal, + pre->cpunuma.numa[i].steal); + dev->cpunuma.numa[i].guest = subcount(cur->cpunuma.numa[i].guest, + pre->cpunuma.numa[i].guest); + } + } + + dev->psi = cur->psi; if (cur->psi.present) { @@ -934,18 +865,10 @@ /* ** calculate deviations for interfaces - ** - ** refresh all interface properties */ - regainrootprivs(); /* get root privileges */ - - initifprop(); /* refresh interface info */ - - if (! droprootprivs()) /* drop setuid-root privs */ - mcleanstop(42, "failed to drop root privs\n"); - for (i=0; cur->intf.intf[i].name[0]; i++) { + // fill current properties for each valid interface strcpy(ifprop.name, cur->intf.intf[i].name); getifprop(&ifprop); @@ -1081,10 +1004,10 @@ dev->dsk.dsk[i].nread = subcount(cur->dsk.dsk[i].nread, pre->dsk.dsk[j].nread); - dev->dsk.dsk[i].nwrite = subcount(cur->dsk.dsk[i].nwrite, - pre->dsk.dsk[j].nwrite); dev->dsk.dsk[i].nrsect = subcount(cur->dsk.dsk[i].nrsect, pre->dsk.dsk[j].nrsect); + dev->dsk.dsk[i].nwrite = subcount(cur->dsk.dsk[i].nwrite, + pre->dsk.dsk[j].nwrite); dev->dsk.dsk[i].nwsect = subcount(cur->dsk.dsk[i].nwsect, pre->dsk.dsk[j].nwsect); dev->dsk.dsk[i].io_ms = subcount(cur->dsk.dsk[i].io_ms, @@ -1092,6 +1015,19 @@ dev->dsk.dsk[i].avque = subcount(cur->dsk.dsk[i].avque, pre->dsk.dsk[j].avque); + if (cur->dsk.dsk[i].ndisc != -1) // discards supported? + { + dev->dsk.dsk[i].ndisc = subcount(cur->dsk.dsk[i].ndisc, + pre->dsk.dsk[j].ndisc); + dev->dsk.dsk[i].ndsect = subcount(cur->dsk.dsk[i].ndsect, + pre->dsk.dsk[j].ndsect); + } + else + { + dev->dsk.dsk[i].ndisc = -1; + dev->dsk.dsk[i].ndsect = 0; + } + /* ** determine new j */ @@ -1137,10 +1073,10 @@ dev->dsk.mdd[i].nread = subcount(cur->dsk.mdd[i].nread, pre->dsk.mdd[j].nread); - dev->dsk.mdd[i].nwrite = subcount(cur->dsk.mdd[i].nwrite, - pre->dsk.mdd[j].nwrite); dev->dsk.mdd[i].nrsect = subcount(cur->dsk.mdd[i].nrsect, pre->dsk.mdd[j].nrsect); + dev->dsk.mdd[i].nwrite = subcount(cur->dsk.mdd[i].nwrite, + pre->dsk.mdd[j].nwrite); dev->dsk.mdd[i].nwsect = subcount(cur->dsk.mdd[i].nwsect, pre->dsk.mdd[j].nwsect); dev->dsk.mdd[i].io_ms = subcount(cur->dsk.mdd[i].io_ms, @@ -1148,6 +1084,19 @@ dev->dsk.mdd[i].avque = subcount(cur->dsk.mdd[i].avque, pre->dsk.mdd[j].avque); + if (cur->dsk.mdd[i].ndisc != -1) // discards supported? + { + dev->dsk.mdd[i].ndisc = subcount(cur->dsk.mdd[i].ndisc, + pre->dsk.mdd[j].ndisc); + dev->dsk.mdd[i].ndsect = subcount(cur->dsk.mdd[i].ndsect, + pre->dsk.mdd[j].ndsect); + } + else + { + dev->dsk.mdd[i].ndisc = -1; + dev->dsk.mdd[i].ndsect = 0; + } + /* ** determine new j */ @@ -1193,10 +1142,10 @@ dev->dsk.lvm[i].nread = subcount(cur->dsk.lvm[i].nread, pre->dsk.lvm[j].nread); - dev->dsk.lvm[i].nwrite = subcount(cur->dsk.lvm[i].nwrite, - pre->dsk.lvm[j].nwrite); dev->dsk.lvm[i].nrsect = subcount(cur->dsk.lvm[i].nrsect, pre->dsk.lvm[j].nrsect); + dev->dsk.lvm[i].nwrite = subcount(cur->dsk.lvm[i].nwrite, + pre->dsk.lvm[j].nwrite); dev->dsk.lvm[i].nwsect = subcount(cur->dsk.lvm[i].nwsect, pre->dsk.lvm[j].nwsect); dev->dsk.lvm[i].io_ms = subcount(cur->dsk.lvm[i].io_ms, @@ -1204,6 +1153,19 @@ dev->dsk.lvm[i].avque = subcount(cur->dsk.lvm[i].avque, pre->dsk.lvm[j].avque); + if (cur->dsk.lvm[i].ndisc != -1) // discards supported? + { + dev->dsk.lvm[i].ndisc = subcount(cur->dsk.lvm[i].ndisc, + pre->dsk.lvm[j].ndisc); + dev->dsk.lvm[i].ndsect = subcount(cur->dsk.lvm[i].ndsect, + pre->dsk.lvm[j].ndsect); + } + else + { + dev->dsk.lvm[i].ndisc = -1; + dev->dsk.lvm[i].ndsect = 0; + } + /* ** determine new j */ @@ -1546,6 +1508,7 @@ tot->mem.swins += new->mem.swins; tot->mem.pgscans += new->mem.pgscans; tot->mem.allocstall += new->mem.allocstall; + tot->mem.compactstall += new->mem.compactstall; break; case 'n': /* accumulate network-related counters */ @@ -1716,11 +1679,18 @@ strcpy(tot->dsk.dsk[i].name, new->dsk.dsk[i].name); tot->dsk.dsk[i].nread += new->dsk.dsk[i].nread; - tot->dsk.dsk[i].nwrite += new->dsk.dsk[i].nwrite; tot->dsk.dsk[i].nrsect += new->dsk.dsk[i].nrsect; + tot->dsk.dsk[i].nwrite += new->dsk.dsk[i].nwrite; tot->dsk.dsk[i].nwsect += new->dsk.dsk[i].nwsect; tot->dsk.dsk[i].io_ms += new->dsk.dsk[i].io_ms; tot->dsk.dsk[i].avque += new->dsk.dsk[i].avque; + + if (new->dsk.dsk[i].ndisc != -1) // discards? + { + tot->dsk.dsk[i].ndisc += new->dsk.dsk[i].ndisc; + tot->dsk.dsk[i].ndsect += new->dsk.dsk[i].ndsect; + } + } tot->dsk.dsk[i].name[0] = '\0'; @@ -1731,11 +1701,17 @@ strcpy(tot->dsk.lvm[i].name, new->dsk.lvm[i].name); tot->dsk.lvm[i].nread += new->dsk.lvm[i].nread; - tot->dsk.lvm[i].nwrite += new->dsk.lvm[i].nwrite; tot->dsk.lvm[i].nrsect += new->dsk.lvm[i].nrsect; + tot->dsk.lvm[i].nwrite += new->dsk.lvm[i].nwrite; tot->dsk.lvm[i].nwsect += new->dsk.lvm[i].nwsect; tot->dsk.lvm[i].io_ms += new->dsk.lvm[i].io_ms; tot->dsk.lvm[i].avque += new->dsk.lvm[i].avque; + + if (new->dsk.lvm[i].ndisc != -1) // discards? + { + tot->dsk.lvm[i].ndisc += new->dsk.lvm[i].ndisc; + tot->dsk.lvm[i].ndsect += new->dsk.lvm[i].ndsect; + } } tot->dsk.lvm[i].name[0] = '\0'; @@ -1746,11 +1722,17 @@ strcpy(tot->dsk.mdd[i].name, new->dsk.mdd[i].name); tot->dsk.mdd[i].nread += new->dsk.mdd[i].nread; - tot->dsk.mdd[i].nwrite += new->dsk.mdd[i].nwrite; tot->dsk.mdd[i].nrsect += new->dsk.mdd[i].nrsect; + tot->dsk.mdd[i].nwrite += new->dsk.mdd[i].nwrite; tot->dsk.mdd[i].nwsect += new->dsk.mdd[i].nwsect; tot->dsk.mdd[i].io_ms += new->dsk.mdd[i].io_ms; tot->dsk.mdd[i].avque += new->dsk.mdd[i].avque; + + if (new->dsk.mdd[i].ndisc != -1) // discards? + { + tot->dsk.mdd[i].ndisc += new->dsk.lvm[i].ndisc; + tot->dsk.mdd[i].ndsect += new->dsk.lvm[i].ndsect; + } } tot->dsk.mdd[i].name[0] = '\0'; @@ -1762,13 +1744,17 @@ /* ** Generic function to subtract two counters taking into -** account the possibility of overflow of a 32-bit kernel-counter. +** account the possibility that the counter is invalid +** (i.e. non-existing). */ -count_t +static inline count_t subcount(count_t newval, count_t oldval) { - if (newval >= oldval) + if (newval == -1) // invalid counter? + return -1; + + if (newval >= oldval) // normal situation return newval - oldval; - else - return MAX32BITVAL + newval - oldval; + else // counter seems to be reset + return newval; } diff -Nru atop-2.6.0/gpucom.h atop-2.7.1/gpucom.h --- atop-2.6.0/gpucom.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/gpucom.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,3 +1,31 @@ +/* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ + #ifndef __GPUCOM__ #define __GPUCOM__ diff -Nru atop-2.6.0/ifprop.c atop-2.7.1/ifprop.c --- atop-2.6.0/ifprop.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/ifprop.c 2022-01-08 11:49:00.000000000 +0000 @@ -25,26 +25,19 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** -------------------------------------------------------------------------- -** -** $Id: ifprop.c,v 1.5 2010/04/23 12:19:35 gerlof Exp $ -** $Log: ifprop.c,v $ -** Revision 1.5 2010/04/23 12:19:35 gerlof -** Modified mail-address in header. -** -** Revision 1.4 2007/02/13 10:34:06 gerlof -** Removal of external declarations. -** */ #include #include #include #include #include +#include #include #include #include #include #include +#include typedef __u64 u64; typedef __u32 u32; @@ -61,74 +54,116 @@ #include "ifprop.h" #include "photosyst.h" -static struct ifprop ifprops[MAXINTF]; +static int calcbucket(char *); +static int getphysprop(struct ifprop *); + +/* +** hash table for linked lists with *all* interfaces +** of this system (including virtual interfaces), even +** if the number of interfaces exceeds the maximum that +** is supported by atop (MAXINTF) +** when the number of interfaces in the system exceeds MAXINTF, +** preferably virtual interfaces are marked 'invalid' to ensure +** that all physical interfaces are reported +** +** the hash table is meant to be searched on interface name +*/ +#define NUMIFHASH 256 // must be power of 2!! +static struct ifprop *ifhash[NUMIFHASH]; + +/* +** refresh interval of ifhash table +** +** periodic refreshing is needed because interfaces might have been +** created or removed, or the speed might have changed (e.g. with wireless) +*/ +#define REFRESHTIME 60 // seconds +static time_t lastrefreshed; // epoch /* -** function searches for the properties of a particular interface +** function that searches for the properties of a particular interface; ** the interface name should be filled in the struct ifprop before ** calling this function ** -** return value reflects true or false +** return value reflects true (valid interface) or false (invalid interface) */ int -getifprop(struct ifprop *ifp) +getifprop(struct ifprop *p) { - register int i; + register int bucket; + struct ifprop *ifp; + + /* + ** search properties related to given interface name + */ + bucket = calcbucket(p->name); - for (i=0; ifprops[i].name[0]; i++) + for (ifp=ifhash[bucket]; ifp; ifp=ifp->next) { - if (strcmp(ifp->name, ifprops[i].name) == 0) + if ( strcmp(ifp->name, p->name) == EQ ) { - *ifp = ifprops[i]; + if (ifp->type == 'i') // invalidated interface? + break; + + // valid interface; copy properties + *p = *ifp; return 1; } } - ifp->type = '?'; - ifp->speed = 0; - ifp->fullduplex = 0; + p->type = '?'; + p->speed = 0; + p->fullduplex = 0; return 0; } /* -** function stores properties of all interfaces in a static -** table to be queried later on -** -** this function should be called with superuser privileges! +** function (re)stores properties of all interfaces in a hash table */ void initifprop(void) { - FILE *fp; - char *cp, linebuf[2048]; - int i=0, sockfd; - - struct ethtool_link_settings ethlink; // preferred! - struct ethtool_cmd ethcmd; // deprecated + FILE *fp; + char *cp, linebuf[2048]; + struct ifprop *ifp, *ifpsave = NULL; + int bucket, nrinterfaces=0, nrphysical=0; - struct ifreq ifreq; - struct iwreq iwreq; - - unsigned long speed; - unsigned char duplex, phy_addr, ethernet; + DIR *dirp; + struct dirent *dentry; /* - ** open /proc/net/dev to obtain all interface names and open - ** a socket to determine the properties for each interface + ** verify if the interface properties have to be refreshed + ** at this moment already */ - if ( (fp = fopen("/proc/net/dev", "r")) == NULL) + if (time(0) < lastrefreshed + REFRESHTIME) return; - if ( (sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + /* + ** when this function has been called before, first remove + ** old entries + */ + if (lastrefreshed) { - fclose(fp); - return; + for (bucket=0; bucket < NUMIFHASH; bucket++) + { + for (ifp = ifhash[bucket]; ifp; ifp = ifpsave) + { + ifpsave = ifp->next; + free(ifp); + } + + ifhash[bucket] = NULL; + } } /* - ** read every name and obtain properties + ** open /proc/net/dev and read all interface names to be able to + ** setup new entries in the hash table */ + if ( (fp = fopen("/proc/net/dev", "r")) == NULL) + return; + while ( fgets(linebuf, sizeof(linebuf), fp) != NULL) { /* @@ -140,108 +175,268 @@ if ( (cp = strchr(linebuf, ':')) != NULL) *cp = ' '; /* subst ':' by space */ - sscanf(linebuf, "%15s", ifprops[i].name); + /* + ** allocate new ifprop struct for this interface + */ + ifp = malloc(sizeof *ifp); + + ptrverify(ifp, "Malloc failed for ifprop struct\n"); + + memset(ifp, 0, sizeof *ifp); + sscanf(linebuf, "%30s", ifp->name); // fill name + ifp->type = 'i'; // initially 'invalid' /* - ** determine properties of ethernet interface - ** preferably with actual struct ethtool_link_settings, - ** otherwise with deprecated struct ethtool_cmd + ** add ifprop struct to proper hash bucket */ - memset(&ifreq, 0, sizeof ifreq); - memset(ðcmd, 0, sizeof ethcmd); + bucket = calcbucket(ifp->name); - strncpy((void *)&ifreq.ifr_ifrn.ifrn_name, ifprops[i].name, - sizeof ifreq.ifr_ifrn.ifrn_name-1); + ifp->next = ifhash[bucket]; + ifhash[bucket] = ifp; - ethlink.cmd = ETHTOOL_GLINKSETTINGS; - ifreq.ifr_ifru.ifru_data = (void *)ðlink; + nrinterfaces++; + } - if ( ioctl(sockfd, SIOCETHTOOL, &ifreq) == 0) + fclose(fp); + + /* + ** read /sys/devices/virtual/net/xxx to determine which + ** interfaces are virtual (xxx is subdirectory name) + */ + if ( (dirp = opendir("/sys/devices/virtual/net")) ) + { + while ( (dentry = readdir(dirp)) ) { - ethernet = 1; - speed = ethlink.speed; - duplex = ethlink.duplex; - phy_addr = ethlink.phy_address; + if (dentry->d_name[0] == '.') + continue; + + // valid name + // search ifprop and mark it as 'virtual' + bucket = calcbucket(dentry->d_name); + + for (ifp = ifhash[bucket]; ifp; ifp = ifp->next) + { + if ( strcmp(ifp->name, dentry->d_name) == EQ ) + { + ifp->type = 'v'; // virtual interface + break; + } + } } - else + + closedir(dirp); + } + + + /* + ** for physical interfaces, determine the speed and duplex mode + */ + for (bucket=0; bucket < NUMIFHASH; bucket++) + { + for (ifp=ifhash[bucket]; ifp; ifp=ifp->next) { - ethcmd.cmd = ETHTOOL_GSET; - ifreq.ifr_ifru.ifru_data = (void *)ðcmd; + // possible physical interface? + if (ifp->type == 'i') + { + if (getphysprop(ifp)) + nrphysical++; + } + } + } + + lastrefreshed = time(0); - if ( ioctl(sockfd, SIOCETHTOOL, &ifreq) == 0) + if (nrinterfaces < MAXINTF) + return; + + /* + ** when the number of interfaces exceeds the maximum, + ** invalidate the appropriate number of interfaces (preferably + ** virtual interfaces) + */ + for (bucket=0; bucket < NUMIFHASH && nrinterfaces >= MAXINTF; bucket++) + { + for (ifp=ifhash[bucket]; ifp && nrinterfaces >= MAXINTF; ifp=ifp->next) + { + // interface invalid already? + if (ifp->type == 'i') { - ethernet = 1; - speed = ethcmd.speed; - duplex = ethcmd.duplex; - phy_addr = ethcmd.phy_address; + nrinterfaces--; + continue; } - else + + // physical interface (ethernet or wireless)? + if (ifp->type == 'e' || ifp->type == 'w') { - ethernet = 0; + // only invalidate when the number of physical + // interfaces exceeds MAXINTF + if (nrphysical >= MAXINTF) + { + ifp->type = 'i'; + + nrphysical--; + nrinterfaces--; + } + continue; } + + // virtual or unknown interface, invalidate anyhow + ifp->type = 'i'; + nrinterfaces--; } + } +} + +static int +calcbucket(char *p) +{ + int bucket = 0; + + while (*p) + bucket += *p++; + + return bucket & (NUMIFHASH-1); +} + +/* +** function gathers the properties of a particular physical interface; +** the name of the interface should have been filled before calling +** +** return value reflects true (success) or false (unknown interface type) +*/ +static int +getphysprop(struct ifprop *p) +{ + int sockfd; + +#ifdef ETHTOOL_GLINKSETTINGS + struct ethtool_link_settings *ethlink; // preferred! +#endif + struct ethtool_cmd ethcmd; // deprecated + + struct ifreq ifreq; + struct iwreq iwreq; + + unsigned long speed = 0; + unsigned char duplex = 0, ethernet = 0; + + + if ( (sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + return 0; + + /* + ** determine properties of ethernet interface + ** preferably with actual struct ethtool_link_settings, + ** otherwise with deprecated struct ethtool_cmd + */ + memset(&ifreq, 0, sizeof ifreq); - if (ethernet) + strncpy((void *)&ifreq.ifr_ifrn.ifrn_name, p->name, + sizeof ifreq.ifr_ifrn.ifrn_name-1); + +#ifdef ETHTOOL_GLINKSETTINGS + ethlink = calloc(1, sizeof *ethlink); + + ptrverify(ethlink, "Calloc failed for ethtool_link_settings\n"); + + ethlink->cmd = ETHTOOL_GLINKSETTINGS; + + ifreq.ifr_ifru.ifru_data = (void *)ethlink; + + if ( ioctl(sockfd, SIOCETHTOOL, &ifreq) == 0) + { + if (ethlink->link_mode_masks_nwords <= 0) { - ifprops[i].type = 'e'; // type ethernet + /* + ** hand shaked ethlink required with added maps + ** + ** layout of link_mode_masks fields: + ** __u32 map_supported[link_mode_masks_nwords]; + ** __u32 map_advertising[link_mode_masks_nwords]; + ** __u32 map_lp_advertising[link_mode_masks_nwords]; + */ + ethlink->link_mode_masks_nwords = -ethlink->link_mode_masks_nwords; - if (speed == (u32)SPEED_UNKNOWN) - ifprops[i].speed = 0; - else - ifprops[i].speed = speed; + ethlink = realloc(ethlink, sizeof *ethlink + + 3 * sizeof(__u32) * ethlink->link_mode_masks_nwords); - switch (duplex) - { - case DUPLEX_FULL: - ifprops[i].fullduplex = 1; - break; - default: - ifprops[i].fullduplex = 0; - } + ptrverify(ethlink, "Realloc failed for ethtool_link_settings\n"); - if (!phy_addr) // virtual interface? + ifreq.ifr_ifru.ifru_data = (void *)ethlink; // might have changed + + if ( ioctl(sockfd, SIOCETHTOOL, &ifreq) != 0 ) { - ifprops[i].type = '?'; // set type unknown - ifprops[i].speed = 0; - ifprops[i].fullduplex = 0; + close(sockfd); + free(ethlink); + return 0; } + } - if (++i >= MAXINTF-1) - break; - else - continue; + ethernet = 1; + speed = ethlink->speed; + duplex = ethlink->duplex; + + free(ethlink); + } + else +#endif + { + memset(ðcmd, 0, sizeof ethcmd); + + ethcmd.cmd = ETHTOOL_GSET; + ifreq.ifr_ifru.ifru_data = (void *)ðcmd; + + if ( ioctl(sockfd, SIOCETHTOOL, &ifreq) == 0) + { + ethernet = 1; + speed = ethcmd.speed; + duplex = ethcmd.duplex; } + } + + if (ethernet) + { + p->type = 'e'; // type ethernet + + if (speed == (u32)SPEED_UNKNOWN || speed == 65535) + p->speed = 0; + else + p->speed = speed; + switch (duplex) + { + case DUPLEX_FULL: + p->fullduplex = 1; + break; + default: + p->fullduplex = 0; + } + } + else + { /* ** determine properties of wireless interface */ memset(&iwreq, 0, sizeof iwreq); - strncpy(iwreq.ifr_ifrn.ifrn_name, ifprops[i].name, + strncpy(iwreq.ifr_ifrn.ifrn_name, p->name, sizeof iwreq.ifr_ifrn.ifrn_name-1); if ( ioctl(sockfd, SIOCGIWRATE, &iwreq) == 0) { - ifprops[i].type = 'w'; // type wireless - ifprops[i].fullduplex = 0; - - ifprops[i].speed = - (iwreq.u.bitrate.value + 500000) / 1000000; - - if (++i >= MAXINTF-1) - break; - else - continue; + p->type = 'w'; // type wireless + p->fullduplex = 0; + p->speed = (iwreq.u.bitrate.value + 500000) / 1000000; + } + else + { + p->type = '?'; // type unknown + p->fullduplex = 0; + p->speed = 0; } - - ifprops[i].type = '?'; // type unknown - ifprops[i].speed = 0; - ifprops[i].fullduplex = 0; - - if (++i >= MAXINTF-1) - break; } close(sockfd); - fclose(fp); + + return 1; } diff -Nru atop-2.6.0/ifprop.h atop-2.7.1/ifprop.h --- atop-2.6.0/ifprop.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/ifprop.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,9 +1,40 @@ +/* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ + struct ifprop { - char type; /* type: 'e' (ethernet) */ - /* 'w' (wireless) */ + char type; /* type: 'e' - ethernet */ + /* 'w' - wireless */ + /* 'v' - virtual */ char name[31]; /* name of interface */ long int speed; /* in megabits per second */ char fullduplex; /* boolean */ + + struct ifprop *next; /* next in hash list */ }; int getifprop(struct ifprop *); diff -Nru atop-2.6.0/Makefile atop-2.7.1/Makefile --- atop-2.6.0/Makefile 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/Makefile 2022-01-08 11:49:00.000000000 +0000 @@ -48,17 +48,15 @@ $(CC) atopcat.o -o atopcat $(LDFLAGS) clean: - rm -f *.o atop atopacctd atopconvert atopcat + rm -f *.o atop atopsar atopacctd atopconvert atopcat distr: rm -f *.o atop tar czvf /tmp/atop.tar.gz * - -install: - @echo Choose either \'make systemdinstall\' or \'make sysvinstall\' - -systemdinstall: genericinstall +# default install is based on systemd +# +install: genericinstall if [ ! -d $(DESTDIR)$(SYSDPATH) ]; \ then mkdir -p $(DESTDIR)$(SYSDPATH); fi if [ ! -d $(DESTDIR)$(PMPATHD) ]; \ @@ -88,6 +86,9 @@ /bin/systemctl enable --now atop-rotate.timer; \ fi + +# explicitly use sysvinstall for System V init based systems +# sysvinstall: genericinstall if [ ! -d $(DESTDIR)$(INIPATH) ]; \ then mkdir -p $(DESTDIR)$(INIPATH); fi @@ -103,8 +104,6 @@ cp atop.cronsysv $(DESTDIR)$(CRNPATH)/atop cp atop.daily $(DESTDIR)$(SCRPATH) chmod 0711 $(DESTDIR)$(SCRPATH)/atop.daily - cp psaccs_atop $(DESTDIR)$(ROTPATH)/psaccs_atop - cp psaccu_atop $(DESTDIR)$(ROTPATH)/psaccu_atop touch $(DESTDIR)$(LOGPATH)/dummy_before touch $(DESTDIR)$(LOGPATH)/dummy_after # @@ -136,6 +135,7 @@ /sbin/service atop start; \ fi + genericinstall: atop atopacctd atopconvert atopcat if [ ! -d $(DESTDIR)$(LOGPATH) ]; \ then mkdir -p $(DESTDIR)$(LOGPATH); fi @@ -156,22 +156,17 @@ chmod 644 $(DESTDIR)$(DEFPATH)/atop # cp atop $(DESTDIR)$(BINPATH)/atop - chown root $(DESTDIR)$(BINPATH)/atop - chmod 04711 $(DESTDIR)$(BINPATH)/atop + chmod 0711 $(DESTDIR)$(BINPATH)/atop ln -sf atop $(DESTDIR)$(BINPATH)/atopsar cp atopacctd $(DESTDIR)$(SBINPATH)/atopacctd - chown root $(DESTDIR)$(SBINPATH)/atopacctd chmod 0700 $(DESTDIR)$(SBINPATH)/atopacctd cp atopgpud $(DESTDIR)$(SBINPATH)/atopgpud - chown root $(DESTDIR)$(SBINPATH)/atopgpud chmod 0700 $(DESTDIR)$(SBINPATH)/atopgpud cp atop $(DESTDIR)$(BINPATH)/atop-$(VERS) ln -sf atop-$(VERS) $(DESTDIR)$(BINPATH)/atopsar-$(VERS) cp atopconvert $(DESTDIR)$(BINPATH)/atopconvert - chown root $(DESTDIR)$(BINPATH)/atopconvert chmod 0711 $(DESTDIR)$(BINPATH)/atopconvert cp atopcat $(DESTDIR)$(BINPATH)/atopcat - chown root $(DESTDIR)$(BINPATH)/atopcat chmod 0711 $(DESTDIR)$(BINPATH)/atopcat cp man/atop.1 $(DESTDIR)$(MAN1PATH) cp man/atopsar.1 $(DESTDIR)$(MAN1PATH) diff -Nru atop-2.6.0/man/atop.1 atop-2.7.1/man/atop.1 --- atop-2.6.0/man/atop.1 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/man/atop.1 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ATOP 1 "December 2020" "Linux" +.TH ATOP 1 "December 2021" "Linux" .SH NAME .B atop - Advanced System & Process Monitor @@ -6,7 +6,7 @@ Interactive Usage: .P .B atop -[\-g|\-m|\-d|\-n|\-u|\-p|\-s|\-c|\-v|\-o|\-y|\-Y] [\-C|\-M|\-D|\-N|\-A] [\-afFG1xR] [\-L linelen] [\-Plabel[,label]...] +[\-g|\-m|\-d|\-n|\-u|\-p|\-s|\-c|\-v|\-o|\-y|\-Y] [\-C|\-M|\-D|\-N|\-A] [\-afFG1xR] [\-L linelen] [\-Plabel[,label]... [-Z]] [ .I interval [ @@ -32,7 +32,7 @@ .I [YYYYMMDD]hhmm ] [\-e .I [YYYYMMDD]hhmm -] [\-g|\-m|\-d|\-n|\-u|\-p|\-s|\-c|\-v|\-o|\-y|\-Y] [\-C|\-M|\-D|\-N|\-A] [\-fFG1xR] [\-L linelen] [\-Plabel[,label]...] +] [\-g|\-m|\-d|\-n|\-u|\-p|\-s|\-c|\-v|\-o|\-y|\-Y] [\-C|\-M|\-D|\-N|\-A] [\-fFG1xR] [\-L linelen] [\-Plabel[,label]... [-Z]] .SH DESCRIPTION The program .I atop @@ -47,6 +47,14 @@ Network load is shown per process if the kernel module `netatop' has been installed. .PP +The initial screen shows if +.I atop +runs with restricted view (unprivileged) or unrestricted view (privileged). +In case of restricted view +.I atop +does not have the privileges (root identity or necessary capabilities) to +retrieve all counter values on system level and on process level. +.PP Every .I interval (default: 10 seconds) information is shown about the resource occupation @@ -146,10 +154,25 @@ .br This way is preferred, because the .I atopacctd -daemon maintains full control of the sizes of the original process -accounting file (written by the kernel) and the shadow files (read by the +daemon maintains full control of the size of the original process +accounting file written by the kernel and the shadow files read by the +.I atop +process(es). + +The +.I atopacct +service will be activated before the +.I atop +service to enable .I atop -processes). For further information, refer to the +to detect that process accounting is managed by the +.I atopacctd +daemon. As a forking service, +.I atopacctd +takes care that all directories and files are initialized before the +parent process dies. The child process continues as the daemon process. + +For further information, refer to the .B atopacctd man page. .PP @@ -162,8 +185,14 @@ verifies if the process accounting mechanism has been switched on via the separate .B psacct -package. In that case, the file +or +.B acct +package (the package name depends on the Linux distro). In that case, +one of the files +.B /var/log/pacct, .B /var/account/pacct +or +.B /var/log/account/pacct is in use as process accounting file and .I atop opens this file for reading. @@ -772,6 +801,19 @@ Whether this key is active or not can be seen in the header line. .PP .TP 5 +.B Q +Specify a comma-separated list of process/thread state characters. +From now on, only processes/threads will be shown that are in +those specific states. +Accepted states are: R (running), S (sleeping), D (disk sleep), I (idle), +T (stopped), t (tracing stop), X (dead), Z (zombie) and P (parked). +The system statistics are still system wide. +If the Enter-key is pressed without specifying a state, +all (active) processes/threads will be shown again. +.br +Whether this key is active or not can be seen in the header line. +.PP +.TP 5 .B S Specify search strings for specific logical volume names, specific disk names and specific network interface names. All @@ -1192,7 +1234,8 @@ the amount of memory that is currently claimed by the ARC (cache) of ZFSonlinux (`zfarc`), the amount of memory that is claimed for huge pages (`hptot`), -and the amount of huge page memory that is really in use (`hpuse`). +the amount of huge page memory that is really in use (`hpuse`), +and the number of NUMA nodes in this system (`numnode'). If the screen-width does not allow all of these counters, only a relevant subset is shown. @@ -1202,8 +1245,12 @@ Swap occupation and overcommit info. .br This line contains the total amount of swap space on disk (`tot'), -the amount of free swap space (`free') and the size of the swap cache -(`swcac'). +the amount of free swap space (`free'), +the size of the swap cache (`swcac'), +the total size of compressed storage in zswap (`zpool`), +the total size of the compressed pages stored in zswap (`zstor'), +the total size of the memory used for KSM (`ksuse`, i.e. shared), and +the total size of the memory saved (deduped) by KSM (`kssav`, i.e. sharing). .br Furthermore the committed virtual memory space (`vmcom') and the maximum limit of the committed space (`vmlim', which is by default swap size @@ -1214,16 +1261,43 @@ configured (vm.overcommit_memory is 2). .PP .TP 5 +.B NUM +Memory utilization per NUMA node. +.br +This line shows the total amount of physical memory of this node (`tot'), +the amount of free memory (`free'), the amount of memory for cached file data +(`file'), modified cached file data (`dirty'), recently used memory (`activ'), +less recently used memory (`inact'), memory being used for kernel mallocs +(`slab'), the amount of slab memory that is reclaimable (`slrec'), +shared memory including tmpfs (`shmem'), total huge pages (`hptot') and +the fragmentation percentage (`frag'). +.PP +.TP 5 +.B NUC +CPU utilization per NUMA node (not shown in case of a single NUMA node). +.br +This line shows the utilization percentages of all CPUs related to this +NUMA node, categorized for system mode (`sys'), user mode (`user'), +user mode for niced processes (`niced'), idle mode (`idle'), +wait mode (`w' preceded by the node number), irq mode (`irq'), +softirq mode (`sirq'), steal mode (`steal'), and guest mode (`guest') +overlapping user mode. +.PP +.TP 5 .B PAG Paging frequency. .br This line contains the number of scanned pages (`scan') due to the fact -that free memory drops below a particular threshold and the number -times that the kernel tries to reclaim pages due to an urgent need (`stall'). -.br -Also the number of memory pages the system read from swap space (`swin') -and the number of memory pages the system wrote to swap space (`swout') -are shown. +that free memory drops below a particular threshold, the number +times that the kernel tries to reclaim pages due to an urgent need (`stall'), +the number of process stalls to run memory compaction to allocate +huge pages (`compact'), the number of NUMA pages migrated (`numamig'), and +the total number of memory pages migrated succesfully e.g. between +NUMA nodes or for compaction (`migrate') are shown. +.br +Also the number of memory pages the system read from swap space (`swin'), +the number of memory pages the system wrote to swap space (`swout'), and +the number of out-of-memory kills (`oomkill'). .PP .TP 5 .B PSI @@ -1252,8 +1326,10 @@ sda for a hard disk), the busy percentage i.e. the portion of time that the unit was busy handling requests (`busy'), the number of read requests issued (`read'), the number of write requests issued (`write'), +the number of discard requests issued (`discrd') if supported by kernel version, the number of KiBytes per read (`KiB/r'), the number of KiBytes per write (`KiB/w'), +the number of KiBytes per discard (`KiB/d') if supported by kernel version, the number of MiBytes per second throughput for reads (`MBr/s'), the number of MiBytes per second throughput for writes (`MBw/s'), the average queue depth (`avq') @@ -1980,15 +2056,23 @@ correspond to the labels (first verb of each line) that can be found in the interactive output: "CPU", "cpu", "CPL", "GPU", "MEM", "SWP", "PAG", "PSI", "LVM", "MDD", -"DSK", "NFM", "NFC", "NFS", "NET" and "IFB". +"DSK", "NFM", "NFC", "NFS", "NET", "IFB", "NUM" and "NUC". .br -For process-level statistics special labels are introduced: +For process-level statistics special labels are available: "PRG" (general), "PRC" (cpu), "PRE" (GPU), "PRM" (memory), "PRD" (disk, only if "storage accounting" is active) and "PRN" (network, only if the kernel module 'netatop' has been installed). .br With the label "ALL", all system and process level statistics are shown. .PP +The command and command line in the parseable output might contain spaces +and are therefore by default surrounded by parenthesis. However, since +a space is often used as separator between the fields by parsing tools, +with the additional flag +.B -Z +it is possible to exchange the spaces in the command (line) by +underscores and omit the parenthesis. +.PP For every interval all requested lines are shown whereafter .B atop shows a line just containing the label "SEP" as a separator before the @@ -2089,8 +2173,10 @@ size of swapped shared memory (pages), huge page size (in bytes), total size of huge pages (huge pages), -size of free huge pages (huge pages), and -size of ARC (cache) of ZFSonlinux (pages). +size of free huge pages (huge pages), +size of ARC (cache) of ZFSonlinux (pages), +size of sharing pages for KSM (pages), and +size of shared pages for KSM (pages). .TP 9 .B SWP Subsequent fields: @@ -2098,8 +2184,11 @@ size of swap (pages), size of free swap (pages), size of swap cache (pages), -size of committed space (pages), and -limit for committed space (pages). +size of committed space (pages), +limit for committed space (pages), +size of the swap cache (pages), +size of compressed pages stored in zswap (pages), and +total size of compressed pool in zswap (pages). .TP 9 .B PAG Subsequent fields: @@ -2107,8 +2196,12 @@ number of page scans, number of allocstalls, 0 (future use), -number of swapins, and -number of swapouts. +number of swapins, +number of swapouts, +number of oomkills (-1 when counter not present), +number of process stalls to run memory compaction, +number of pages successfully migrated in total, and +number of NUMA pages migrated. .TP 9 .B PSI Subsequent fields: @@ -2133,7 +2226,9 @@ number of reads issued, number of sectors transferred for reads, number of writes issued, -and number of sectors transferred for write. +number of sectors transferred for write, +number of discards issued (-1 if not supported), +and number of sectors transferred for discards. .TP 9 .B NFM Subsequent fields: @@ -2216,15 +2311,44 @@ number of packets received, and number of packets transmitted. .TP 9 +.B NUM +Subsequent fields: +NUMA node number, +page size for this machine (in bytes), +the fragmentation percentage of this node, +size of physical memory (pages), +size of free memory (pages), +recently (active) used memory (pages), +less recently (inactive) used memory (pages), +size of cached file data (pages), +dirty pages in cache (pages), +slab memory being used for kernel mallocs (pages), +slab memory that is reclaimable (pages), +shared memory including tmpfs (pages), and +total huge pages (pages). +.TP 9 +.B NUC +Subsequent fields: +NUMA node number, number of processors for this node, +consumption for node CPUs in system mode (clock-ticks), +consumption for node CPUs in user mode (clock-ticks), +consumption for node CPUs in user mode for niced processes (clock-ticks), +consumption for node CPUs in idle mode (clock-ticks), +consumption for node CPUs in wait mode (clock-ticks), +consumption for node CPUs in irq mode (clock-ticks), +consumption for node CPUs in softirq mode (clock-ticks), +consumption for node CPUs in steal mode (clock-ticks), and +consumption for node CPUs in guest mode (clock-ticks) overlapping user mode. +.TP 9 .B PRG For every process one line is shown. .br Subsequent fields: -PID (unique ID of task), name (between brackets), state, -real uid, real gid, TGID (group number of related tasks/threads), +PID (unique ID of task), name (between parenthesis or underscores for spaces), +state, real uid, real gid, TGID (group number of related tasks/threads), total number of threads, exit code (in case of fatal signal: signal number + 256), start time (epoch), -full command line (between brackets), PPID, +full command line (between parenthesis or underscores for spaces), PPID, number of threads in state 'running' (R), number of threads in state 'interruptible sleeping' (S), number of threads in state 'uninterruptible sleeping' (D), @@ -2239,7 +2363,7 @@ For every process one line is shown. .br Subsequent fields: -PID, name (between brackets), state, +PID, name (between parenthesis or underscores for spaces), state, total number of clock-ticks per second for this machine, CPU-consumption in user mode (clockticks), CPU-consumption in system mode (clockticks), @@ -2247,13 +2371,13 @@ scheduling policy, current CPU, sleep average, TGID (group number of related tasks/threads), is_process (y/n), runqueue delay in nanoseconds for this thread or for all threads (in case of -process), and wait channel of this thread (between brackets). +process), and wait channel of this thread (between parenthesis or underscores for spaces). .TP 9 .B PRE For every process one line is shown. .br Subsequent fields: -PID, name (between brackets), process state, +PID, name (between parenthesis or underscores for spaces), process state, GPU state (A for active, E for exited, N for no GPU user), number of GPUs used by this process, bitlist reflecting used GPUs, @@ -2267,7 +2391,7 @@ For every process one line is shown. .br Subsequent fields: -PID, name (between brackets), state, +PID, name (between parenthesis or underscores for spaces), state, page size for this machine (in bytes), virtual memory size (Kbytes), resident memory size (Kbytes), @@ -2288,7 +2412,7 @@ For every process one line is shown. .br Subsequent fields: -PID, name (between brackets), state, +PID, name (between parenthesis or underscores for spaces), state, obsoleted kernel patch installed ('n'), standard io statistics used ('y' or 'n'), number of reads on disk, @@ -2308,7 +2432,7 @@ For every process one line is shown. .br Subsequent fields: -PID, name (between brackets), state, +PID, name (between parenthesis or underscores for spaces), state, kernel module 'netatop' loaded ('y' or 'n'), number of TCP-packets transmitted, cumulative size of TCP-packets transmitted, diff -Nru atop-2.6.0/man/atopacctd.8 atop-2.7.1/man/atopacctd.8 --- atop-2.6.0/man/atopacctd.8 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/man/atopacctd.8 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ATOPACCTD 8 "December 2020" "Linux" +.TH ATOPACCTD 8 "December 2021" "Linux" .SH NAME .B atopacctd - process accounting daemon diff -Nru atop-2.6.0/man/atopcat.1 atop-2.7.1/man/atopcat.1 --- atop-2.6.0/man/atopcat.1 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/man/atopcat.1 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ATOPCAT 1 "December 2020" "Linux" +.TH ATOPCAT 1 "December 2021" "Linux" .SH NAME .B atopcat - concatenate raw log files to stdout diff -Nru atop-2.6.0/man/atopconvert.1 atop-2.7.1/man/atopconvert.1 --- atop-2.6.0/man/atopconvert.1 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/man/atopconvert.1 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ATOPCONVERT 1 "December 2020" "Linux" +.TH ATOPCONVERT 1 "December 2021" "Linux" .SH NAME .B atopconvert - convert raw log file to newer version diff -Nru atop-2.6.0/man/atopgpud.8 atop-2.7.1/man/atopgpud.8 --- atop-2.6.0/man/atopgpud.8 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/man/atopgpud.8 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ATOPGPUD 8 "December 2020" "Linux" +.TH ATOPGPUD 8 "December 2021" "Linux" .SH NAME .B atopgpud - GPU statistics daemon diff -Nru atop-2.6.0/man/atoprc.5 atop-2.7.1/man/atoprc.5 --- atop-2.6.0/man/atoprc.5 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/man/atoprc.5 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ATOPRC 5 "December 2020" "Linux" +.TH ATOPRC 5 "December 2021" "Linux" .SH NAME .B atoprc - atop/atopsar related rcfile diff -Nru atop-2.6.0/man/atopsar.1 atop-2.7.1/man/atopsar.1 --- atop-2.6.0/man/atopsar.1 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/man/atopsar.1 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,4 @@ -.TH ATOPSAR 1 "December 2020" "Linux" +.TH ATOPSAR 1 "December 2021" "Linux" .SH NAME .B atopsar - Advanced System Activity Report (atop related) @@ -475,6 +475,11 @@ .B swapout/s The number of memory-pages the system wrote to the swap-device per second. .TP 12 +.B oomkill +The number of processes being killed during the last interval due to lack +of memory/swap. The value -1 means that this counter is not supported by +the current kernel version. +.TP 12 .B commitspc The committed virtual memory space i.e. the reserved virtual space for all allocations of @@ -532,7 +537,7 @@ Average number of Kbytes transferred per read-request for this unit. .TP 12 .B writ/s -Number of write-requests issued per second on this unit. +Number of write-requests (including discard requests) issued per second on this unit. .TP 12 .B KB/writ Average number of Kbytes transferred per write-request for this unit. diff -Nru atop-2.6.0/netatopd.h atop-2.7.1/netatopd.h --- atop-2.6.0/netatopd.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/netatopd.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,3 +1,31 @@ +/* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ + #define SEMAKEY 1541961 #define NETEXITFILE "/var/run/netatop.log" diff -Nru atop-2.6.0/netatop.h atop-2.7.1/netatop.h --- atop-2.6.0/netatop.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/netatop.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,3 +1,31 @@ +/* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ + #define COMLEN 16 struct taskcount { diff -Nru atop-2.6.0/netlink.c atop-2.7.1/netlink.c --- atop-2.6.0/netlink.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/netlink.c 2022-01-08 11:49:00.000000000 +0000 @@ -1,3 +1,21 @@ +/* +** Copyright (C) 2014 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ #include #include #include diff -Nru atop-2.6.0/netstats.h atop-2.7.1/netstats.h --- atop-2.6.0/netstats.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/netstats.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,32 @@ /* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ + +/* ** structures defined from the output of /proc/net/snmp and /proc/net/snmp6 */ struct ipv4_stats { diff -Nru atop-2.6.0/parseable.c atop-2.7.1/parseable.c --- atop-2.6.0/parseable.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/parseable.c 2022-01-08 11:49:00.000000000 +0000 @@ -9,7 +9,7 @@ ** E-mail: gerlof.langeveld@atoptool.nl ** Date: February 2007 ** -------------------------------------------------------------------------- -** Copyright (C) 2007-2010 Gerlof Langeveld +** Copyright (C) 2007-2021 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 @@ -25,50 +25,6 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** -------------------------------------------------------------------------- -** -** $Id: parseable.c,v 1.13 2010/10/23 14:02:19 gerlof Exp $ -** $Log: parseable.c,v $ -** Revision 1.13 2010/10/23 14:02:19 gerlof -** Show counters for total number of running and sleep (S and D) threads. -** -** Revision 1.12 2010/05/18 19:20:55 gerlof -** Introduce CPU frequency and scaling (JC van Winkel). -** -** Revision 1.11 2010/04/23 12:19:35 gerlof -** Modified mail-address in header. -** -** Revision 1.10 2010/03/04 10:52:21 gerlof -** Support I/O-statistics on logical volumes and MD devices. -** -** Revision 1.9 2010/01/08 14:46:42 gerlof -** Added label RESET in case of a sample with values since boot. -** -** Revision 1.8 2009/12/19 22:32:14 gerlof -** Add new counters to parseable output. -** -** Revision 1.7 2008/03/06 09:08:29 gerlof -** Bug-solution regarding parseable output of PPID. -** -** Revision 1.6 2008/03/06 08:38:03 gerlof -** Register/show ppid of a process. -** -** Revision 1.5 2008/01/18 08:03:40 gerlof -** Show information about the number of threads in state 'running', -** 'interruptible sleeping' and 'non-interruptible sleeping'. -** -** Revision 1.4 2007/12/11 13:33:12 gerlof -** Cosmetic change. -** -** Revision 1.3 2007/08/16 12:00:11 gerlof -** Add support for atopsar reporting. -** Concerns networking-counters that have been changed. -** -** Revision 1.2 2007/03/20 13:01:12 gerlof -** Introduction of variable supportflags. -** -** Revision 1.1 2007/02/19 11:55:43 gerlof -** Initial revision -** */ #include #include @@ -99,6 +55,8 @@ void print_NFS(); void print_NET(); void print_IFB(); +void print_NUM(); +void print_NUC(); void print_PRG(); void print_PRC(); @@ -107,6 +65,8 @@ void print_PRN(); void print_PRE(); +static char *spaceformat(char *, char *); + /* ** table with possible labels and the corresponding ** print-function for parseable output @@ -134,6 +94,8 @@ { "NFS", 0, print_NFS }, { "NET", 0, print_NET }, { "IFB", 0, print_IFB }, + { "NUM", 0, print_NUM }, + { "NUC", 0, print_NUC }, { "PRG", 0, print_PRG }, { "PRC", 0, print_PRC }, @@ -422,7 +384,7 @@ void print_MEM(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - printf( "%s %u %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n", + printf( "%s %u %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n", hp, pagesize, ss->mem.physmem, @@ -432,40 +394,49 @@ ss->mem.slabmem, ss->mem.cachedrt, ss->mem.slabreclaim, - ss->mem.vmwballoon, + ss->mem.vmwballoon != -1 ? ss->mem.vmwballoon : 0, ss->mem.shmem, ss->mem.shmrss, ss->mem.shmswp, ss->mem.hugepagesz, ss->mem.tothugepage, ss->mem.freehugepage, - ss->mem.zfsarcsize); + ss->mem.zfsarcsize != -1 ? ss->mem.zfsarcsize : 0, + ss->mem.ksmsharing != -1 ? ss->mem.ksmsharing : 0, + ss->mem.ksmshared != -1 ? ss->mem.ksmshared : 0); } void print_SWP(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - printf( "%s %u %lld %lld %lld %lld %lld\n", + printf( "%s %u %lld %lld %lld %lld %lld %lld %lld %lld\n", hp, pagesize, ss->mem.totswap, ss->mem.freeswap, ss->mem.swapcached, ss->mem.committed, - ss->mem.commitlim); + ss->mem.commitlim, + ss->mem.swapcached, + ss->mem.zswstored != -1 ? ss->mem.zswstored : 0, + ss->mem.zswtotpool != -1 ? ss->mem.zswtotpool : 0); } void print_PAG(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - printf("%s %u %lld %lld %lld %lld %lld\n", + printf("%s %u %lld %lld %lld %lld %lld %lld %lld %lld %lld\n", hp, pagesize, ss->mem.pgscans, ss->mem.allocstall, (long long)0, ss->mem.swins, - ss->mem.swouts); + ss->mem.swouts, + ss->mem.oomkills, + ss->mem.compactstall, + ss->mem.pgmigrate, + ss->mem.numamigrate); } void @@ -493,14 +464,16 @@ for (i=0; ss->dsk.lvm[i].name[0]; i++) { - printf( "%s %s %lld %lld %lld %lld %lld\n", + printf( "%s %s %lld %lld %lld %lld %lld %lld %lld\n", hp, ss->dsk.lvm[i].name, ss->dsk.lvm[i].io_ms, ss->dsk.lvm[i].nread, ss->dsk.lvm[i].nrsect, ss->dsk.lvm[i].nwrite, - ss->dsk.lvm[i].nwsect); + ss->dsk.lvm[i].nwsect, + ss->dsk.lvm[i].ndisc, + ss->dsk.lvm[i].ndsect); } } @@ -511,14 +484,16 @@ for (i=0; ss->dsk.mdd[i].name[0]; i++) { - printf( "%s %s %lld %lld %lld %lld %lld\n", + printf( "%s %s %lld %lld %lld %lld %lld %lld %lld\n", hp, ss->dsk.mdd[i].name, ss->dsk.mdd[i].io_ms, ss->dsk.mdd[i].nread, ss->dsk.mdd[i].nrsect, ss->dsk.mdd[i].nwrite, - ss->dsk.mdd[i].nwsect); + ss->dsk.mdd[i].nwsect, + ss->dsk.mdd[i].ndisc, + ss->dsk.mdd[i].ndsect); } } @@ -529,14 +504,16 @@ for (i=0; ss->dsk.dsk[i].name[0]; i++) { - printf( "%s %s %lld %lld %lld %lld %lld\n", + printf( "%s %s %lld %lld %lld %lld %lld %lld %lld\n", hp, ss->dsk.dsk[i].name, ss->dsk.dsk[i].io_ms, ss->dsk.dsk[i].nread, ss->dsk.dsk[i].nrsect, ss->dsk.dsk[i].nwrite, - ss->dsk.dsk[i].nwsect); + ss->dsk.dsk[i].nwsect, + ss->dsk.dsk[i].ndisc, + ss->dsk.dsk[i].ndsect); } } @@ -663,6 +640,52 @@ } } +void +print_NUM(char *hp, struct sstat *ss, struct tstat *ps, int nact) +{ + register int i; + + for (i=0; i < ss->memnuma.nrnuma; i++) + { + printf( "%s %d %u %.0f %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n", + hp, i, + pagesize, + ss->memnuma.numa[i].frag * 100.0, + ss->memnuma.numa[i].totmem, + ss->memnuma.numa[i].freemem, + ss->memnuma.numa[i].active, + ss->memnuma.numa[i].inactive, + ss->memnuma.numa[i].filepage, + ss->memnuma.numa[i].dirtymem, + ss->memnuma.numa[i].slabmem, + ss->memnuma.numa[i].slabreclaim, + ss->memnuma.numa[i].shmem, + ss->memnuma.numa[i].tothp); + } +} + +void +print_NUC(char *hp, struct sstat *ss, struct tstat *ps, int nact) +{ + register int i; + + for (i=0; i < ss->cpunuma.nrnuma; i++) + { + printf( "%s %d %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n", + hp, i, + ss->cpunuma.numa[i].nrcpu, + ss->cpunuma.numa[i].stime, + ss->cpunuma.numa[i].utime, + ss->cpunuma.numa[i].ntime, + ss->cpunuma.numa[i].itime, + ss->cpunuma.numa[i].wtime, + ss->cpunuma.numa[i].Itime, + ss->cpunuma.numa[i].Stime, + ss->cpunuma.numa[i].steal, + ss->cpunuma.numa[i].guest); + } +} + /* ** print functions for process-level statistics @@ -670,7 +693,8 @@ void print_PRG(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - register int i, exitcode; + register int i, exitcode; + char namout[PNAMLEN+1+2], cmdout[CMDLEN+1+2]; for (i=0; i < nact; i++, ps++) { @@ -679,11 +703,11 @@ else exitcode = (ps->gen.excode >> 8) & 0xff; - printf("%s %d (%s) %c %d %d %d %d %d %ld (%s) %d %d %d %d " + printf("%s %d %s %c %d %d %d %d %d %ld %s %d %d %d %d " "%d %d %d %d %d %d %ld %c %d %d %s %c\n", hp, ps->gen.pid, - ps->gen.name, + spaceformat(ps->gen.name, namout), ps->gen.state, ps->gen.ruid, ps->gen.rgid, @@ -691,7 +715,7 @@ ps->gen.nthr, exitcode, ps->gen.btime, - ps->gen.cmdline, + spaceformat(ps->gen.cmdline, cmdout), ps->gen.ppid, ps->gen.nthrrun, ps->gen.nthrslpi, @@ -714,128 +738,185 @@ void print_PRC(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - register int i; + register int i; + char namout[PNAMLEN+1+2], wchanout[20]; for (i=0; i < nact; i++, ps++) { - printf("%s %d (%s) %c %u %lld %lld %d %d %d %d %d %d %d %c " - "%llu (%s)\n", - hp, - ps->gen.pid, - ps->gen.name, - ps->gen.state, - hertz, - ps->cpu.utime, - ps->cpu.stime, - ps->cpu.nice, - ps->cpu.prio, - ps->cpu.rtprio, - ps->cpu.policy, - ps->cpu.curcpu, - ps->cpu.sleepavg, - ps->gen.tgid, - ps->gen.isproc ? 'y':'n', - ps->cpu.rundelay, - ps->cpu.wchan); + printf("%s %d %s %c %u %lld %lld %d %d %d %d %d %d %d %c " + "%llu %s\n", + hp, + ps->gen.pid, + spaceformat(ps->gen.name, namout), + ps->gen.state, + hertz, + ps->cpu.utime, + ps->cpu.stime, + ps->cpu.nice, + ps->cpu.prio, + ps->cpu.rtprio, + ps->cpu.policy, + ps->cpu.curcpu, + ps->cpu.sleepavg, + ps->gen.tgid, + ps->gen.isproc ? 'y':'n', + ps->cpu.rundelay, + spaceformat(ps->cpu.wchan, wchanout)); } } void print_PRM(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - register int i; + register int i; + char namout[PNAMLEN+1+2]; for (i=0; i < nact; i++, ps++) { - printf("%s %d (%s) %c %u %lld %lld %lld %lld %lld %lld " + printf("%s %d %s %c %u %lld %lld %lld %lld %lld %lld " "%lld %lld %lld %lld %lld %d %c %lld %lld\n", - hp, - ps->gen.pid, - ps->gen.name, - ps->gen.state, - pagesize, - ps->mem.vmem, - ps->mem.rmem, - ps->mem.vexec, - ps->mem.vgrow, - ps->mem.rgrow, - ps->mem.minflt, - ps->mem.majflt, - ps->mem.vlibs, - ps->mem.vdata, - ps->mem.vstack, - ps->mem.vswap, - ps->gen.tgid, - ps->gen.isproc ? 'y':'n', - ps->mem.pmem == (unsigned long long)-1LL ? - 0:ps->mem.pmem, - ps->mem.vlock); + hp, + ps->gen.pid, + spaceformat(ps->gen.name, namout), + ps->gen.state, + pagesize, + ps->mem.vmem, + ps->mem.rmem, + ps->mem.vexec, + ps->mem.vgrow, + ps->mem.rgrow, + ps->mem.minflt, + ps->mem.majflt, + ps->mem.vlibs, + ps->mem.vdata, + ps->mem.vstack, + ps->mem.vswap, + ps->gen.tgid, + ps->gen.isproc ? 'y':'n', + ps->mem.pmem == (unsigned long long)-1LL ? + 0:ps->mem.pmem, + ps->mem.vlock); } } void print_PRD(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - register int i; + register int i; + char namout[PNAMLEN+1+2]; for (i=0; i < nact; i++, ps++) { - printf("%s %d (%s) %c %c %c %lld %lld %lld %lld %lld %d n %c\n", - hp, - ps->gen.pid, - ps->gen.name, - ps->gen.state, - 'n', - supportflags & IOSTAT ? 'y' : 'n', - ps->dsk.rio, ps->dsk.rsz, - ps->dsk.wio, ps->dsk.wsz, ps->dsk.cwsz, - ps->gen.tgid, - ps->gen.isproc ? 'y':'n'); + printf("%s %d %s %c %c %c %lld %lld %lld %lld %lld %d n %c\n", + hp, + ps->gen.pid, + spaceformat(ps->gen.name, namout), + ps->gen.state, + 'n', + supportflags & IOSTAT ? 'y' : 'n', + ps->dsk.rio, ps->dsk.rsz, + ps->dsk.wio, ps->dsk.wsz, ps->dsk.cwsz, + ps->gen.tgid, + ps->gen.isproc ? 'y':'n'); } } void print_PRN(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - register int i; + register int i; + char namout[PNAMLEN+1+2]; for (i=0; i < nact; i++, ps++) { - printf("%s %d (%s) %c %c %lld %lld %lld %lld %lld %lld " + printf("%s %d %s %c %c %lld %lld %lld %lld %lld %lld " "%lld %lld %d %d %d %c\n", - hp, - ps->gen.pid, - ps->gen.name, - ps->gen.state, - supportflags & NETATOP ? 'y' : 'n', - ps->net.tcpsnd, ps->net.tcpssz, - ps->net.tcprcv, ps->net.tcprsz, - ps->net.udpsnd, ps->net.udpssz, - ps->net.udprcv, ps->net.udprsz, - 0, 0, - ps->gen.tgid, ps->gen.isproc ? 'y':'n'); + hp, + ps->gen.pid, + spaceformat(ps->gen.name, namout), + ps->gen.state, + supportflags & NETATOP ? 'y' : 'n', + ps->net.tcpsnd, ps->net.tcpssz, + ps->net.tcprcv, ps->net.tcprsz, + ps->net.udpsnd, ps->net.udpssz, + ps->net.udprcv, ps->net.udprsz, + 0, 0, + ps->gen.tgid, ps->gen.isproc ? 'y':'n'); } } void print_PRE(char *hp, struct sstat *ss, struct tstat *ps, int nact) { - register int i; + register int i; + char namout[PNAMLEN+1+2]; for (i=0; i < nact; i++, ps++) { - printf("%s %d (%s) %c %c %d %x %d %d %lld %lld %lld\n", - hp, - ps->gen.pid, - ps->gen.name, - ps->gen.state, - ps->gpu.state == '\0' ? 'N':ps->gpu.state, - ps->gpu.nrgpus, - ps->gpu.gpulist, - ps->gpu.gpubusy, - ps->gpu.membusy, - ps->gpu.memnow, - ps->gpu.memcum, - ps->gpu.sample); + printf("%s %d %s %c %c %d %x %d %d %lld %lld %lld\n", + hp, + ps->gen.pid, + spaceformat(ps->gen.name, namout), + ps->gen.state, + ps->gpu.state == '\0' ? 'N':ps->gpu.state, + ps->gpu.nrgpus, + ps->gpu.gpulist, + ps->gpu.gpubusy, + ps->gpu.membusy, + ps->gpu.memnow, + ps->gpu.memcum, + ps->gpu.sample); } } + + +/* +** Strings, like command name, might contain spaces +** and will be represented for that reason surrounded +** by parenthesis. However, this is difficult to parse +** by other tools, so the option -Z might have been +** specified to exchange all spaces by underscores while +** omitting the parenthesis in that case. +** +** This function formats the input string (istr) in the +** required format to the output string (ostr). +** Take care that the buffer pointed to by ostr is at least +** two bytes larger than the input string (for the parenthesis). +** The pointer ostr is also returned. +*/ +static char * +spaceformat(char *istr, char *ostr) +{ + // formatting with spaces and parenthesis required? + if (!rmspaces) + { + *ostr = '('; + strcpy(ostr+1, istr); + strcat(ostr, ")"); + } + // formatting with underscores without parenthesis required + else + { + register char *pi = istr, *po = ostr; + + while (*pi) + { + if (*pi == ' ') + { + *po++ = '_'; + pi++; + } + else + { + *po++ = *pi++; + } + } + + if (po == ostr) // empty string: still return underscore + *po++ = '_'; + + *po = '\0'; // terminate output string + } + + return ostr; +} diff -Nru atop-2.6.0/parseable.h atop-2.7.1/parseable.h --- atop-2.6.0/parseable.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/parseable.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,3 +1,30 @@ +/* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ int parsedef(char *); char parseout(time_t, int, struct devtstat *, struct sstat *, diff -Nru atop-2.6.0/photoproc.c atop-2.7.1/photoproc.c --- atop-2.6.0/photoproc.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/photoproc.c 2022-01-08 11:49:00.000000000 +0000 @@ -383,6 +383,7 @@ case 'S': curtask->gen.nthrslpi += 1; break; + case 'I': case 'D': curtask->gen.nthrslpu += 1; break; @@ -572,6 +573,7 @@ case 'S': curtask->gen.nthrslpi = 1; break; + case 'I': case 'D': curtask->gen.nthrslpu = 1; break; @@ -823,17 +825,23 @@ /* -** store the Docker container ID, retrieved from the 'cpuset' +** store the container ID, retrieved from the 'cpuset' ** that might look like this: +** +** In case of Docker: ** /system.slice/docker-af78216c2a230f1aa5dce56cbf[SNAP].scope (e.g. CentOS) ** /docker/af78216c2a230f1aa5dce56cbf[SNAP] (e.g. openSUSE and Ubuntu)) ** -** docker created by k8s might look like this: +** In case of Docker created by K8s: ** /kubepods/burstable/pod07dbb922-[SNAP]/223dc5e15b[SNAP] ** +** In case of podman: +** /machine.slice/libpod-0b5836e9ea98aefd89481123bi[SNAP].scope +** ** In general: ** - search for last '/' (basename) ** - check if '/' followed by 'docker-': then skip 'docker-' +** - check if '/' followed by 'libpod-': then skip 'libpod-' ** - take 12 positions for the container ID ** ** Return value: @@ -843,6 +851,7 @@ #define CIDSIZE 12 #define SHA256SIZE 64 #define DOCKPREFIX "docker-" +#define PODMANPREFIX "libpod-" static int proccont(struct tstat *curtask) @@ -872,7 +881,17 @@ if (memcmp(p, DOCKPREFIX, sizeof(DOCKPREFIX)-1) == 0) + { p += sizeof(DOCKPREFIX)-1; + } + else + { + if (memcmp(p, PODMANPREFIX, + sizeof(PODMANPREFIX)-1) == 0) + { + p += sizeof(PODMANPREFIX)-1; + } + } memcpy(curtask->gen.container, p, CIDSIZE); return 1; diff -Nru atop-2.6.0/photosyst.c atop-2.7.1/photosyst.c --- atop-2.6.0/photosyst.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/photosyst.c 2022-01-08 11:49:00.000000000 +0000 @@ -28,127 +28,7 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** -------------------------------------------------------------------------- -** -** $Log: photosyst.c,v $ -** Revision 1.38 2010/11/19 07:40:40 gerlof -** Support of virtual disk vd... (kvm). -** -** Revision 1.37 2010/11/14 06:42:18 gerlof -** After opening /proc/cpuinfo, the file descriptor was not closed any more. -** -** Revision 1.36 2010/10/23 14:09:50 gerlof -** Add support for mmcblk disks (MMC/SD cardreaders) -** Credits: Anssi Hannula -** -** Revision 1.35 2010/05/18 19:20:30 gerlof -** Introduce CPU frequency and scaling (JC van Winkel). -** -** Revision 1.34 2010/04/23 12:19:35 gerlof -** Modified mail-address in header. -** -** Revision 1.33 2010/03/04 10:58:05 gerlof -** Added recognition of device-type /dev/fio... -** -** Revision 1.32 2010/03/04 10:52:47 gerlof -** Support I/O-statistics on logical volumes and MD devices. -** -** Revision 1.31 2009/12/17 11:59:16 gerlof -** Gather and display new counters: dirty cache and guest cpu usage. -** -** Revision 1.30 2008/02/25 13:47:00 gerlof -** Experimental code for HTTP statistics. -** -** Revision 1.29 2007/08/17 09:45:44 gerlof -** Experimental: gather info about HTTP statistics. -** -** Revision 1.28 2007/08/16 12:00:49 gerlof -** Add support for atopsar reporting. -** Gather more counters, mainly related to networking. -** -** Revision 1.27 2007/07/03 09:01:56 gerlof -** Support Apache-statistics. -** -** Revision 1.26 2007/02/13 10:32:28 gerlof -** Removal of external declarations. -** -** Revision 1.25 2007/02/13 09:29:57 gerlof -** Removal of external declarations. -** -** Revision 1.24 2007/01/22 14:57:12 gerlof -** Support of special disks used by virtual machines. -** -** Revision 1.23 2007/01/22 08:28:50 gerlof -** Support steal-time from /proc/stat. -** -** Revision 1.22 2006/11/13 13:48:20 gerlof -** Implement load-average counters, context-switches and interrupts. -** -** Revision 1.21 2006/01/30 09:14:16 gerlof -** Extend memory counters (a.o. page scans). -** -** Revision 1.20 2005/10/21 09:50:08 gerlof -** Per-user accumulation of resource consumption. -** -** Revision 1.19 2004/10/28 08:31:23 gerlof -** New counter: vm committed space -** -** Revision 1.18 2004/09/24 10:02:35 gerlof -** Wrong cpu-numbers for system level statistics. -** -** Revision 1.17 2004/05/07 05:27:37 gerlof -** Recognize new disk-names and support of diskname-modification. -** -** Revision 1.16 2004/05/06 09:53:31 gerlof -** Skip statistics of ram-disks. -** -** Revision 1.15 2004/05/06 09:46:14 gerlof -** Ported to kernel-version 2.6. -** -** Revision 1.14 2003/07/08 13:53:21 gerlof -** Cleanup code. -** -** Revision 1.13 2003/07/07 09:27:06 gerlof -** Cleanup code (-Wall proof). -** -** Revision 1.12 2003/06/30 11:30:37 gerlof -** Enlarge counters to 'long long'. -** -** Revision 1.11 2003/06/24 06:21:40 gerlof -** Limit number of system resource lines. -** -** Revision 1.10 2003/01/17 14:23:05 root -** Change-directory to /proc to optimize opening /proc-files -** via relative path-names i.s.o. absolute path-names. -** -** Revision 1.9 2003/01/14 07:50:26 gerlof -** Consider IPv6 counters on IP and UDP level (add them to the IPv4 counters). -** -** Revision 1.8 2002/07/24 11:13:38 gerlof -** Changed to ease porting to other UNIX-platforms. -** -** Revision 1.7 2002/07/11 09:12:41 root -** Parsing of /proc/meminfo made 2.5 proof. -** -** Revision 1.6 2002/07/10 05:00:21 root -** Counters pin/pout renamed to swin/swout (Linux conventions). -** -** Revision 1.5 2002/07/08 09:31:11 gerlof -** *** empty log message *** -** -** Revision 1.4 2002/07/02 07:36:45 gerlof -** *** empty log message *** -** -** Revision 1.3 2002/07/02 07:08:36 gerlof -** Recognize more disk driver types via regular expressions -** -** Revision 1.2 2002/01/22 13:40:11 gerlof -** Support for number of cpu's. -** -** Revision 1.1 2001/10/02 10:43:31 gerlof -** Initial revision -** */ - #include #include #include @@ -165,6 +45,7 @@ #include #include #include +#include #define SCALINGMAXCPU 8 // threshold for scaling info per CPU @@ -183,6 +64,7 @@ #include #include "atop.h" +#include "ifprop.h" #include "photosyst.h" #define MAXCNT 64 @@ -193,6 +75,12 @@ #define MDDTYPE 2 #define LVMTYPE 3 +/* recognize numa node */ +#define NUMADIR "/sys/devices/system/node" + +/* Refer to mmzone.h, the default is 11 */ +#define MAX_ORDER 11 + /* hypervisor enum */ enum { HYPER_NONE = 0, @@ -222,15 +110,18 @@ static int perfevents = PERF_EVENTS_AUTO; static void getperfevents(struct cpustat *); + +static int run_in_guest(void); +static int get_hypervisor(void); #endif static int get_infiniband(struct ifbstat *); +static int get_ksm(struct sstat *); +static int get_zswap(struct sstat *); static int isdisk(unsigned int, unsigned int, char *, struct perdsk *, int); -static int run_in_guest(void); - static struct ipv6_stats ipv6_tmp; static struct icmpv6_stats icmpv6_tmp; static struct udpv6_stats udpv6_tmp; @@ -308,16 +199,104 @@ static int v6tab_entries = sizeof(v6tab)/sizeof(struct v6tab); +// The following values are used to accumulate cpu statistics per numa. +// The bitmask realization is from numactl +#define CPUMASK_SZ (64 * 8) + +#define bitsperlong (8 * sizeof(unsigned long)) +#define howmany(x,y) (((x)+((y)-1))/(y)) +#define longsperbits(n) howmany(n, bitsperlong) + +#define round_up(x,y) (((x) + (y) - 1) & ~((y)-1)) +#define BITS_PER_LONG (sizeof(unsigned long) * 8) +#define CPU_BYTES(x) (round_up(x, BITS_PER_LONG)/8) +#define CPU_LONGS(x) (CPU_BYTES(x) / sizeof(long)) + +struct bitmask { + unsigned long size; /* number of bits in the map */ + unsigned long long *maskp; +}; + +/* + * Allocate a bitmask for cpus, of a size large enough to + * match the kernel's cpumask_t. + */ +struct bitmask * +numa_allocate_cpumask() +{ + int ncpus = CPUMASK_SZ; + struct bitmask *bmp; + + bmp = malloc(sizeof(*bmp)); + ptrverify(bmp, "Malloc failed for numa bitmask"); + + bmp->size = ncpus; + bmp->maskp = calloc(longsperbits(ncpus), sizeof(unsigned long)); + ptrverify((bmp->maskp), "Malloc failed for numa maskp"); + + return bmp; +} + +void +numa_bitmask_free(struct bitmask *bmp) +{ + if (bmp == 0) + return; + free(bmp->maskp); + bmp->maskp = (unsigned long long *)0xdeadcdef; /* double free tripwire */ + free(bmp); + return; +} + +int +numa_parse_bitmap_v2(char *line, struct bitmask *mask) +{ + int i; + char *p = strchr(line, '\n'); + if (!p) + return -1; + int ncpus = mask->size; + + for (i = 0; p > line;i++) { + char *oldp, *endp; + oldp = p; + if (*p == ',') + --p; + while (p > line && *p != ',') + --p; + /* Eat two 32bit fields at a time to get longs */ + if (p > line && sizeof(unsigned long) == 8) { + oldp--; + memmove(p, p+1, oldp-p+1); + while (p > line && *p != ',') + --p; + } + if (*p == ',') + p++; + if (i >= CPU_LONGS(ncpus)) + return -1; + mask->maskp[i] = strtoul(p, &endp, 16); + if (endp != oldp) + return -1; + p--; + } + return 0; +} + void photosyst(struct sstat *si) { static char part_stats = 1; /* per-partition statistics ? */ static char ib_stats = 1; /* InfiniBand statistics ? */ + static char ksm_stats = 1; + static char zswap_stats = 1; - register int i, nr; + register int i, nr, j; count_t cnts[MAXCNT]; float lavg1, lavg5, lavg15; FILE *fp; + DIR *dirp; + struct dirent *dentry; char linebuf[1024], nam[64], origdir[1024]; unsigned int major, minor; struct shm_info shminfo; @@ -481,7 +460,7 @@ { long long f=0; - sprintf(fn, + snprintf(fn, sizeof fn, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", i); @@ -511,7 +490,7 @@ } else { // governor statistics not available - sprintf(fn, + snprintf(fn, sizeof fn, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", i); @@ -530,7 +509,7 @@ si->cpu.cpu[i].freqcnt.maxfreq=0; } - sprintf(fn, + snprintf(fn, sizeof fn, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", i); @@ -591,6 +570,12 @@ ** gather virtual memory statistics from the file /proc/vmstat and ** store them in binary form (>= kernel 2.6) */ + si->mem.oomkills = -1; + + si->mem.allocstall = 0; + si->mem.numamigrate = 0; + si->mem.pgmigrate = 0; + if ( (fp = fopen("vmstat", "r")) != NULL) { while ( fgets(linebuf, sizeof(linebuf), fp) != NULL) @@ -624,9 +609,31 @@ continue; } - if ( strcmp("allocstall", nam) == EQ) + // more counters might start with "allocstall" + if ( memcmp("allocstall", nam, 10) == EQ) + { + si->mem.allocstall += cnts[0]; + continue; + } + + if ( strcmp("oom_kill", nam) == EQ) { - si->mem.allocstall = cnts[0]; + si->mem.oomkills = cnts[0]; + continue; + } + + if ( strcmp("compact_stall", nam) == EQ) { + si->mem.compactstall = cnts[0]; + continue; + } + + if ( strcmp("numa_pages_migrated", nam) == EQ) { + si->mem.numamigrate = cnts[0]; + continue; + } + + if ( strcmp("pgmigrate_success", nam) == EQ) { + si->mem.pgmigrate = cnts[0]; continue; } } @@ -785,7 +792,7 @@ ** gather vmware-related statistics from /proc/vmmemctl ** (only present if balloon driver enabled) */ - si->mem.vmwballoon = (count_t) 0; + si->mem.vmwballoon = (count_t) -1; if ( (fp = fopen("vmmemctl", "r")) != NULL) { @@ -808,7 +815,7 @@ ** searching for: ** size 4 519101312 */ - si->mem.zfsarcsize = (count_t) 0; + si->mem.zfsarcsize = (count_t) -1; if ( (fp = fopen("spl/kstat/zfs/arcstats", "r")) != NULL) { @@ -831,6 +838,195 @@ } /* + ** gather per numa memory-related statistics from the file + ** /sys/devices/system/node/node0/meminfo, and store them in binary form. + */ + dirp = opendir(NUMADIR); + + if (dirp) + { + /* + ** read every directory-entry and search for all numa nodes + */ + while ( (dentry = readdir(dirp)) ) + { + if (strncmp(dentry->d_name, "node", 4)) + continue; + + j = strtoul(dentry->d_name + 4, NULL, 0); + + if (j >= MAXNUMA) // too many NUMA nodes? + continue; // skip (no break, because order unknown) + + si->memnuma.nrnuma++; + + snprintf(fn, sizeof fn, NUMADIR "/%s/meminfo", dentry->d_name); + + if ( (fp = fopen(fn, "r")) != NULL) + { + while ( fgets(linebuf, sizeof(linebuf), fp) != NULL) + { + nr = sscanf(&linebuf[5], + "%lld %s %lld\n", + &cnts[0], nam, &cnts[1]); + + if (cnts[0] != j) + continue; + + if ( strcmp("MemTotal:", nam) == EQ) + si->memnuma.numa[j].totmem = cnts[1]*1024/pagesize; + else if ( strcmp("MemFree:", nam) == EQ) + si->memnuma.numa[j].freemem = cnts[1]*1024/pagesize; + else if ( strcmp("FilePages:", nam) == EQ) + si->memnuma.numa[j].filepage = cnts[1]*1024/pagesize; + else if ( strcmp("Active:", nam) == EQ) + si->memnuma.numa[j].active = cnts[1]*1024/pagesize; + else if ( strcmp("Inactive:", nam) == EQ) + si->memnuma.numa[j].inactive = cnts[1]*1024/pagesize; + else if ( strcmp("Dirty:", nam) == EQ) + si->memnuma.numa[j].dirtymem = cnts[1]*1024/pagesize; + else if ( strcmp("Shmem:", nam) == EQ) + si->memnuma.numa[j].shmem = cnts[1]*1024/pagesize; + else if ( strcmp("Slab:", nam) == EQ) + si->memnuma.numa[j].slabmem = cnts[1]*1024/pagesize; + else if ( strcmp("SReclaimable:", nam) == EQ) + si->memnuma.numa[j].slabreclaim = cnts[1]*1024/pagesize; + else if ( strcmp("HugePages_Total:", nam) == EQ) + si->memnuma.numa[j].tothp = cnts[1]; + } + fclose(fp); + } + } + closedir(dirp); + } + + /* gather fragmentation level for per numa, only for 'Normal' */ + if (si->memnuma.nrnuma > 0) + { + char tmp[64]; + float frag[MAX_ORDER]; + + /* If kernel CONFIG_COMPACTION is enabled, get the percentage directly */ + if ( (fp = fopen("/sys/kernel/debug/extfrag/unusable_index", "r")) != NULL ) + { + while ( fgets(linebuf, sizeof(linebuf), fp) != NULL ) + { + nr = sscanf(&linebuf[5], + "%lld, %s %s %f %f %f %f %f %f %f %f %f %f %f\n", + &cnts[0], tmp, nam, &frag[0], &frag[1], &frag[2], + &frag[3], &frag[4], &frag[5], &frag[6], &frag[7], + &frag[8], &frag[9], &frag[10]); + + if ( nr < 3 || strcmp("Normal", nam) != 0 ) + continue; + + for (i = 0; i < MAX_ORDER; i++) + si->memnuma.numa[cnts[0]].frag += frag[i]; + + si->memnuma.numa[cnts[0]].frag /= MAX_ORDER; + } + fclose(fp); + } + /* If CONFIG_COMPACTION is not enabled, calculate from buddyinfo file */ + else if ( (fp = fopen("/proc/buddyinfo", "r")) != NULL ) + { + count_t free_page[MAX_ORDER]; + count_t total_free, prev_free; + float total_frag; + + while ( fgets(linebuf, sizeof(linebuf), fp) != NULL ) + { + nr = sscanf(&linebuf[5], + "%lld, %s %s %lld %lld %lld %lld %lld " + "%lld %lld %lld %lld %lld %lld\n", + &cnts[0], tmp, nam, &cnts[1], &cnts[2], &cnts[3], + &cnts[4], &cnts[5], &cnts[6], &cnts[7], &cnts[8], + &cnts[9], &cnts[10], &cnts[11]); + + if (nr < 3 || strcmp("Normal", nam) != 0 ) + continue; + + /* get free pages numbers for each order, and total free pages */ + total_free = 0; + total_frag = 0.00; + for (i = 0; i < MAX_ORDER; i++) + { + free_page[i] = cnts[i+1] << i; + total_free += free_page[i]; + } + /* get fragmentation level for each order, then summarize */ + for (i = 0; i < MAX_ORDER; i++) + { + prev_free = 0; + for (j = 0; j < i; j++) + prev_free += free_page[j]; + total_frag += (float)prev_free/total_free; + } + + if (cnts[0] < MAXNUMA) + si->memnuma.numa[cnts[0]].frag = total_frag/MAX_ORDER; + } + fclose(fp); + } + } + + /* + ** accumulate each cpu statistic for per NUMA, and identify numa/cpu + ** relationship from /sys/devices/system/node/node0/cpumap. + */ + if (si->memnuma.nrnuma > 1) + { + char *line = NULL; + size_t len = 0; + struct bitmask *mask; + + mask = numa_allocate_cpumask(); + + si->cpunuma.nrnuma = si->memnuma.nrnuma; + + for (j=0; j < si->cpunuma.nrnuma; j++) + { + snprintf(fn, sizeof fn, NUMADIR "/node%d/cpumap", j); + + if ( (fp = fopen(fn, "r")) != 0) + { + if ( getdelim(&line, &len, '\n', fp) > 0 ) + { + if (numa_parse_bitmap_v2(line, mask) < 0) + { + mcleanstop(54, "failed to parse numa bitmap\n"); + } + } + fclose(fp); + } + + for (i=0; i < mask->size; i++) + { + if ( (mask->maskp[i/bitsperlong] >> (i % bitsperlong)) & 1 ) + { + si->cpunuma.numa[j].nrcpu++; + si->cpunuma.numa[j].utime += si->cpu.cpu[i].utime; + si->cpunuma.numa[j].ntime += si->cpu.cpu[i].ntime; + si->cpunuma.numa[j].stime += si->cpu.cpu[i].stime; + si->cpunuma.numa[j].itime += si->cpu.cpu[i].itime; + si->cpunuma.numa[j].wtime += si->cpu.cpu[i].wtime; + si->cpunuma.numa[j].Itime += si->cpu.cpu[i].Itime; + si->cpunuma.numa[j].Stime += si->cpu.cpu[i].Stime; + si->cpunuma.numa[j].steal += si->cpu.cpu[i].steal; + si->cpunuma.numa[j].guest += si->cpu.cpu[i].guest; + } + } + } + + free(line); + numa_bitmask_free(mask); + } + else + { + si->cpunuma.nrnuma = 0; + } + + /* ** gather network-related statistics ** - interface stats from the file /proc/net/dev ** - IPv4 stats from the file /proc/net/snmp @@ -840,8 +1036,11 @@ /* ** interface statistics */ + initifprop(); // periodically refresh interface properties + if ( (fp = fopen("net/dev", "r")) != NULL) { + struct ifprop ifprop; char *cp; i = 0; @@ -873,11 +1072,30 @@ &(si->intf.intf[i].scarrier), &(si->intf.intf[i].scompr)); - if (nr == 17) /* skip header & lines without stats */ - { - if (++i >= MAXINTF-1) - break; - } + /* + ** skip header line and lines without stats + */ + if (nr != 17) + continue; + + /* + ** skip interfaces that are invalidated + ** (mainly virtual interfaces) + ** because the total number of interfaces + ** exceeds the maximum supported by atop (MAXINTF) + */ + strcpy(ifprop.name, si->intf.intf[i].name); + + if (!getifprop(&ifprop)) + continue; + + /* + ** accept this interface but skip the remaining + ** interfaces because we reached the total number + ** of interfaces supported by atop (MAXINTF) + */ + if (++i >= MAXINTF-1) + break; } si->intf.intf[i].name[0] = '\0'; /* set terminator for table */ @@ -1056,21 +1274,35 @@ while ( fgets(linebuf, sizeof(linebuf), fp) ) { + /* discards are not supported in older kernels */ + tmpdsk.ndisc = -1; + nr = sscanf(linebuf, - "%d %d %255s %lld %*d %lld %*d " - "%lld %*d %lld %*d %*d %lld %lld", + "%d %d %255s " // ident + "%lld %*d %lld %*d " // reads + "%lld %*d %lld %*d " // writes + "%*d %lld %lld " // misc + "%lld %*d %lld %*d", // discards &major, &minor, diskname, &tmpdsk.nread, &tmpdsk.nrsect, &tmpdsk.nwrite, &tmpdsk.nwsect, - &tmpdsk.io_ms, &tmpdsk.avque ); + &tmpdsk.io_ms, &tmpdsk.avque, + &tmpdsk.ndisc, &tmpdsk.ndsect); - /* - ** check if this line concerns the entire disk - ** or just one of the partitions of a disk (to be - ** skipped) - */ - if (nr == 9) /* full stats-line ? */ + if (nr >= 9) /* full stats-line ? */ { + /* + ** when no transfers issued, skip disk (partition) + */ + if (tmpdsk.nread + tmpdsk.nwrite + + (tmpdsk.ndisc == -1 ? 0 : tmpdsk.ndisc) == 0) + continue; + + /* + ** check if this line concerns the entire disk + ** or just one of the partitions of a disk (to be + ** skipped) + */ switch ( isdisk(major, minor, diskname, &tmpdsk, MAXDKNAM) ) { @@ -1543,6 +1775,18 @@ ib_stats = get_infiniband(&(si->ifb)); /* + ** get counters related to ksm + */ + if (ksm_stats) + ksm_stats = get_ksm(si); + + /* + ** get counters related to zswap + */ + if (zswap_stats) + zswap_stats = get_zswap(si); + + /* ** return to original directory */ if ( chdir(origdir) == -1) @@ -1717,6 +1961,7 @@ { "^md[0-9][0-9]*$", {0}, nullmodname, MDDTYPE, }, { "^vd[a-z][a-z]*$", {0}, nullmodname, DSKTYPE, }, { "^nvme[0-9][0-9]*n[0-9][0-9]*$", {0}, nullmodname, DSKTYPE, }, + { "^nvme[0-9][0-9]*c[0-9][0-9]*n[0-9][0-9]*$", {0}, nullmodname, DSKTYPE, }, { "^nbd[0-9][0-9]*$", {0}, nullmodname, DSKTYPE, }, { "^hd[a-z]$", {0}, nullmodname, DSKTYPE, }, { "^rd/c[0-9][0-9]*d[0-9][0-9]*$", {0}, nullmodname, DSKTYPE, }, @@ -2106,6 +2351,222 @@ } /* +** retrieve ksm values (if switched on) +*/ +static int +get_ksm(struct sstat *si) +{ + FILE *fp; + int state; + + si->mem.ksmsharing = -1; + si->mem.ksmshared = -1; + + if ((fp=fopen("/sys/kernel/mm/ksm/run", "r")) != 0) + { + if (fscanf(fp, "%d", &state) == 1) + { + if (state == 0) + { + fclose(fp); + return 0; // no more calling + } + } + + fclose(fp); + } + + if ((fp=fopen("/sys/kernel/mm/ksm/pages_sharing", "r")) != 0) + { + if (fscanf(fp, "%llu", &(si->mem.ksmsharing)) != 1) + si->mem.ksmsharing = 0; + + fclose(fp); + } + + if ((fp=fopen("/sys/kernel/mm/ksm/pages_shared", "r")) != 0) + { + if (fscanf(fp, "%llu", &(si->mem.ksmshared)) != 1) + si->mem.ksmshared = 0; + + fclose(fp); + } + + return 1; +} + +/* +** retrieve zswap values (if switched on) +*/ +static int +get_zswap(struct sstat *si) +{ + FILE *fp; + char state; + + si->mem.zswtotpool = -1; + si->mem.zswstored = -1; + + if ((fp=fopen("/sys/module/zswap/parameters/enabled", "r")) != 0) + { + if (fscanf(fp, "%c", &state) == 1) + { + if (state != 'Y') + { + fclose(fp); + return 0; // no more calling + } + } + + fclose(fp); + } + + regainrootprivs(); + + if ((fp=fopen("/sys/kernel/debug/zswap/pool_total_size", "r")) != 0) + { + if (fscanf(fp, "%llu", &(si->mem.zswtotpool)) != 1) + si->mem.zswtotpool = 0; + else + si->mem.zswtotpool /= pagesize; + + fclose(fp); + } + + if ((fp=fopen("/sys/kernel/debug/zswap/stored_pages", "r")) != 0) + { + if (fscanf(fp, "%llu", &(si->mem.zswstored)) != 1) + si->mem.zswstored = 0; + + fclose(fp); + } + + if (! droprootprivs()) + mcleanstop(42, "failed to drop root privs\n"); + + return 1; +} + + +#if HTTPSTATS +/* +** retrieve statistics from local HTTP daemons +** via http://localhost/server-status?auto +*/ +int +getwwwstat(unsigned short port, struct wwwstat *wp) +{ + int sockfd, tobefound; + FILE *sockfp; + struct sockaddr_in sockname; + char linebuf[4096]; + char label[512]; + long long value; + + memset(wp, 0, sizeof *wp); + + /* + ** allocate a socket and connect to the local HTTP daemon + */ + if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) + return 0; + + sockname.sin_family = AF_INET; + sockname.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sockname.sin_port = htons(port); + + if ( connect(sockfd, (struct sockaddr *) &sockname, + sizeof sockname) == -1) + { + close(sockfd); + return 0; + } + + /* + ** write a GET-request for /server-status + */ + if ( write(sockfd, HTTPREQ, sizeof HTTPREQ) < sizeof HTTPREQ) + { + close(sockfd); + return 0; + } + + /* + ** remap socket descriptor to a stream to allow stdio calls + */ + sockfp = fdopen(sockfd, "r+"); + + /* + ** read response line by line + */ + tobefound = 5; /* number of values to be searched */ + + while ( fgets(linebuf, sizeof linebuf, sockfp) && tobefound) + { + /* + ** handle line containing status code + */ + if ( strncmp(linebuf, "HTTP/", 5) == 0) + { + sscanf(linebuf, "%511s %lld %*s\n", label, &value); + + if (value != 200) /* HTTP-request okay? */ + { + fclose(sockfp); + close(sockfd); + return 0; + } + + continue; + } + + /* + ** decode line and search for the required counters + */ + if (sscanf(linebuf, "%511[^:]: %lld\n", label, &value) == 2) + { + if ( strcmp(label, "Total Accesses") == 0) + { + wp->accesses = value; + tobefound--; + } + + if ( strcmp(label, "Total kBytes") == 0) + { + wp->totkbytes = value; + tobefound--; + } + + if ( strcmp(label, "Uptime") == 0) + { + wp->uptime = value; + tobefound--; + } + + if ( strcmp(label, "BusyWorkers") == 0) + { + wp->bworkers = value; + tobefound--; + } + + if ( strcmp(label, "IdleWorkers") == 0) + { + wp->iworkers = value; + tobefound--; + } + } + } + + fclose(sockfp); + close(sockfd); + + return 1; +} +#endif + + + +/* ** retrieve low-level CPU events: ** instructions and cycles per CPU */ @@ -2261,130 +2722,12 @@ } } } -#else -void -do_perfevents(char *tagname, char *tagvalue) -{ - wcleanstop(1, "atop built with NOPERFEVENT, cannot use perfevents\n"); -} -#endif -#if HTTPSTATS -/* -** retrieve statistics from local HTTP daemons -** via http://localhost/server-status?auto -*/ -int -getwwwstat(unsigned short port, struct wwwstat *wp) +static int +run_in_guest(void) { - int sockfd, tobefound; - FILE *sockfp; - struct sockaddr_in sockname; - char linebuf[4096]; - char label[512]; - long long value; - - memset(wp, 0, sizeof *wp); - - /* - ** allocate a socket and connect to the local HTTP daemon - */ - if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) - return 0; - - sockname.sin_family = AF_INET; - sockname.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - sockname.sin_port = htons(port); - - if ( connect(sockfd, (struct sockaddr *) &sockname, - sizeof sockname) == -1) - { - close(sockfd); - return 0; - } - - /* - ** write a GET-request for /server-status - */ - if ( write(sockfd, HTTPREQ, sizeof HTTPREQ) < sizeof HTTPREQ) - { - close(sockfd); - return 0; - } - - /* - ** remap socket descriptor to a stream to allow stdio calls - */ - sockfp = fdopen(sockfd, "r+"); - - /* - ** read response line by line - */ - tobefound = 5; /* number of values to be searched */ - - while ( fgets(linebuf, sizeof linebuf, sockfp) && tobefound) - { - /* - ** handle line containing status code - */ - if ( strncmp(linebuf, "HTTP/", 5) == 0) - { - sscanf(linebuf, "%511s %lld %*s\n", label, &value); - - if (value != 200) /* HTTP-request okay? */ - { - fclose(sockfp); - close(sockfd); - return 0; - } - - continue; - } - - /* - ** decode line and search for the required counters - */ - if (sscanf(linebuf, "%511[^:]: %lld\n", label, &value) == 2) - { - if ( strcmp(label, "Total Accesses") == 0) - { - wp->accesses = value; - tobefound--; - } - - if ( strcmp(label, "Total kBytes") == 0) - { - wp->totkbytes = value; - tobefound--; - } - - if ( strcmp(label, "Uptime") == 0) - { - wp->uptime = value; - tobefound--; - } - - if ( strcmp(label, "BusyWorkers") == 0) - { - wp->bworkers = value; - tobefound--; - } - - if ( strcmp(label, "IdleWorkers") == 0) - { - wp->iworkers = value; - tobefound--; - } - } - } - - fclose(sockfp); - close(sockfd); - - return 1; + return get_hypervisor() != HYPER_NONE; } -#endif - #if defined(__x86_64__) || defined(__i386__) #define HYPERVISOR_INFO_LEAF 0x40000000 @@ -2447,8 +2790,11 @@ } #endif -static int -run_in_guest(void) +#else /* ! NOPERFEVENT */ +void +do_perfevents(char *tagname, char *tagvalue) { - return get_hypervisor() != HYPER_NONE; + if (strcmp("disable", tagvalue)) + mcleanstop(1, "atop built with NOPERFEVENT, cannot use perfevents\n"); } +#endif diff -Nru atop-2.6.0/photosyst.h atop-2.7.1/photosyst.h --- atop-2.6.0/photosyst.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/photosyst.h 2022-01-08 11:49:00.000000000 +0000 @@ -28,6 +28,7 @@ #define MAXCPU 2048 #define MAXDSK 1024 +#define MAXNUMA 1024 #define MAXLVM 2048 #define MAXMDD 256 #define MAXINTF 128 @@ -75,7 +76,56 @@ count_t vmwballoon; // vmware claimed balloon pages count_t zfsarcsize; // zfsonlinux ARC size (pages) count_t swapcached; // swap cache (pages) - count_t cfuture[6]; // reserved for future use + count_t ksmsharing; // saved i.e. deduped memory (pages) + count_t ksmshared; // current size shared pages (pages) + count_t zswstored; // zswap stored pages (pages) + count_t zswtotpool; // total pool size (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 cfuture[9]; // reserved for future use +}; + +/************************************************************************/ + +struct mempernuma { + 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 +}; + +struct memnuma { + count_t nrnuma; /* the counts of numa */ + struct mempernuma numa[MAXNUMA]; +}; + +struct cpupernuma { + 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 { + count_t nrnuma; /* the counts of numa */ + struct cpupernuma numa[MAXNUMA]; }; /************************************************************************/ @@ -115,7 +165,7 @@ struct freqcnt freqcnt;/* frequency scaling info */ count_t instr; /* CPU instructions */ count_t cycle; /* CPU cycles */ - count_t cfuture[2]; /* reserved for future use */ + count_t cfuture[6]; /* reserved for future use */ }; struct cpustat { @@ -142,7 +192,9 @@ 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 cfuture[4]; /* reserved for future use */ + count_t ndisc; /* number of discards (-1 = unavailable)*/ + count_t ndsect; /* number of sectors discarded */ + count_t cfuture[2]; /* reserved for future use */ }; struct dskstat { @@ -179,7 +231,7 @@ count_t scompr; /* transmit compressed */ count_t sfuture[4]; /* reserved for future use */ - char type; /* interface type ('e'/'w'/'?') */ + char type; /* interface type ('e'/'w'/'v'/'?') */ long speed; /* interface speed in megabits/second */ long speedp; /* previous interface speed */ char duplex; /* full duplex (boolean) */ @@ -355,6 +407,8 @@ struct memstat mem; struct netstat net; struct intfstat intf; + struct memnuma memnuma; + struct cpunuma cpunuma; struct dskstat dsk; struct nfsstat nfs; struct contstat cfs; diff -Nru atop-2.6.0/prev/photoproc_27.h atop-2.7.1/prev/photoproc_27.h --- atop-2.6.0/prev/photoproc_27.h 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/prev/photoproc_27.h 2022-01-08 11:49:00.000000000 +0000 @@ -0,0 +1,115 @@ +/* +** structure containing only relevant process-info extracted +** from kernel's process-administration +*/ +struct tstat_27 { + /* GENERAL TASK INFO */ + struct gen_27 { + 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 ctid; /* OpenVZ container ID */ + int vpid; /* OpenVZ virtual PID */ + + int wasinactive; /* boolean: task inactive */ + + char container[16]; /* Docker container id (12 pos) */ + } gen; + + /* CPU STATISTICS */ + struct cpu_27 { + 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 ifuture[4]; /* reserved for future use */ + char wchan[16]; /* wait channel string */ + count_t rundelay; /* schedstat rundelay (nanosec) */ + count_t cfuture[1]; /* reserved for future use */ + } cpu; + + /* DISK STATISTICS */ + struct dsk_27 { + 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_27 { + 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 cfuture[3]; /* reserved for future use */ + } mem; + + /* NETWORK STATISTICS */ + struct net_27 { + 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_27 { + 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 -Nru atop-2.6.0/prev/photosyst_27.h atop-2.7.1/prev/photosyst_27.h --- atop-2.6.0/prev/photosyst_27.h 1970-01-01 00:00:00.000000000 +0000 +++ atop-2.7.1/prev/photosyst_27.h 2022-01-08 11:49:00.000000000 +0000 @@ -0,0 +1,389 @@ +#define MAXCPU_27 2048 +#define MAXDSK_27 1024 +#define MAXNUMA_27 1024 +#define MAXLVM_27 2048 +#define MAXMDD_27 256 +#define MAXINTF_27 128 +#define MAXCONTAINER_27 128 +#define MAXNFSMOUNT_27 64 +#define MAXIBPORT_27 32 +#define MAXGPU_27 32 +#define MAXGPUBUS_27 12 +#define MAXGPUTYPE_27 12 + +/************************************************************************/ +struct memstat_27 { + 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 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 tothugepage; // total huge pages (huge pages) + count_t freehugepage; // free huge pages (huge pages) + count_t hugepagesz; // huge page size (bytes) + + 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 zswstored; // zswap stored pages (pages) + count_t zswtotpool; // total pool size (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 cfuture[9]; // reserved for future use +}; + +/************************************************************************/ + +struct mempernuma_27 { + 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 +}; + +struct memnuma_27 { + count_t nrnuma; /* the counts of numa */ + struct mempernuma_27 numa[MAXNUMA_27]; +}; + +struct cpupernuma_27 { + 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_27 { + count_t nrnuma; /* the counts of numa */ + struct cpupernuma_27 numa[MAXNUMA_27]; +}; + +/************************************************************************/ + +struct netstat_27 { + 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_27 { + 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 actul freq */ +}; + +struct percpu_27 { + 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_27 freqcnt;/* frequency scaling info */ + count_t instr; /* CPU instructions */ + count_t cycle; /* CPU cycles */ + count_t cfuture[6]; /* reserved for future use */ +}; + +struct cpustat_27 { + 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_27 all; + struct percpu_27 cpu[MAXCPU_27]; +}; + +/************************************************************************/ + +struct perdsk_27 { + char name[MAXDKNAM]; /* 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 cfuture[2]; /* reserved for future use */ +}; + +struct dskstat_27 { + int ndsk; /* number of physical disks */ + int nmdd; /* number of md volumes */ + int nlvm; /* number of logical volumes */ + struct perdsk_27 dsk[MAXDSK_27]; + struct perdsk_27 mdd[MAXMDD_27]; + struct perdsk_27 lvm[MAXLVM_27]; +}; + +/************************************************************************/ + +struct perintf_27 { + 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_27 { + int nrintf; + struct perintf_27 intf[MAXINTF_27]; +}; + +/************************************************************************/ + +struct pernfsmount_27 { + 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_27 { + 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_27 nfsmnt[MAXNFSMOUNT_27]; + } nfsmounts; +}; + +/************************************************************************/ +struct psi_27 { + 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_27 { + char present; /* pressure stats supported? */ + char future[3]; + struct psi_27 cpusome; /* pressure stall info 'some' */ + struct psi_27 memsome; /* pressure stall info 'some' */ + struct psi_27 memfull; /* pressure stall info 'full' */ + struct psi_27 iosome; /* pressure stall info 'some' */ + struct psi_27 iofull; /* pressure stall info 'full' */ +}; + +/************************************************************************/ + +struct percontainer_27 { + 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_27 { + int nrcontainer; + struct percontainer_27 cont[MAXCONTAINER_27]; +}; + +/************************************************************************/ +/* +** experimental stuff for access to local HTTP daemons +*/ +#define HTTPREQ "GET /server-status?auto HTTP/1.1\nHost: localhost\n\n" + +struct wwwstat_27 { + 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 */ +}; + +#if HTTPSTATS +int getwwwstat(unsigned short, struct wwwstat_27 *); +#endif +/************************************************************************/ +struct pergpu_27 { + char taskstats; // GPU task statistics supported? + unsigned char nrprocs; // number of processes using GPU + char type[MAXGPUTYPE_27+1]; // GPU type + char busid[MAXGPUBUS_27+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_27 { + int nrgpus; // total number of GPUs + struct pergpu_27 gpu[MAXGPU_27]; +}; + +/************************************************************************/ +struct perifb_27 { + char ibname[MAXIBNAME]; // 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_27 { + int nrports; // total number of IB ports + struct perifb_27 ifb[MAXIBPORT_27]; +}; +/************************************************************************/ + +struct sstat_27 { + struct cpustat_27 cpu; + struct memstat_27 mem; + struct netstat_27 net; + struct intfstat_27 intf; + struct memnuma_27 memnuma; + struct cpunuma_27 cpunuma; + struct dskstat_27 dsk; + struct nfsstat_27 nfs; + struct contstat_27 cfs; + struct pressure_27 psi; + struct gpustat_27 gpu; + struct ifbstat_27 ifb; + + struct wwwstat_27 www; +}; diff -Nru atop-2.6.0/psaccs_atop atop-2.7.1/psaccs_atop --- atop-2.6.0/psaccs_atop 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/psaccs_atop 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -# Logrotate file to take action before psacct is rotated -/var/log/atop/dummy_before { - missingok - daily - rotate 0 - ifempty - create 0600 root root - postrotate - # check if process accounting is installed - # - if [ -e /etc/logrotate.d/psacct ] - then - # check if process accounting is actually in use - # - ACCTFILE=`awk '$2 == "{" {print $1}' /etc/logrotate.d/psacct` - - if [ -f "$ACCTFILE" ] - then - ACCTSIZE1=`ls -l "$ACCTFILE" | awk '{print $5}'` - ACCTSIZE2=`ls -l "$ACCTFILE" | awk '{print $5}'` - - if [ $ACCTSIZE1 -lt $ACCTSIZE2 ] - then - # stop atop daemon before accounting file - # is rotated - # - PIDFILE=/var/run/atop.pid - - if [ -e $PIDFILE ] && \ - ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null - then - kill -USR2 `cat $PIDFILE` # take final sample - rm $PIDFILE - sleep 1 - fi - fi - fi - fi - endscript -} diff -Nru atop-2.6.0/psaccu_atop atop-2.7.1/psaccu_atop --- atop-2.6.0/psaccu_atop 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/psaccu_atop 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -# Logrotate file to take action after psacct is rotated -/var/log/atop/dummy_after { - missingok - daily - rotate 0 - ifempty - create 0600 root root - postrotate - if [ -e /etc/logrotate.d/psacct ] - then - # if the atop daemon does not run, restart it after - # accounting file is rotated - PIDFILE=/var/run/atop.pid - - if [ -e $PIDFILE ] && \ - ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null - then - : - else - /usr/share/atop/atop.daily& - fi - fi - endscript -} diff -Nru atop-2.6.0/rawlog.c atop-2.7.1/rawlog.c --- atop-2.6.0/rawlog.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/rawlog.c 2022-01-08 11:49:00.000000000 +0000 @@ -54,6 +54,7 @@ #include "rawlog.h" #define BASEPATH "/var/log/atop" +#define BINPATH "/usr/bin/atop" static int getrawrec (int, struct rawrecord *, int); static int getrawsstat(int, struct sstat *, int); @@ -989,7 +990,7 @@ static void try_other_version(int majorversion, int minorversion) { - char tmpbuf[1024], *p; + char tmpbuf[1024]; extern char **argvp; int fds; struct rlimit rlimit; @@ -1000,8 +1001,7 @@ ** the current pathname (if any) is stripped off */ snprintf(tmpbuf, sizeof tmpbuf, "%s-%d.%d", - (p = strrchr(*argvp, '/')) ? p+1 : *argvp, - majorversion, minorversion); + BINPATH, majorversion, minorversion); fprintf(stderr, "trying to activate %s....\n", tmpbuf); diff -Nru atop-2.6.0/rawlog.h atop-2.7.1/rawlog.h --- atop-2.6.0/rawlog.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/rawlog.h 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,32 @@ /* +** ATOP - System & Process Monitor +** +** The program 'atop' offers the possibility to view the activity of +** the system on system-level as well as process-level. +** ========================================================================== +** Author: Gerlof Langeveld +** E-mail: gerlof.langeveld@atoptool.nl +** Date: September 2002 +** -------------------------------------------------------------------------- +** Copyright (C) 2000-2010 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 +** Free Software Foundation; either version 2, or (at your option) any +** later version. +** +** This program is distributed in the hope that it will be useful, but +** WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** -------------------------------------------------------------------------- +*/ + +/* ** structure describing the raw file contents ** ** layout raw file: rawheader diff -Nru atop-2.6.0/README atop-2.7.1/README --- atop-2.6.0/README 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/README 2022-01-08 11:49:00.000000000 +0000 @@ -1,4 +1,12 @@ +COPYRIGHT NOTICE +---------------- +For all files that are not marked differently: + +Copyright Gerlof Langeveld 2007-2021 and licensed under the GPL v2 (or any later version). + + DEPENDENCIES +------------ Install the following packages to be able to build atop (package name can be different depending on the Linux distro): @@ -15,15 +23,16 @@ INSTALLING AND USING ATOP +------------------------- For interactive use, it is sufficient to install ATOP with the command (as root): - make systemdinstall + make install (systemd based) or - make sysvinstall + make sysvinstall (System V init based) For automatic logging in compressed binary format, see the description in the manual-page. @@ -34,6 +43,25 @@ per process/thread as described in www.atoptool.nl/netatop.php +PROCESS ACCOUNTING WITH PSACCT/ACCT PACKAGE +------------------------------------------- +Preferably, process accounting should be handled by the atopacctd daemon +which is implicitly installed when installing atop. This daemon takes +care that process accounting is only active when at least one atop +process is running. Besides, when process accounting is activated, +atopacctd takes care that the disk utilization is minimal. +See the man page of atopacctd for further details. + +When the psacct or acct package is installed in parallel with the +atop package and you want to enable/start the (ps)acct service for +permanent process accounting, take care that the atopacct will be +disabled. The atopacct service and the (ps)acct service mutually +exclude one another. +When the (ps)acct service is enabled, atop automatically uses the +process accounting file that is used by this package. +See also the section PROCESS ACCOUNTING in the man page of atop. + + KERNEL ISSUES WITH PROCESS ACCOUNTING ------------------------------------- @@ -71,5 +99,29 @@ https://lkml.org/lkml/2016/12/19/182 +SERVICE ACTIVATION AFTER INSTALLATION +------------------------------------- + +After the package has been installed, be sure that the related services +are activated. +To support handling of terminated processes using process accounting, +enable the atopacct service: + + systemctl enable --now atopacct + +Notice that this service should not be enabled when the package +psacct or acct (depends on the Linux distribution) has been installed +and enabled. In that case atop uses the daily process accounting file +created via that package. + +To support maintaining daily log files to keep track of long-term analysis +information, enable the atop service and the related timer: + + systemctl enable --now atop + systemctl enable --now atop-rotate.timer + + + + Gerlof Langeveld gerlof.langeveld@atoptool.nl diff -Nru atop-2.6.0/showgeneric.c atop-2.7.1/showgeneric.c --- atop-2.6.0/showgeneric.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/showgeneric.c 2022-01-08 11:49:00.000000000 +0000 @@ -28,231 +28,6 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** -------------------------------------------------------------------------- -** -** $Log: showgeneric.c,v $ -** Revision 1.71 2010/10/25 19:08:32 gerlof -** When the number of lines is too small for the system-level -** lines, limit the number of variable resources automatically -** to a minimum. -** -** Revision 1.70 2010/10/23 14:04:05 gerlof -** Counters for total number of running and sleep threads (JC van Winkel). -** -** Revision 1.69 2010/04/23 12:19:35 gerlof -** Modified mail-address in header. -** -** Revision 1.68 2010/04/23 09:58:11 gerlof -** Version (flag -V) handled earlier after startup. -** -** Revision 1.67 2010/04/23 07:57:32 gerlof -** Proper sorting of processes when switching from single process view -** to cumulative view (key 'u' or 'p') and vice versa. -** -** Revision 1.66 2010/04/17 17:20:26 gerlof -** Allow modifying the layout of the columns in the system lines. -** -** Revision 1.65 2010/03/16 21:13:38 gerlof -** Program and user selection can be combined with program and user -** accumulation. -** -** Revision 1.64 2010/03/16 20:18:46 gerlof -** Show in header-line if user selections and program selection are active. -** -** Revision 1.63 2010/03/16 20:08:51 gerlof -** Performance improvement: only sort system-resources once per interval. -** -** Revision 1.62 2010/03/04 10:53:01 gerlof -** Support I/O-statistics on logical volumes and MD devices. -** -** Revision 1.61 2009/12/17 10:55:07 gerlof -** *** empty log message *** -** -** Revision 1.60 2009/12/17 10:50:30 gerlof -** Allow own defined process line with key 'o' and a definition -** in the atoprc file. -** -** Revision 1.59 2009/12/17 09:03:26 gerlof -** Center message "....since boot" in status line on first screen. -** -** Revision 1.58 2009/12/17 08:55:15 gerlof -** Show messages on status line in color to draw attention. -** -** Revision 1.57 2009/12/17 08:16:14 gerlof -** Introduce branch-key to go to specific time in raw file. -** -** Revision 1.56 2009/12/12 09:06:39 gerlof -** Corrected cumulated disk I/O per user/program (JC van Winkel). -** -** Revision 1.55 2009/12/10 13:34:44 gerlof -** Show which toggle-keys are active in the header line. -** -** Revision 1.54 2009/12/10 11:55:03 gerlof -** Introduce system-wide /etc/atoprc -** -** Revision 1.53 2009/12/10 09:53:08 gerlof -** Improved display of header-line (JC van Winkel). -** -** Revision 1.52 2008/03/06 10:14:01 gerlof -** Modified help-messages. -** -** Revision 1.51 2008/02/25 13:47:21 gerlof -** Bug-solution: segmentation-fault in case of invalid regular expression. -** -** Revision 1.50 2008/01/07 11:33:58 gerlof -** Cosmetic changes. -** -** Revision 1.49 2008/01/07 10:18:24 gerlof -** Implement possibility to make summaries with atopsar. -** -** Revision 1.48 2007/03/22 10:12:17 gerlof -** Support for io counters (>= kernel 2.6.20). -** -** Revision 1.47 2007/03/21 14:22:34 gerlof -** Handle io counters maintained from 2.6.20 -** -** Revision 1.46 2007/03/20 11:13:15 gerlof -** Cosmetic changes. -** -** Revision 1.45 2007/03/09 12:39:59 gerlof -** Do not allow 'N' and 'D' when kernel-patch is not installed. -** -** Revision 1.44 2007/02/13 10:31:53 gerlof -** Removal of external declarations. -** -** Revision 1.43 2007/01/18 10:41:45 gerlof -** Add support for colors. -** Add support for automatic determination of most critical resource. -** -** Revision 1.42 2006/11/13 13:48:36 gerlof -** Implement load-average counters, context-switches and interrupts. -** -** Revision 1.41 2006/04/03 05:42:35 gerlof -** *** empty log message *** -** -** Revision 1.40 2006/02/07 08:28:26 gerlof -** Improve screen-handling (less flashing) by exchanging clear() -** by werase() (contribution Folkert van Heusden). -** -** Revision 1.39 2005/11/04 14:16:16 gerlof -** Minor bug-solutions. -** -** Revision 1.38 2005/10/28 09:52:03 gerlof -** All flags/subcommands are defined as macro's. -** Subcommand 'p' has been changed to 'z' (pause). -** -** Revision 1.37 2005/10/24 06:12:17 gerlof -** Flag -L modified into -l. -** -** Revision 1.36 2005/10/21 09:50:46 gerlof -** Per-user accumulation of resource consumption. -** Possibility to send signal to process. -** -** Revision 1.35 2004/12/14 15:06:41 gerlof -** Implementation of patch-recognition for disk and network-statistics. -** -** Revision 1.34 2004/09/27 11:01:13 gerlof -** Corrected usage-info as suggested by Edelhard Becker. -** -** Revision 1.33 2004/09/13 09:19:14 gerlof -** Modify subcommands (former 's' -> 'v', 'v' -> 'V', new 's'). -** -** Revision 1.32 2004/08/31 09:52:47 root -** information about underlying threads. -** -** Revision 1.31 2004/06/01 11:57:58 gerlof -** Regular expressions for selections on process-name and user-name. -** -** Revision 1.30 2003/07/07 09:27:24 gerlof -** Cleanup code (-Wall proof). -** -** Revision 1.29 2003/07/03 11:16:42 gerlof -** Implemented subcommand `r' (reset). -** -** Revision 1.28 2003/06/30 11:29:49 gerlof -** Handle configuration file ~/.atoprc -** -** Revision 1.27 2003/06/24 06:21:57 gerlof -** Limit number of system resource lines. -** -** Revision 1.26 2003/02/07 10:19:18 gerlof -** Possibility to show the version number and date. -** -** Revision 1.25 2003/01/17 07:32:16 gerlof -** Show the full command-line per process (option 'c'). -** -** Revision 1.24 2002/10/30 13:47:20 gerlof -** Generate notification for statistics since boot. -** -** Revision 1.23 2002/10/08 12:00:30 gerlof -** *** empty log message *** -** -** Revision 1.22 2002/09/26 14:17:39 gerlof -** No beep when resizing the window. -** -** Revision 1.21 2002/09/26 13:52:26 gerlof -** Limit header lines by not showing disks. -** -** Revision 1.20 2002/09/18 07:15:59 gerlof -** Modified viewflag to rawreadflag. -** -** Revision 1.19 2002/09/17 13:17:39 gerlof -** Allow key 'T' to be pressed to view previous sample in raw file. -** -** Revision 1.18 2002/08/30 07:11:50 gerlof -** Minor changes to support viewing of raw atop data. -** -** Revision 1.17 2002/08/27 12:10:12 gerlof -** Allow raw data file to be written and to be read (with compression). -** -** Revision 1.16 2002/07/24 11:12:46 gerlof -** Changed to ease porting to other UNIX-platforms. -** -** Revision 1.15 2002/07/11 09:12:05 root -** Some minor updates. -** -** Revision 1.14 2002/07/10 05:00:37 root -** Counters pin/pout renamed to swin/swout (Linux conventions). -** -** Revision 1.13 2002/07/08 09:29:49 root -** Limitation for username and groupname (8 characters truncate). -** -** Revision 1.12 2002/07/02 07:14:02 gerlof -** More positions for the name of the disk-unit in the DSK-line. -** -** Revision 1.11 2002/01/22 13:40:42 gerlof -** Support for number of cpu's. -** Check if the window is large enough for the system-statistics. -** -** Revision 1.10 2001/11/30 09:09:36 gerlof -** Cosmetic chnage. -** -** Revision 1.9 2001/11/29 10:41:44 gerlof -** *** empty log message *** -** -** Revision 1.8 2001/11/29 10:38:16 gerlof -** Exit-code correctly printed. -** -** Revision 1.7 2001/11/26 11:18:45 gerlof -** Modified generic output in case that the kernel-patch is not installed. -** -** Revision 1.6 2001/11/13 08:24:50 gerlof -** Show blank columns for sockets and disk I/O when no kernel-patch installed. -** -** Revision 1.5 2001/11/07 09:19:28 gerlof -** Use /proc instead of /dev/kmem for process-level statistics. -** -** Revision 1.4 2001/10/05 13:46:32 gerlof -** Implemented paging through the process-list -** -** Revision 1.3 2001/10/04 08:47:27 gerlof -** Improved handling of error-messages -** -** Revision 1.2 2001/10/03 08:57:53 gerlof -** Improved help-screen shown in scrollable window -** -** Revision 1.1 2001/10/02 10:43:34 gerlof -** Initial revision -** */ #include @@ -260,19 +35,20 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include #include #include #include +#include #include "atop.h" #include "photoproc.h" @@ -280,8 +56,10 @@ #include "showgeneric.h" #include "showlinux.h" +int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); + static struct pselection procsel = {"", {USERSTUB, }, {0,}, - "", 0, { 0, }, "", 0, { 0, } }; + "", 0, { 0, }, "", 0, { 0, }, "", "" }; static struct sselection syssel; static void showhelp(int); @@ -304,6 +82,7 @@ static int maxifblines = 999; /* maximum infinibnd lines */ static int maxnfslines = 999; /* maximum nfs mount lines */ static int maxcontlines = 999; /* maximum container lines */ +static int maxnumalines = 999; /* maximum numa lines */ static short colorinfo = COLOR_GREEN; static short coloralmost = COLOR_CYAN; @@ -477,6 +256,14 @@ if (sstat->cfs.nrcontainer > 1 && maxcontlines > 0) qsort(sstat->cfs.cont, sstat->cfs.nrcontainer, sizeof sstat->cfs.cont[0], contcompar); + + if (sstat->memnuma.nrnuma > 1 && maxnumalines > 0) + qsort(sstat->memnuma.numa, sstat->memnuma.nrnuma, + sizeof sstat->memnuma.numa[0], memnumacompar); + + if (sstat->cpunuma.nrnuma > 1 && maxnumalines > 0) + qsort(sstat->cpunuma.numa, sstat->cpunuma.nrnuma, + sizeof sstat->cpunuma.numa[0], cpunumacompar); } /* @@ -507,11 +294,11 @@ int seclen = val2elapstr(nsecs, buf); int lenavail = (screen ? COLS : linelen) - - 51 - seclen - utsnodenamelen; + 52 - seclen - utsnodenamelen; int len1 = lenavail / 3; int len2 = lenavail - len1 - len1; - printg("ATOP - %s%*s%s %s%*s%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%" + printg("ATOP - %s%*s%s %s%*s%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%" "*s%s elapsed", utsname.nodename, len1, "", format1, format2, len1, "", @@ -530,6 +317,7 @@ procsel.container[0] ? MSELCONT : '-', procsel.pid[0] != 0 ? MSELPID : '-', procsel.argnamesz ? MSELARG : '-', + procsel.states[0] ? MSELSTATE : '-', syssel.lvmnamesz + syssel.dsknamesz + syssel.itfnamesz ? MSELSYS : '-', @@ -569,7 +357,7 @@ maxcpulines, maxgpulines, maxdsklines, maxmddlines, maxlvmlines, maxintlines, maxifblines, maxnfslines, - maxcontlines); + maxcontlines, maxnumalines); /* ** if system-wide statistics do not fit, @@ -592,7 +380,7 @@ maxdsklines, maxmddlines, maxlvmlines, maxintlines, maxifblines, maxnfslines, - maxcontlines); + maxcontlines, maxnumalines); /* ** if system-wide statistics still do not fit, @@ -644,6 +432,29 @@ { if (flag&RRBOOT) { + char *initmsg = "*** System and Process Activity since Boot ***"; + char *viewmsg; + + if (rawreadflag) + { + viewmsg = "Rawfile view"; + } + else + { + uid_t ruid, euid, suid; + + getresuid(&ruid, &euid, &suid); + + if (suid == 0) + { + viewmsg = "Unrestricted view (privileged)"; + } + else + { + viewmsg = "Restricted view (unprivileged)"; + } + } + if (screen) { if (usecolors) @@ -651,15 +462,15 @@ attron(A_BLINK); - printg("%*s", (COLS-45)/2, " "); + printg("%*s", + (COLS-strlen(initmsg)-strlen(viewmsg)-5)/2, " "); } else { - printg(" "); + printg(" "); } - printg("*** system and process activity " - "since boot ***"); + printg(initmsg); if (screen) { @@ -667,6 +478,26 @@ attroff(COLOR_PAIR(COLORINFO)); attroff(A_BLINK); } + + printg(" "); + + if (screen) + { + if (usecolors) + attron(COLOR_PAIR(COLORALMOST)); + + attron(A_BLINK); + } + + printg(viewmsg); + + if (screen) + { + if (usecolors) + attroff(COLOR_PAIR(COLORALMOST)); + attroff(A_BLINK); + } + } } @@ -827,6 +658,7 @@ if ( procsel.userid[0] == USERSTUB && !procsel.prognamesz && !procsel.container[0] && + !procsel.states[0] && !procsel.argnamesz && !procsel.pid[0] && !suppressexit ) @@ -1003,7 +835,8 @@ priphead(firstproc/plistsz+1, (ncurlist-1)/plistsz+1, &showtype, &curorder, - showorder == MSORTAUTO ? 1 : 0); + showorder == MSORTAUTO ? 1 : 0, + sstat->cpu.nrcpu); if (screen) { @@ -1748,6 +1581,81 @@ firstproc = 0; break; + /* + ** focus on specific process/thread state + */ + case MSELSTATE: + alarm(0); /* stop the clock */ + echo(); + + move(statline, 0); + clrtoeol(); + + /* Linux fs/proc/array.c - task_state_array */ + printw("Comma-separated process/thread states " + "(R|S|D|I|T|t|X|Z|P): "); + + memset(procsel.states, 0, sizeof procsel.states); + + scanw("%15s\n", genline); + + char *sp = strtok(genline, ","); + + while (sp && *sp) + { + if (isspace(*sp)) + { + sp++; + continue; + } + + if (strlen(sp) > 1) + { + statmsg = "Invalid state!"; + memset(procsel.states, 0, + sizeof procsel.states); + break; + } + + int needed = 0; + + switch (*sp) + { + case 'R': /* running */ + case 'S': /* sleeping */ + case 'D': /* disk sleep */ + case 'I': /* idle */ + case 'T': /* stopped */ + case 't': /* tracing stop */ + case 'X': /* dead */ + case 'Z': /* zombie */ + case 'P': /* parked */ + if (!strchr(procsel.states, *sp)) + needed = 1; + break; + default: + statmsg = "Invalid state!"; + memset(procsel.states, + 0, sizeof procsel.states); + beep(); + break; + } + + if (needed) + procsel.states[strlen(procsel.states)] = *sp; + + sp = strtok(NULL, ","); + } + + noecho(); + + move(statline, 0); + + if (interval && !paused && !rawreadflag) + alarm(3); /* set short timer */ + + firstproc = 0; + break; /* ** focus on specific command line arguments @@ -2153,6 +2061,11 @@ "statistics (now %d): ", maxcontlines, statline); + maxnumalines = + getnumval("Maximum lines for numa " + "statistics (now %d): ", + maxnumalines, statline); + if (interval && !paused && !rawreadflag) alarm(3); /* set short timer */ @@ -2591,6 +2504,15 @@ } } + /* + ** check if only processes in specific states should be shown + */ + if (sel->states[0]) + { + if (strchr(sel->states, curstat->gen.state) == NULL) + return 1; + } + return 0; } @@ -2624,6 +2546,9 @@ if (maxcontlines == 999) // default? maxcontlines = 1; + + if (maxnumalines == 999) // default? + maxnumalines = 0; } /* @@ -2682,7 +2607,7 @@ va_start(args, format); if (screen) - vwprintw(stdscr, (char *) format, args); + vw_printw(stdscr, (char *) format, args); else vprintf(format, args); @@ -2983,10 +2908,11 @@ "(regular expression)\n", MSELUSER}, {"\t'%c' - focus on specific program name " "(regular expression)\n", MSELPROC}, - {"\t'%c' - focus on specific contained id (CID)\n", MSELCONT}, + {"\t'%c' - focus on specific container id (CID)\n", MSELCONT}, {"\t'%c' - focus on specific command line string " "(regular expression)\n", MSELARG}, {"\t'%c' - focus on specific process id (PID)\n", MSELPID}, + {"\t'%c' - focus on specific process/thread state(s)\n", MSELSTATE}, {"\n", ' '}, {"System resource selections (keys shown in header line):\n",' '}, {"\t'%c' - focus on specific system resources " @@ -3327,6 +3253,11 @@ maxcontlines = get_posval(name, val); } +void +do_maxnuma(char *name, char *val) +{ + maxnumalines = get_posval(name, val); +} struct colmap { char *colname; diff -Nru atop-2.6.0/showgeneric.h atop-2.7.1/showgeneric.h --- atop-2.6.0/showgeneric.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/showgeneric.h 2022-01-08 11:49:00.000000000 +0000 @@ -33,6 +33,8 @@ count_t availnet; int nrgpu; count_t availgpumem; // GPU memory in Kb! + int nrmemnuma; + int nrcpunuma; }; struct pselection { @@ -50,6 +52,8 @@ regex_t argregex; char container[16]; + + char states[16]; }; struct sselection { @@ -107,12 +111,14 @@ #define MSYSFIXED 'f' #define MSYSNOSORT 'F' #define MSYSLIMIT 'l' +#define MRMSPACES 'Z' #define MSELUSER 'U' #define MSELPROC 'P' #define MSELCONT 'J' #define MSELPID 'I' #define MSELARG '/' +#define MSELSTATE 'Q' #define MSELSYS 'S' #define MALLPROC 'a' @@ -150,7 +156,7 @@ void printg (const char *, ...); int prisyst(struct sstat *, int, int, int, int, struct sselection *, - char *, int, int, int, int, int, int, int, int, int); + char *, int, int, int, int, int, int, int, int, int, int); int priproc(struct tstat **, int, int, int, int, int, char, char, struct syscap *, int, int); -void priphead(int, int, char *, char *, char); +void priphead(int, int, char *, char *, char, count_t); diff -Nru atop-2.6.0/showlinux.c atop-2.7.1/showlinux.c --- atop-2.6.0/showlinux.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/showlinux.c 2022-01-08 11:49:00.000000000 +0000 @@ -390,14 +390,19 @@ &syspdef_BLANKBOX, &syspdef_HUPTOT, &syspdef_HUPUSE, + &syspdef_NUMNUMA, 0 }; sys_printdef *swpsyspdefs[] = { &syspdef_SWPTOT, &syspdef_SWPFREE, - &syspdef_BLANKBOX, &syspdef_SWPCACHE, &syspdef_BLANKBOX, + &syspdef_ZSWTOTAL, + &syspdef_ZSWSTORED, + &syspdef_KSMSHARING, + &syspdef_KSMSHARED, + &syspdef_BLANKBOX, &syspdef_SWPCOMMITTED, &syspdef_SWPCOMMITLIM, &syspdef_BLANKBOX, @@ -407,11 +412,43 @@ &syspdef_PAGSCAN, &syspdef_PAGSTEAL, &syspdef_PAGSTALL, + &syspdef_PAGCOMPACT, + &syspdef_PGMIGRATE, + &syspdef_NUMAMIGRATE, &syspdef_PAGSWIN, &syspdef_PAGSWOUT, + &syspdef_OOMKILLS, &syspdef_BLANKBOX, 0 }; +sys_printdef *memnumasyspdefs[] = { + &syspdef_NUMATOT, + &syspdef_NUMAFREE, + &syspdef_NUMAFILEPAGE, + &syspdef_NUMANR, + &syspdef_NUMADIRTY, + &syspdef_NUMAACTIVE, + &syspdef_NUMAINACTIVE, + &syspdef_NUMASLAB, + &syspdef_NUMASLABRECLAIM, + &syspdef_NUMASHMEM, + &syspdef_NUMAFRAG, + &syspdef_NUMAHUPTOT, + 0 +}; +sys_printdef *cpunumasyspdefs[] = { + &syspdef_NUMACPUSYS, + &syspdef_NUMACPUUSER, + &syspdef_NUMACPUNICE, + &syspdef_NUMACPUIRQ, + &syspdef_NUMACPUSOFTIRQ, + &syspdef_NUMACPUIDLE, + &syspdef_NUMACPUWAIT, + &syspdef_NUMACPUSTEAL, + &syspdef_NUMACPUGUEST, + &syspdef_NUMANUMCPU, + 0 +}; sys_printdef *psisyspdefs[] = { &syspdef_PSICPUSTOT, &syspdef_PSIMEMSTOT, @@ -439,10 +476,12 @@ &syspdef_DSKBUSY, &syspdef_DSKNREAD, &syspdef_DSKNWRITE, + &syspdef_DSKNDISC, &syspdef_DSKMBPERSECWR, &syspdef_DSKMBPERSECRD, - &syspdef_DSKKBPERWR, &syspdef_DSKKBPERRD, + &syspdef_DSKKBPERWR, + &syspdef_DSKKBPERDS, &syspdef_DSKAVQUEUE, &syspdef_DSKAVIO, &syspdef_BLANKBOX, @@ -669,6 +708,8 @@ sys_printpair gpuline[MAXITEMS]; sys_printpair memline[MAXITEMS]; sys_printpair swpline[MAXITEMS]; +sys_printpair memnumaline[MAXITEMS]; +sys_printpair cpunumaline[MAXITEMS]; sys_printpair pagline[MAXITEMS]; sys_printpair psiline[MAXITEMS]; sys_printpair contline[MAXITEMS]; @@ -758,39 +799,53 @@ * make_sys_prints: make array of sys_printpairs * input: string, sys_printpair array, maxentries */ -void +static void make_sys_prints(sys_printpair *ar, int maxn, const char *pairs, - sys_printdef *permissables[], const char *linename) + sys_printdef *permissables[], const char *linename, + struct sstat *sstat, extraparam *extra) { - name_prio items[MAXITEMS]; - int n=strlen(pairs); + name_prio items[MAXITEMS]; + int i, a, n=strlen(pairs); + char str[n+1]; - char str[n+1]; strcpy(str, pairs); makeargv(str, linename, items); - int i; - for(i=0; items[i].name && iconfigname, name)==0) + if (strcmp(permissables[j]->configname, name) == 0) { - ar[i].f=permissables[j]; - ar[i].prio=items[i].prio; + // call validate function to see if this + // counter is relevant + // + if (sstat != NULL && + permissables[j]->dovalidate != NULL && + permissables[j]->dovalidate(sstat) == 0) + break; + + ar[a].f = permissables[j]; + ar[a].prio = items[i].prio; + a++; break; } } + if (permissables[j]==0) + { mcleanstop(1, "atoprc - own system line: item %s invalid in %s line\n", name, linename); + } } - ar[i].f=0; - ar[i].prio=0; + + ar[a].f=0; + ar[a].prio=0; } @@ -799,8 +854,8 @@ * init_proc_prints: determine width of columns that are * dependent of dynamic values */ -void -init_proc_prints() +static void +init_proc_prints(count_t numcpu) { int i, numdigits = 5; char linebuf[64]; @@ -837,6 +892,15 @@ idprocpdefs[i]->head = p; } } + + /* + ** fill number of positions for the SORTITEM (percentage), + ** depending on the number of CPUs (e.g. with 10+ CPUs a process + ** can reach a CPU percentage of 1000% and with 100+ CPUs a + ** CPU percentage of 10000%). + */ + procprt_SORTITEM.width = + snprintf(linebuf, sizeof linebuf, "%lld", numcpu*100) + 1; } /* @@ -931,17 +995,41 @@ psc->availgpumem += sstat->gpu.gpu[i].memtotnow; psc->nrgpu = sstat->gpu.nrgpus; + + psc->nrmemnuma = sstat->memnuma.nrnuma; + psc->nrcpunuma = sstat->cpunuma.nrnuma; } /* ** calculate cumulative system- and user-time for all active processes +** besides, initialize all counter lines on system level */ void pricumproc(struct sstat *sstat, struct devtstat *devtstat, int nexit, unsigned int noverflow, int avgval, int nsecs) { + static int firsttime=1; + int i; + extraparam extra; - static int firsttime=1; + for (i=0, extra.totut=extra.totst=0; i < devtstat->nprocactive; i++) + { + struct tstat *curstat = *(devtstat->procactive+i); + + extra.totut += curstat->cpu.utime; + extra.totst += curstat->cpu.stime; + } + + extra.nproc = devtstat->nprocall; + extra.ntrun = devtstat->totrun; + extra.ntslpi = devtstat->totslpi; + extra.ntslpu = devtstat->totslpu; + extra.nzomb = devtstat->totzombie; + extra.nexit = nexit; + extra.noverflow = noverflow; + extra.avgval = avgval; + extra.nsecs = nsecs; + extra.index = 0; if (firsttime) { @@ -960,8 +1048,11 @@ "PRCNZOMBIE:5 " "PRCCLONES:4 " "BLANKBOX:0 " - "PRCNNEXIT:6", prcsyspdefs, "builtin sysprcline"); + "PRCNNEXIT:6", + prcsyspdefs, "builtin sysprcline", + sstat, &extra); } + if (allcpuline[0].f == 0) { make_sys_prints(allcpuline, MAXITEMS, @@ -977,7 +1068,9 @@ "CPUIPC:5 " "CPUCYCLE:4 " "CPUFREQ:4 " - "CPUSCALE:4 ", cpusyspdefs, "builtin allcpuline"); + "CPUSCALE:4 ", + cpusyspdefs, "builtin allcpuline", + sstat, &extra); } if (indivcpuline[0].f == 0) @@ -995,7 +1088,9 @@ "CPUIIPC:5 " "CPUICYCLE:4 " "CPUIFREQ:4 " - "CPUISCALE:4 ", cpisyspdefs, "builtin indivcpuline"); + "CPUISCALE:4 ", + cpisyspdefs, "builtin indivcpuline", + sstat, &extra); } if (cplline[0].f == 0) @@ -1008,7 +1103,9 @@ "CPLCSW:6 " "CPLINTR:5 " "BLANKBOX:0 " - "CPLNUMCPU:1", cplsyspdefs, "builtin cplline"); + "CPLNUMCPU:1", + cplsyspdefs, "builtin cplline", + sstat, &extra); } if (gpuline[0].f == 0) @@ -1023,7 +1120,9 @@ "GPUMEMAVG:2 " "GPUNRPROC:2 " "BLANKBOX:0 " - "GPUTYPE:1 ", gpusyspdefs, "builtin gpuline"); + "GPUTYPE:1 ", + gpusyspdefs, "builtin gpuline", + NULL, NULL); } if (memline[0].f == 0) @@ -1046,35 +1145,86 @@ "ZFSARC:6 " "BLANKBOX:0 " "HUPTOT:6 " - "HUPUSE:3 ", memsyspdefs, "builtin memline"); + "HUPUSE:3 " + "NUMNUMA:7 ", + memsyspdefs, "builtin memline", + sstat, &extra); } + if (swpline[0].f == 0) { make_sys_prints(swpline, MAXITEMS, - "SWPTOT:3 " - "SWPFREE:4 " - "BLANKBOX:0 " - "BLANKBOX:0 " - "SWPCACHE:2 " - "BLANKBOX:0 " - "BLANKBOX:0 " - "SWPCOMMITTED:5 " - "SWPCOMMITLIM:6", swpsyspdefs, "builtin swpline"); + "SWPTOT:5 " + "SWPFREE:6 " + "SWPCACHE:4 " + "BLANKBOX:0 " + "ZSWTOTAL:3 " + "ZSWSTORED:3 " + "BLANKBOX:0 " + "KSMSHARED:2 " + "KSMSHARING:2 " + "BLANKBOX:0 " + "SWPCOMMITTED:7 " + "SWPCOMMITLIM:8", + swpsyspdefs, "builtin swpline", + sstat, &extra); + } + + if (memnumaline[0].f == 0) + { + make_sys_prints(memnumaline, MAXITEMS, + "NUMATOT:8 " + "NUMAFREE:9 " + "NUMAFILEPAGE:9 " + "NUMANR:7 " + "NUMADIRTY:5 " + "NUMAACTIVE:5 " + "NUMAINACTIVE:5 " + "NUMASLAB:7 " + "NUMASLABRECLAIM:4 " + "NUMASHMEM:4 " + "NUMAFRAG:6 " + "NUMAHUPTOT:3 ", + memnumasyspdefs, "builtin memnumaline", + sstat, &extra); + } + + if (cpunumaline[0].f == 0) + { + make_sys_prints(cpunumaline, MAXITEMS, + "NUMACPUSYS:9 " + "NUMACPUUSER:8 " + "NUMACPUNICE:8 " + "NUMACPUIRQ:6 " + "NUMACPUSOFTIRQ:6 " + "NUMACPUIDLE:7 " + "NUMACPUWAIT:7 " + "NUMACPUSTEAL:2 " + "NUMACPUGUEST:3 " + "NUMANUMCPU:5", + cpunumasyspdefs, "builtin cpunumaline", + NULL, NULL); } + if (pagline[0].f == 0) { make_sys_prints(pagline, MAXITEMS, "PAGSCAN:3 " - "PAGSTEAL:3 " + "PAGSTEAL:2 " "PAGSTALL:1 " + "PAGCOMPACT:5 " + "NUMAMIGRATE:5" + "PGMIGRATE:6" "BLANKBOX:0 " "BLANKBOX:0 " "BLANKBOX:0 " - "BLANKBOX:0 " - "BLANKBOX:0 " - "PAGSWIN:3 " - "PAGSWOUT:4", pagsyspdefs, "builtin pagline"); + "PAGSWIN:5 " + "PAGSWOUT:7 " + "OOMKILLS:8 ", + pagsyspdefs, "builtin pagline", + sstat, &extra); } + if (psiline[0].f == 0) { make_sys_prints(psiline, MAXITEMS, @@ -1088,8 +1238,11 @@ "PSIMEMF:3 " "PSIIOS:4 " "PSIIOF:2 " - "BLANKBOX:0 ", psisyspdefs, "builtin psiline"); + "BLANKBOX:0 ", + psisyspdefs, "builtin psiline", + sstat, &extra); } + if (contline[0].f == 0) { make_sys_prints(contline, MAXITEMS, @@ -1098,22 +1251,30 @@ "CONTCPU:6 " "CONTMEM:6 " "BLANKBOX:0 " - "BLANKBOX:0 ", contsyspdefs, "builtin contline"); + "BLANKBOX:0 ", + contsyspdefs, "builtin contline", + NULL, NULL); } + if (dskline[0].f == 0) { make_sys_prints(dskline, MAXITEMS, - "DSKNAME:8 " - "DSKBUSY:7 " - "DSKNREAD:6 " - "DSKNWRITE:6 " - "DSKKBPERRD:4 " - "DSKKBPERWR:4 " - "DSKMBPERSECRD:5 " - "DSKMBPERSECWR:5 " + "DSKNAME:9 " + "DSKBUSY:8 " + "DSKNREAD:7 " + "DSKNWRITE:7 " + "DSKNDISC:6 " + "DSKKBPERRD:5 " + "DSKKBPERWR:5 " + "DSKKBPERDS:4 " + "DSKMBPERSECRD:6 " + "DSKMBPERSECWR:6 " "DSKAVQUEUE:1 " - "DSKAVIO:5", dsksyspdefs, "builtin dskline"); + "DSKAVIO:6", + dsksyspdefs, "builtin dskline", + sstat, &extra); } + if (nfsmountline[0].f == 0) { make_sys_prints(nfsmountline, MAXITEMS, @@ -1131,8 +1292,11 @@ "NFMMREAD:3 " "NFMMWRITE:2 " "BLANKBOX:0 " - "BLANKBOX:0", nfsmntsyspdefs, "builtin nfsmountline"); + "BLANKBOX:0", + nfsmntsyspdefs, "builtin nfsmountline", + NULL, NULL); } + if (nfcline[0].f == 0) { make_sys_prints(nfcline, MAXITEMS, @@ -1145,8 +1309,11 @@ "BLANKBOX:0 " "BLANKBOX:0 " "BLANKBOX:0 " - "BLANKBOX:0 ", nfcsyspdefs, "builtin nfcline"); + "BLANKBOX:0 ", + nfcsyspdefs, "builtin nfcline", + sstat, &extra); } + if (nfsline[0].f == 0) { make_sys_prints(nfsline, MAXITEMS, @@ -1166,8 +1333,11 @@ "BLANKBOX:0 " "NFSBADFMT:4 " "NFSBADAUT:4 " - "NFSBADCLN:4 ", nfssyspdefs, "builtin nfsline"); + "NFSBADCLN:4 ", + nfssyspdefs, "builtin nfsline", + sstat, &extra); } + if (nettransportline[0].f == 0) { make_sys_prints(nettransportline, MAXITEMS, @@ -1182,8 +1352,11 @@ "NETTCPINERR:3 " "NETTCPORESET:2 " "NETUDPNOPORT:1 " - "NETUDPINERR:3", nettranssyspdefs, "builtin nettransportline"); + "NETUDPINERR:3", + nettranssyspdefs, "builtin nettransportline", + sstat, &extra); } + if (netnetline[0].f == 0) { make_sys_prints(netnetline, MAXITEMS, @@ -1196,8 +1369,11 @@ "BLANKBOX:0 " "BLANKBOX:0 " "NETICMPIN:1 " - "NETICMPOUT:1 ", netnetsyspdefs, "builtin netnetline"); + "NETICMPOUT:1 ", + netnetsyspdefs, "builtin netnetline", + sstat, &extra); } + if (netinterfaceline[0].f == 0) { make_sys_prints(netinterfaceline, MAXITEMS, @@ -1215,8 +1391,11 @@ "NETRCVERR:4 " "NETSNDERR:4 " "NETRCVDROP:3 " - "NETSNDDROP:3", netintfsyspdefs, "builtin netinterfaceline"); + "NETSNDDROP:3", + netintfsyspdefs, "builtin netinterfaceline", + NULL, NULL); } + if (infinibandline[0].f == 0) { make_sys_prints(infinibandline, MAXITEMS, @@ -1234,33 +1413,12 @@ "BLANKBOX:0 " "BLANKBOX:0 " "BLANKBOX:0 " - "BLANKBOX:0 ", infinisyspdefs, "builtin infinibandline"); + "BLANKBOX:0 ", + infinisyspdefs, "builtin infinibandline", + NULL, NULL); } } // firsttime - - int i; - extraparam extra; - - - for (i=0, extra.totut=extra.totst=0; i < devtstat->nprocactive; i++) - { - struct tstat *curstat = *(devtstat->procactive+i); - - extra.totut += curstat->cpu.utime; - extra.totst += curstat->cpu.stime; - } - - extra.nproc = devtstat->nprocall; - extra.ntrun = devtstat->totrun; - extra.ntslpi = devtstat->totslpi; - extra.ntslpu = devtstat->totslpu; - extra.nzomb = devtstat->totzombie; - extra.nexit = nexit; - extra.noverflow = noverflow; - extra.avgval = avgval; - extra.nsecs = nsecs; - move(1, 0); showsysline(sysprcline, sstat, &extra, "PRC", 0); } @@ -1270,7 +1428,7 @@ */ void priphead(int curlist, int totlist, char *showtype, char *showorder, - char autosort) + char autosort, count_t numcpu) { static int firsttime=1; static int prev_supportflags = -1, prev_threadview = -1; @@ -1281,7 +1439,7 @@ */ if (firsttime) { - init_proc_prints(); + init_proc_prints(numcpu); make_proc_prints(memprocs, MAXITEMS, "PID:10 TID:3 MINFLT:2 MAJFLT:2 VSTEXT:4 VSLIBS:4 " @@ -1677,7 +1835,7 @@ int fixedhead, struct sselection *selp, char *highorderp, int maxcpulines, int maxgpulines, int maxdsklines, int maxmddlines, int maxlvmlines, int maxintlines, int maxifblines, - int maxnfslines, int maxcontlines) + int maxnfslines, int maxcontlines, int maxnumalines) { extraparam extra; int lin; @@ -1896,15 +2054,112 @@ showsysline(swpline, sstat, &extra, "SWP", badness); curline++; + /* + ** memory info related for per NUMA + */ + if (sstat->memnuma.nrnuma > 1) + { + for (extra.index=lin=0; + extra.index < sstat->memnuma.nrnuma && lin < maxnumalines; + extra.index++) + { + busy = (sstat->memnuma.numa[extra.index].totmem + - sstat->memnuma.numa[extra.index].freemem + - sstat->memnuma.numa[extra.index].filepage + - sstat->memnuma.numa[extra.index].slabreclaim + + sstat->memnuma.numa[extra.index].shmem) + * 100.0 / sstat->memnuma.numa[extra.index].totmem; + + if (membadness) + badness = busy * 100 / membadness; + else + badness = 0; + + if (highbadness < badness) + { + highbadness = badness; + *highorderp = MSORTMEM; + } + + if (screen) + move(curline, 0); + + showsysline(memnumaline, sstat, &extra, "NUM", badness); + curline++; + lin++; + } + } + + /* + ** Accumulate each cpu statistic for per NUMA + */ + if (sstat->cpunuma.nrnuma > 1) + { + for (extra.index=lin=0; + extra.index < sstat->cpunuma.nrnuma && lin < maxnumalines; + extra.index++) + { + extra.pernumacputot = sstat->cpunuma.numa[extra.index].stime + + sstat->cpunuma.numa[extra.index].utime + + sstat->cpunuma.numa[extra.index].ntime + + sstat->cpunuma.numa[extra.index].itime + + sstat->cpunuma.numa[extra.index].wtime + + sstat->cpunuma.numa[extra.index].Itime + + sstat->cpunuma.numa[extra.index].Stime + + sstat->cpunuma.numa[extra.index].steal; + + if (extra.pernumacputot == + (sstat->cpunuma.numa[extra.index].itime + + sstat->cpunuma.numa[extra.index].wtime ) && + !fixedhead ) + continue; /* inactive cpu */ + + if (extra.pernumacputot == 0) + extra.pernumacputot = 1; /* avoid divide-by-zero */ + + busy = (extra.pernumacputot - + sstat->cpunuma.numa[extra.index].itime - + sstat->cpunuma.numa[extra.index].wtime) + * 100.0 / extra.pernumacputot; + + if (cpubadness) + badness = busy * 100 / cpubadness; + else + badness = 0; + + if (highbadness < badness) + { + highbadness = badness; + *highorderp = MSORTCPU; + } + + extra.percputot = extra.pernumacputot / + (sstat->cpu.nrcpu/sstat->cpunuma.nrnuma); + if (extra.percputot == 0) + extra.percputot = 1; /* avoid divide-by-zero */ + + if (screen) + move(curline, 0); + + showsysline(cpunumaline, sstat, &extra, "NUC", badness); + curline++; + lin++; + } + } + /* ** PAGING statistics */ - if (fixedhead || - sstat->mem.pgscans || - sstat->mem.pgsteal || - sstat->mem.allocstall || - sstat->mem.swins || - sstat->mem.swouts ) + if (fixedhead || + sstat->mem.pgscans || + sstat->mem.pgsteal || + sstat->mem.allocstall || + sstat->mem.compactstall || + sstat->mem.swins || + sstat->mem.swouts || + sstat->mem.oomkills > 0 || + sstat->mem.pgmigrate || + sstat->mem.numamigrate ) { busy = sstat->mem.swouts / nsecs * pagbadness; @@ -1933,7 +2188,7 @@ if (screen) move(curline, 0); - showsysline(pagline, sstat, &extra,"PAG", badness); + showsysline(pagline, sstat, &extra, "PAG", badness); curline++; } @@ -2638,6 +2893,40 @@ return 0; } +int +memnumacompar(const void *a, const void *b) +{ + register count_t aused = ((struct mempernuma *)a)->totmem - + ((struct mempernuma *)a)->freemem; + register count_t bused = ((struct mempernuma *)b)->totmem - + ((struct mempernuma *)b)->freemem; + + if (aused < bused) + return 1; + + if (aused > bused) + return -1; + + return 0; +} + +int +cpunumacompar(const void *a, const void *b) +{ + register count_t aidle = ((struct cpupernuma *)a)->itime + + ((struct cpupernuma *)a)->wtime; + register count_t bidle = ((struct cpupernuma *)b)->itime + + ((struct cpupernuma *)b)->wtime; + + if (aidle < bidle) + return -1; + + if (aidle > bidle) + return 1; + + return 0; +} + /* ** handle modifications from the /etc/atoprc and ~/.atoprc file */ @@ -2730,79 +3019,106 @@ void do_ownsysprcline(char *name, char *val) { - make_sys_prints(sysprcline, MAXITEMS, val, prcsyspdefs, name); + make_sys_prints(sysprcline, MAXITEMS, val, prcsyspdefs, name, + NULL, NULL); } void do_ownallcpuline(char *name, char *val) { - make_sys_prints(allcpuline, MAXITEMS, val, cpusyspdefs, name); + make_sys_prints(allcpuline, MAXITEMS, val, cpusyspdefs, name, + NULL, NULL); } void do_ownindivcpuline(char *name, char *val) { - make_sys_prints(indivcpuline, MAXITEMS, val, cpisyspdefs, name); + make_sys_prints(indivcpuline, MAXITEMS, val, cpisyspdefs, name, + NULL, NULL); } void do_owncplline(char *name, char *val) { - make_sys_prints(cplline, MAXITEMS, val, cplsyspdefs, name); + make_sys_prints(cplline, MAXITEMS, val, cplsyspdefs, name, + NULL, NULL); } void do_owngpuline(char *name, char *val) { - make_sys_prints(gpuline, MAXITEMS, val, gpusyspdefs, name); + make_sys_prints(gpuline, MAXITEMS, val, gpusyspdefs, name, + NULL, NULL); } void do_ownmemline(char *name, char *val) { - make_sys_prints(memline, MAXITEMS, val, memsyspdefs, name); + make_sys_prints(memline, MAXITEMS, val, memsyspdefs, name, + NULL, NULL); } void do_ownswpline(char *name, char *val) { - make_sys_prints(swpline, MAXITEMS, val, swpsyspdefs, name); + make_sys_prints(swpline, MAXITEMS, val, swpsyspdefs, name, + NULL, NULL); } void do_ownpagline(char *name, char *val) { - make_sys_prints(pagline, MAXITEMS, val, pagsyspdefs, name); + make_sys_prints(pagline, MAXITEMS, val, pagsyspdefs, name, + NULL, NULL); +} + +void +do_ownmemnumaline(char *name, char *val) +{ + make_sys_prints(memnumaline, MAXITEMS, val, memnumasyspdefs, name, + NULL, NULL); +} + +void +do_owncpunumaline(char *name, char *val) +{ + make_sys_prints(cpunumaline, MAXITEMS, val, cpunumasyspdefs, name, + NULL, NULL); } void do_owndskline(char *name, char *val) { - make_sys_prints(dskline, MAXITEMS, val, dsksyspdefs, name); + make_sys_prints(dskline, MAXITEMS, val, dsksyspdefs, name, + NULL, NULL); } void do_ownnettransportline(char *name, char *val) { - make_sys_prints(nettransportline, MAXITEMS, val, nettranssyspdefs, name); + make_sys_prints(nettransportline, MAXITEMS, val, nettranssyspdefs, name, + NULL, NULL); } void do_ownnetnetline(char *name, char *val) { - make_sys_prints(netnetline, MAXITEMS, val, netnetsyspdefs, name); + make_sys_prints(netnetline, MAXITEMS, val, netnetsyspdefs, name, + NULL, NULL); } void do_ownnetinterfaceline(char *name, char *val) { - make_sys_prints(netinterfaceline, MAXITEMS, val, netintfsyspdefs, name); + make_sys_prints(netinterfaceline, MAXITEMS, val, netintfsyspdefs, name, + NULL, NULL); } void do_owninfinibandline(char *name, char *val) { - make_sys_prints(infinibandline, MAXITEMS, val, infinisyspdefs, name); + make_sys_prints(infinibandline, MAXITEMS, val, infinisyspdefs, name, + NULL, NULL); } void diff -Nru atop-2.6.0/showlinux.h atop-2.7.1/showlinux.h --- atop-2.6.0/showlinux.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/showlinux.h 2022-01-08 11:49:00.000000000 +0000 @@ -57,23 +57,33 @@ struct perdsk *perdsk; int index; count_t cputot; + count_t pernumacputot; count_t percputot; } extraparam; -/***************************************************************/ -/* +/*************************************************************** + * * structure for system print-list + * + * configname name as used to identify this field when configuring + * the print line + * doformat pointer to function that formats this field into a + * string of 12 positions, to be returned as char pointer + * dovalidate pointer to function that determines if this is a + * valid (i.e. relevant) field on this system, returning + * 0 (false) or non-zero (true) + * when this function pointer is NULL, true is considered */ typedef struct { - char *configname; // name as used to - // config print line - char* (*doconvert)(void *, void *, int, int *); // ptr to convert func + char *configname; + char* (*doformat)(struct sstat *, extraparam *, int, int *); + int (*dovalidate)(struct sstat *); } sys_printdef; /* * structure for system print-list with priority - * in case of leck of screen space, lowest priority items will be + * in case of lack of screen space, lowest priority items will be * removed first */ typedef struct @@ -125,6 +135,8 @@ extern sys_printdef *memsyspdefs[]; extern sys_printdef *swpsyspdefs[]; extern sys_printdef *pagsyspdefs[]; +extern sys_printdef *numasyspdefs[]; +extern sys_printdef *numacpusyspdefs[]; extern sys_printdef *dsksyspdefs[]; extern sys_printdef *nettranssyspdefs[]; extern sys_printdef *netnetsyspdefs[]; @@ -195,13 +207,44 @@ extern sys_printdef syspdef_SWPTOT; extern sys_printdef syspdef_SWPFREE; extern sys_printdef syspdef_SWPCACHE; +extern sys_printdef syspdef_ZSWTOTAL; +extern sys_printdef syspdef_ZSWSTORED; +extern sys_printdef syspdef_KSMSHARING; +extern sys_printdef syspdef_KSMSHARED; extern sys_printdef syspdef_SWPCOMMITTED; extern sys_printdef syspdef_SWPCOMMITLIM; +extern sys_printdef syspdef_NUMNUMA; +extern sys_printdef syspdef_NUMANR; +extern sys_printdef syspdef_NUMATOT; +extern sys_printdef syspdef_NUMAFREE; +extern sys_printdef syspdef_NUMAFILEPAGE; +extern sys_printdef syspdef_NUMASLAB; +extern sys_printdef syspdef_NUMADIRTY; +extern sys_printdef syspdef_NUMAACTIVE; +extern sys_printdef syspdef_NUMAINACTIVE; +extern sys_printdef syspdef_NUMASHMEM; +extern sys_printdef syspdef_NUMASLABRECLAIM; +extern sys_printdef syspdef_NUMAFRAG; +extern sys_printdef syspdef_NUMAHUPTOT; +extern sys_printdef syspdef_NUMANUMCPU; +extern sys_printdef syspdef_NUMACPUSYS; +extern sys_printdef syspdef_NUMACPUUSER; +extern sys_printdef syspdef_NUMACPUNICE; +extern sys_printdef syspdef_NUMACPUIRQ; +extern sys_printdef syspdef_NUMACPUSOFTIRQ; +extern sys_printdef syspdef_NUMACPUIDLE; +extern sys_printdef syspdef_NUMACPUWAIT; +extern sys_printdef syspdef_NUMACPUSTEAL; +extern sys_printdef syspdef_NUMACPUGUEST; extern sys_printdef syspdef_PAGSCAN; extern sys_printdef syspdef_PAGSTEAL; extern sys_printdef syspdef_PAGSTALL; +extern sys_printdef syspdef_PAGCOMPACT; +extern sys_printdef syspdef_NUMAMIGRATE; +extern sys_printdef syspdef_PGMIGRATE; extern sys_printdef syspdef_PAGSWIN; extern sys_printdef syspdef_PAGSWOUT; +extern sys_printdef syspdef_OOMKILLS; extern sys_printdef syspdef_PSICPUSTOT; extern sys_printdef syspdef_PSIMEMSTOT; extern sys_printdef syspdef_PSIMEMFTOT; @@ -220,10 +263,12 @@ extern sys_printdef syspdef_DSKBUSY; extern sys_printdef syspdef_DSKNREAD; extern sys_printdef syspdef_DSKNWRITE; -extern sys_printdef syspdef_DSKMBPERSECWR; +extern sys_printdef syspdef_DSKNDISC; extern sys_printdef syspdef_DSKMBPERSECRD; -extern sys_printdef syspdef_DSKKBPERWR; +extern sys_printdef syspdef_DSKMBPERSECWR; extern sys_printdef syspdef_DSKKBPERRD; +extern sys_printdef syspdef_DSKKBPERWR; +extern sys_printdef syspdef_DSKKBPERDS; extern sys_printdef syspdef_DSKAVQUEUE; extern sys_printdef syspdef_DSKAVIO; extern sys_printdef syspdef_NETTRANSPORT; diff -Nru atop-2.6.0/showprocs.c atop-2.7.1/showprocs.c --- atop-2.6.0/showprocs.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/showprocs.c 2022-01-08 11:49:00.000000000 +0000 @@ -27,59 +27,6 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** -------------------------------------------------------------------------- -** -** $Log: showprocs.c,v $ -** Revision 1.15 2011/09/05 11:44:16 gerlof -** *** empty log message *** -** -** Revision 1.14 2010/12/01 09:05:38 gerlof -** Added a dash in the column PPID for exited processes. -** -** Revision 1.13 2010/11/12 06:11:58 gerlof -** Sometimes segmentation-fault on particular CPU-types -** due to memcpy i.s.o. memmove when moving memory in overlap. -** -** Revision 1.12 2010/04/23 14:06:42 gerlof -** Added special routined for uid/gid not available for exited processes. -** -** Revision 1.11 2010/01/16 12:54:08 gerlof -** Minor change for CPUNR. -** -** Revision 1.10 2010/01/16 11:37:25 gerlof -** Corrected counters for patched kernels (JC van Winkel). -** -** Revision 1.9 2010/01/08 13:44:47 gerlof -** Added policies batch, iso and idle for scheduling class. -** -** Revision 1.8 2010/01/08 11:25:13 gerlof -** Corrected column-width and priorities of network-stats. -** -** Revision 1.7 2010/01/03 18:26:53 gerlof -** Consistent naming of columns for process-related info. -** -** Revision 1.6 2009/12/19 21:03:21 gerlof -** Alignment of CMD column (JC van Winkel). -** -** Revision 1.5 2009/12/12 10:11:49 gerlof -** Register and display end date and end time for process. -** -** Revision 1.4 2009/12/12 09:05:56 gerlof -** Corrected cumulated disk I/O per user/program (JC van Winkel). -** -** Revision 1.3 2009/12/10 14:01:52 gerlof -** Add EUID, SUID and FSUID (and similar for GID's). -** -** Revision 1.2 2009/12/10 11:56:22 gerlof -** Various bug-solutions. -** -** Revision 1.1 2009/12/10 09:31:23 gerlof -** Initial revision -** -** Initial revision -** -** -** Initial -** */ #include @@ -294,10 +241,13 @@ while ((curelem=*elemptr).f!=0) { + int widen = 0; + if (curelem.f->head==0) // empty header==special: SORTITEM { - chead=columnhead[order]; - autoindic= autosort ? "A" : " "; + chead = columnhead[order]; + autoindic = autosort ? "A" : " "; + widen = procprt_SORTITEM.width-3; } else { @@ -307,8 +257,8 @@ if (screen) { - col += sprintf(buf+col, "%s%s%*s", autoindic, chead, - colspacings[n], ""); + col += sprintf(buf+col, "%*s%s%*s", + widen, autoindic, chead, colspacings[n], ""); } else { @@ -384,7 +334,7 @@ if (curelem.f->head==0) // empty string=sortitem { - printg("%3.0lf%%", perc); // cannot pass perc + printg("%*.0lf%%", procprt_SORTITEM.width-1, perc); } else if (curstat->gen.state != 'E') // active process { @@ -617,7 +567,7 @@ { static char buf[10]; - val2memstr(curstat->mem.vgrow*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.vgrow*1024, buf, BFORMAT, 0, 0); return buf; } @@ -635,7 +585,7 @@ { static char buf[10]; - val2memstr(curstat->mem.rgrow*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.rgrow*1024, buf, BFORMAT, 0, 0); return buf; } @@ -677,7 +627,7 @@ { static char buf[10]; - val2memstr(curstat->mem.vexec*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.vexec*1024, buf, BFORMAT, 0, 0); return buf; } @@ -695,7 +645,7 @@ { static char buf[10]; - val2memstr(curstat->mem.vmem*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.vmem*1024, buf, BFORMAT, 0, 0); return buf; } @@ -713,7 +663,7 @@ { static char buf[10]; - val2memstr(curstat->mem.rmem*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.rmem*1024, buf, BFORMAT, 0, 0); return buf; } @@ -734,7 +684,7 @@ if (curstat->mem.pmem == (unsigned long long)-1LL) return " ?K"; - val2memstr(curstat->mem.pmem*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.pmem*1024, buf, BFORMAT, 0, 0); return buf; } @@ -752,7 +702,7 @@ { static char buf[10]; - val2memstr(curstat->mem.vlibs*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.vlibs*1024, buf, BFORMAT, 0, 0); return buf; } @@ -770,7 +720,7 @@ { static char buf[10]; - val2memstr(curstat->mem.vdata*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.vdata*1024, buf, BFORMAT, 0, 0); return buf; } @@ -788,7 +738,7 @@ { static char buf[10]; - val2memstr(curstat->mem.vstack*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.vstack*1024, buf, BFORMAT, 0, 0); return buf; } @@ -806,7 +756,7 @@ { static char buf[10]; - val2memstr(curstat->mem.vswap*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->mem.vswap*1024, buf, BFORMAT, 0, 0); return buf; } @@ -1470,7 +1420,7 @@ procprt_RDDSK_a(struct tstat *curstat, int avgval, int nsecs) { static char buf[10]; - val2memstr(curstat->dsk.rsz*512, buf, KBFORMAT, avgval, nsecs); + val2memstr(curstat->dsk.rsz*512, buf, BFORMAT, avgval, nsecs); return buf; } @@ -1489,7 +1439,7 @@ { static char buf[10]; - val2memstr(curstat->dsk.wsz*512, buf, KBFORMAT, avgval, nsecs); + val2memstr(curstat->dsk.wsz*512, buf, BFORMAT, avgval, nsecs); return buf; } @@ -1514,7 +1464,7 @@ else nett_wsz = 0; - val2memstr(nett_wsz*512, buf, KBFORMAT, avgval, nsecs); + val2memstr(nett_wsz*512, buf, BFORMAT, avgval, nsecs); return buf; } @@ -1526,7 +1476,7 @@ procprt_WCANCEL_a(struct tstat *curstat, int avgval, int nsecs) { static char buf[10]; - val2memstr(curstat->dsk.cwsz*512, buf, KBFORMAT, avgval, nsecs); + val2memstr(curstat->dsk.cwsz*512, buf, BFORMAT, avgval, nsecs); return buf; } @@ -1974,7 +1924,7 @@ if (!curstat->gpu.state) return " -"; - val2memstr(curstat->gpu.memnow*1024, buf, KBFORMAT, 0, 0); + val2memstr(curstat->gpu.memnow*1024, buf, BFORMAT, 0, 0); return buf; } @@ -1993,7 +1943,7 @@ return(" 0K"); val2memstr(curstat->gpu.nrgpus * curstat->gpu.memcum / - curstat->gpu.sample*1024, buf, KBFORMAT, 0, 0); + curstat->gpu.sample*1024, buf, BFORMAT, 0, 0); return buf; } @@ -2059,7 +2009,7 @@ } proc_printdef procprt_WCHAN = - { "WCHAN ", "WCHAN", procprt_WCHAN_a, procprt_WCHAN_e, 15 }; + { "WCHAN ", "WCHAN", procprt_WCHAN_a, procprt_WCHAN_e, 15}; /***************************************************************/ char * procprt_RUNDELAY_a(struct tstat *curstat, int avgval, int nsecs) @@ -2080,7 +2030,7 @@ } proc_printdef procprt_RUNDELAY = - { "RDELAY", "RDELAY", procprt_RUNDELAY_a, procprt_RUNDELAY_e, 6 }; + { "RDELAY", "RDELAY", procprt_RUNDELAY_a, procprt_RUNDELAY_e, 6}; /***************************************************************/ char * procprt_SORTITEM_ae(struct tstat *curstat, int avgval, int nsecs) @@ -2088,5 +2038,5 @@ return ""; // dummy function } -proc_printdef procprt_SORTITEM = - { 0, "SORTITEM", procprt_SORTITEM_ae, procprt_SORTITEM_ae, 4 }; +proc_printdef procprt_SORTITEM = // width is dynamically defined! + { 0, "SORTITEM", procprt_SORTITEM_ae, procprt_SORTITEM_ae, 4}; diff -Nru atop-2.6.0/showsys.c atop-2.7.1/showsys.c --- atop-2.6.0/showsys.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/showsys.c 2022-01-08 11:49:00.000000000 +0000 @@ -27,45 +27,6 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** -------------------------------------------------------------------------- -** -** $Log: showsys.c,v $ -** Revision 1.10 2010/11/12 06:06:43 gerlof -** Sometimes segmentation-fault on particular CPU-types -** due to memcpy i.s.o. memmove when moving memory in overlap. -** -** Revision 1.9 2010/10/23 14:04:20 gerlof -** Counters for total number of running and sleep threads (JC van Winkel). -** -** Revision 1.8 2010/05/18 19:20:02 gerlof -** Introduce CPU frequency and scaling (JC van Winkel). -** -** Revision 1.7 2010/04/23 08:16:58 gerlof -** Field 'avque' modified to 'avq' to be able to show higher values -** (especially on LVM-level). -** -** Revision 1.6 2010/03/04 10:53:37 gerlof -** Support I/O-statistics on logical volumes and MD devices. -** -** Revision 1.5 2009/12/17 11:59:36 gerlof -** Gather and display new counters: dirty cache and guest cpu usage. -** -** Revision 1.4 2009/12/17 08:53:03 gerlof -** If no coclors wanted, use bold display for critical resources. -** -** Revision 1.3 2009/12/17 07:33:05 gerlof -** Scale system-statistics properly when modifying window size (JC van Winkel). -** -** Revision 1.2 2009/12/10 11:56:08 gerlof -** Various bug-solutions. -** -** Revision 1.1 2009/12/10 09:46:16 gerlof -** Initial revision -** -** Initial revision -** -** -** Initial -** */ #include @@ -149,7 +110,7 @@ return 0; } -char *sysprt_BLANKBOX(void *p, void *notused, int, int *); +static char *sysprt_BLANKBOX(struct sstat *sstat, extraparam *notused, int, int *); void addblanks(double *charslackused, double *charslackover) @@ -164,11 +125,14 @@ /* * showsysline - * print an array of sys_printpair things. If the screen contains to + * print an array of sys_printpair things. If the screen contains too * few character columns, lower priority items are removed * */ -void showsysline(sys_printpair* elemptr, +#define MAXELEMS 40 + +void +showsysline(sys_printpair* elemptr, struct sstat* sstat, extraparam *extra, char *labeltext, unsigned int badness) { @@ -185,7 +149,6 @@ syscolorlabel(labeltext, badness); /* count number of items */ -#define MAXELEMS 40 sys_printpair newelems[MAXELEMS]; int nitems; @@ -200,6 +163,7 @@ int lowestprio=999999; int lowestprio_index=-1; int i; + for (i=0; i 0) - ** when a specific color is wanted or the convert-function + ** the format-function can set a color-number (color > 0) + ** when a specific color is wanted or the format-function ** can leave the decision to display with a color to the piece ** of code below (color == -1) */ color = 0; - itemp = curelem->doconvert(sstat, extra, badness, &color); + itemp = curelem->doformat(sstat, extra, badness, &color); + + if (!itemp) + { + itemp = " ?"; + } + + printg(" | "); + addblanks(&charslackused, &charslackover); if (screen) { @@ -319,79 +287,73 @@ } } + /*******************************************************************/ -/* SYSTEM PRINT FUNCTIONS */ +/* SYSTEM PRINT FUNCTIONS */ /*******************************************************************/ -char * -sysprt_PRCSYS(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCSYS(struct sstat *notused, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[15]="sys "; val2cpustr(as->totst * 1000/hertz, buf+6); return buf; } -sys_printdef syspdef_PRCSYS = {"PRCSYS", sysprt_PRCSYS}; +sys_printdef syspdef_PRCSYS = {"PRCSYS", sysprt_PRCSYS, NULL}; /*******************************************************************/ -char * -sysprt_PRCUSER(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCUSER(struct sstat *notused, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[15]="user "; val2cpustr(as->totut * 1000/hertz, buf+6); return buf; } -sys_printdef syspdef_PRCUSER = {"PRCUSER", sysprt_PRCUSER}; +sys_printdef syspdef_PRCUSER = {"PRCUSER", sysprt_PRCUSER, NULL}; /*******************************************************************/ -char * -sysprt_PRCNPROC(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCNPROC(struct sstat *notused, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[15]="#proc "; val2valstr(as->nproc - as->nexit, buf+6, 6, 0, 0); return buf; } -sys_printdef syspdef_PRCNPROC = {"PRCNPROC", sysprt_PRCNPROC}; +sys_printdef syspdef_PRCNPROC = {"PRCNPROC", sysprt_PRCNPROC, NULL}; /*******************************************************************/ -char * -sysprt_PRCNRUNNING(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCNRUNNING(struct sstat *notused, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[15]="#trun "; val2valstr(as->ntrun, buf+6, 6, 0, 0); return buf; } -sys_printdef syspdef_PRCNRUNNING = {"PRCNRUNNING", sysprt_PRCNRUNNING}; +sys_printdef syspdef_PRCNRUNNING = {"PRCNRUNNING", sysprt_PRCNRUNNING, NULL}; /*******************************************************************/ -char * -sysprt_PRCNSLEEPING(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCNSLEEPING(struct sstat *notused, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[15]="#tslpi "; val2valstr(as->ntslpi, buf+8, 4, 0, 0); return buf; } -sys_printdef syspdef_PRCNSLEEPING = {"PRCNSLEEPING", sysprt_PRCNSLEEPING}; +sys_printdef syspdef_PRCNSLEEPING = {"PRCNSLEEPING", sysprt_PRCNSLEEPING, NULL}; /*******************************************************************/ -char * -sysprt_PRCNDSLEEPING(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCNDSLEEPING(struct sstat *notused, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[15]="#tslpu "; val2valstr(as->ntslpu, buf+8, 4, 0, 0); return buf; } -sys_printdef syspdef_PRCNDSLEEPING = {"PRCNDSLEEPING", sysprt_PRCNDSLEEPING}; +sys_printdef syspdef_PRCNDSLEEPING = {"PRCNDSLEEPING", sysprt_PRCNDSLEEPING, NULL}; /*******************************************************************/ -char * -sysprt_PRCNZOMBIE(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCNZOMBIE(struct sstat *notused, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[15]="#zombie "; if (as->nzomb > 30) @@ -404,14 +366,12 @@ return buf; } -sys_printdef syspdef_PRCNZOMBIE = {"PRCNZOMBIE", sysprt_PRCNZOMBIE}; +sys_printdef syspdef_PRCNZOMBIE = {"PRCNZOMBIE", sysprt_PRCNZOMBIE, NULL}; /*******************************************************************/ -char * -sysprt_PRCNNEXIT(void *notused, void *q, int badness, int *color) +static char * +sysprt_PRCNNEXIT(struct sstat *notused, extraparam *as, int badness, int *color) { static char firstcall = 1; - - extraparam *as=q; static char buf[15]="#exit "; if (supportflags & ACCTACTIVE) @@ -459,13 +419,11 @@ } } -sys_printdef syspdef_PRCNNEXIT = {"PRCNNEXIT", sysprt_PRCNNEXIT}; +sys_printdef syspdef_PRCNNEXIT = {"PRCNNEXIT", sysprt_PRCNNEXIT, NULL}; /*******************************************************************/ -char * -sysprt_CPUSYS(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUSYS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = (sstat->cpu.all.stime * 100.0) / as->percputot; @@ -476,13 +434,11 @@ return buf; } -sys_printdef syspdef_CPUSYS = {"CPUSYS", sysprt_CPUSYS}; +sys_printdef syspdef_CPUSYS = {"CPUSYS", sysprt_CPUSYS, NULL}; /*******************************************************************/ -char * -sysprt_CPUUSER(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUUSER(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = (sstat->cpu.all.utime + sstat->cpu.all.ntime) * 100.0 / as->percputot; @@ -494,13 +450,11 @@ return buf; } -sys_printdef syspdef_CPUUSER = {"CPUUSER", sysprt_CPUUSER}; +sys_printdef syspdef_CPUUSER = {"CPUUSER", sysprt_CPUUSER, NULL}; /*******************************************************************/ -char * -sysprt_CPUIRQ(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIRQ(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = (sstat->cpu.all.Itime + sstat->cpu.all.Stime) * 100.0 / as->percputot; @@ -512,39 +466,33 @@ return buf; } -sys_printdef syspdef_CPUIRQ = {"CPUIRQ", sysprt_CPUIRQ}; +sys_printdef syspdef_CPUIRQ = {"CPUIRQ", sysprt_CPUIRQ, NULL}; /*******************************************************************/ -char * -sysprt_CPUIDLE(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIDLE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; sprintf(buf, "idle %6.0f%%", (sstat->cpu.all.itime * 100.0) / as->percputot); return buf; } -sys_printdef syspdef_CPUIDLE = {"CPUIDLE", sysprt_CPUIDLE}; +sys_printdef syspdef_CPUIDLE = {"CPUIDLE", sysprt_CPUIDLE, NULL}; /*******************************************************************/ -char * -sysprt_CPUWAIT(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUWAIT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; sprintf(buf, "wait %6.0f%%", (sstat->cpu.all.wtime * 100.0) / as->percputot); return buf; } -sys_printdef syspdef_CPUWAIT = {"CPUWAIT", sysprt_CPUWAIT}; +sys_printdef syspdef_CPUWAIT = {"CPUWAIT", sysprt_CPUWAIT, NULL}; /*******************************************************************/ -char * -sysprt_CPUISYS(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUISYS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = sstat->cpu.cpu[as->index].stime * 100.0 / as->percputot; @@ -556,13 +504,11 @@ return buf; } -sys_printdef syspdef_CPUISYS = {"CPUISYS", sysprt_CPUISYS}; +sys_printdef syspdef_CPUISYS = {"CPUISYS", sysprt_CPUISYS, NULL}; /*******************************************************************/ -char * -sysprt_CPUIUSER(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIUSER(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = (sstat->cpu.cpu[as->index].utime + sstat->cpu.cpu[as->index].ntime) @@ -575,13 +521,11 @@ return buf; } -sys_printdef syspdef_CPUIUSER = {"CPUIUSER", sysprt_CPUIUSER}; +sys_printdef syspdef_CPUIUSER = {"CPUIUSER", sysprt_CPUIUSER, NULL}; /*******************************************************************/ -char * -sysprt_CPUIIRQ(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIIRQ(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = (sstat->cpu.cpu[as->index].Itime + sstat->cpu.cpu[as->index].Stime) @@ -594,26 +538,22 @@ return buf; } -sys_printdef syspdef_CPUIIRQ = {"CPUIIRQ", sysprt_CPUIIRQ}; +sys_printdef syspdef_CPUIIRQ = {"CPUIIRQ", sysprt_CPUIIRQ, NULL}; /*******************************************************************/ -char * -sysprt_CPUIIDLE(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIIDLE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; sprintf(buf, "idle %6.0f%%", (sstat->cpu.cpu[as->index].itime * 100.0) / as->percputot); return buf; } -sys_printdef syspdef_CPUIIDLE = {"CPUIIDLE", sysprt_CPUIIDLE}; +sys_printdef syspdef_CPUIIDLE = {"CPUIIDLE", sysprt_CPUIIDLE, NULL}; /*******************************************************************/ -char * -sysprt_CPUIWAIT(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIWAIT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; sprintf(buf, "cpu%03d w%3.0f%%", sstat->cpu.cpu[as->index].cpunr, @@ -621,9 +561,10 @@ return buf; } -sys_printdef syspdef_CPUIWAIT = {"CPUIWAIT", sysprt_CPUIWAIT}; +sys_printdef syspdef_CPUIWAIT = {"CPUIWAIT", sysprt_CPUIWAIT, NULL}; /*******************************************************************/ -void dofmt_cpufreq(char *buf, count_t maxfreq, count_t cnt, count_t ticks) +static char * +dofmt_cpufreq(char *buf, count_t maxfreq, count_t cnt, count_t ticks) { // if ticks != 0, do full output if (ticks) @@ -637,10 +578,12 @@ strcpy(buf, "curf "); val2Hzstr(cnt, buf+5); } - else // nothing is known: print ????? + else // nothing is known: suppress { - strcpy(buf, "curf ?MHz"); + buf = NULL; } + + return buf; } @@ -664,13 +607,15 @@ mycnt += sstat->cpu.cpu[i].freqcnt.cnt; myticks += sstat->cpu.cpu[i].freqcnt.ticks; } + *maxfreq= mymaxfreq; *cnt = mycnt; *ticks = myticks; } -void dofmt_cpuscale(char *buf, count_t maxfreq, count_t cnt, count_t ticks) +static char * +dofmt_cpuscale(char *buf, count_t maxfreq, count_t cnt, count_t ticks) { if (ticks) { @@ -685,36 +630,34 @@ strcpy(buf, "curscal "); sprintf(buf+7, "%4lld%%", 100 * cnt / maxfreq); } - else // nothing is known: print ????? + else // nothing is known: suppress { - strcpy(buf, "curscal ?%"); + buf = NULL; } + + return buf; } /*******************************************************************/ -char * -sysprt_CPUIFREQ(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIFREQ(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; count_t maxfreq = sstat->cpu.cpu[as->index].freqcnt.maxfreq; count_t cnt = sstat->cpu.cpu[as->index].freqcnt.cnt; count_t ticks = sstat->cpu.cpu[as->index].freqcnt.ticks; - dofmt_cpufreq(buf, maxfreq, cnt, ticks); - return buf; + return dofmt_cpufreq(buf, maxfreq, cnt, ticks); } -sys_printdef syspdef_CPUIFREQ = {"CPUIFREQ", sysprt_CPUIFREQ}; +sys_printdef syspdef_CPUIFREQ = {"CPUIFREQ", sysprt_CPUIFREQ, NULL}; /*******************************************************************/ -char * -sysprt_CPUFREQ(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUFREQ(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[15]; count_t maxfreq; @@ -723,54 +666,65 @@ int n = sstat->cpu.nrcpu; sumscaling(sstat, &maxfreq, &cnt, &ticks); - dofmt_cpufreq(buf, maxfreq/n, cnt/n, ticks/n); - return buf; + return dofmt_cpufreq(buf, maxfreq/n, cnt/n, ticks/n); } -sys_printdef syspdef_CPUFREQ = {"CPUFREQ", sysprt_CPUFREQ}; +sys_printdef syspdef_CPUFREQ = {"CPUFREQ", sysprt_CPUFREQ, NULL}; /*******************************************************************/ -char * -sysprt_CPUISCALE(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUSCALE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; - static char buf[15]; + static char buf[32] = "scaling ?"; - count_t maxfreq = sstat->cpu.cpu[as->index].freqcnt.maxfreq; - count_t cnt = sstat->cpu.cpu[as->index].freqcnt.cnt; - count_t ticks = sstat->cpu.cpu[as->index].freqcnt.ticks; + count_t maxfreq; + count_t cnt; + count_t ticks; + int n = sstat->cpu.nrcpu; - dofmt_cpuscale(buf, maxfreq, cnt, ticks); - return buf; + sumscaling(sstat, &maxfreq, &cnt, &ticks); + dofmt_cpuscale(buf, maxfreq/n, cnt/n, ticks/n); + return buf; } -sys_printdef syspdef_CPUISCALE = {"CPUISCALE", sysprt_CPUISCALE}; -/*******************************************************************/ -char * -sysprt_CPUSCALE(void *p, void *q, int badness, int *color) +static int +sysval_CPUSCALE(struct sstat *sstat) { - - struct sstat *sstat=p; - static char buf[15]; - + char buf[32]; count_t maxfreq; count_t cnt; count_t ticks; int n = sstat->cpu.nrcpu; sumscaling(sstat, &maxfreq, &cnt, &ticks); - dofmt_cpuscale(buf, maxfreq/n, cnt/n, ticks/n); - return buf; + + if (dofmt_cpuscale(buf, maxfreq/n, cnt/n, ticks/n)) + return 1; + else + return 0; +} + +sys_printdef syspdef_CPUSCALE = {"CPUSCALE", sysprt_CPUSCALE, sysval_CPUSCALE}; +/*******************************************************************/ +static char * +sysprt_CPUISCALE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + + static char buf[32] = "scaling ?"; + + count_t maxfreq = sstat->cpu.cpu[as->index].freqcnt.maxfreq; + count_t cnt = sstat->cpu.cpu[as->index].freqcnt.cnt; + count_t ticks = sstat->cpu.cpu[as->index].freqcnt.ticks; + + dofmt_cpuscale(buf, maxfreq, cnt, ticks); + return buf; } -sys_printdef syspdef_CPUSCALE = {"CPUSCALE", sysprt_CPUSCALE}; +sys_printdef syspdef_CPUISCALE = {"CPUISCALE", sysprt_CPUISCALE, sysval_CPUSCALE}; /*******************************************************************/ -char * -sysprt_CPUSTEAL(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUSTEAL(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = sstat->cpu.all.steal * 100.0 / as->percputot; @@ -781,13 +735,11 @@ return buf; } -sys_printdef syspdef_CPUSTEAL = {"CPUSTEAL", sysprt_CPUSTEAL}; +sys_printdef syspdef_CPUSTEAL = {"CPUSTEAL", sysprt_CPUSTEAL, NULL}; /*******************************************************************/ -char * -sysprt_CPUISTEAL(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUISTEAL(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = sstat->cpu.cpu[as->index].steal * 100.0 / as->percputot; @@ -799,13 +751,11 @@ return buf; } -sys_printdef syspdef_CPUISTEAL = {"CPUISTEAL", sysprt_CPUISTEAL}; +sys_printdef syspdef_CPUISTEAL = {"CPUISTEAL", sysprt_CPUISTEAL, NULL}; /*******************************************************************/ -char * -sysprt_CPUGUEST(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUGUEST(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = sstat->cpu.all.guest * 100.0 / as->percputot; @@ -816,13 +766,11 @@ return buf; } -sys_printdef syspdef_CPUGUEST = {"CPUGUEST", sysprt_CPUGUEST}; +sys_printdef syspdef_CPUGUEST = {"CPUGUEST", sysprt_CPUGUEST, NULL}; /*******************************************************************/ -char * -sysprt_CPUIGUEST(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIGUEST(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float perc = sstat->cpu.cpu[as->index].guest * 100.0 / as->percputot; @@ -833,19 +781,17 @@ return buf; } -sys_printdef syspdef_CPUIGUEST = {"CPUIGUEST", sysprt_CPUIGUEST}; +sys_printdef syspdef_CPUIGUEST = {"CPUIGUEST", sysprt_CPUIGUEST, NULL}; /*******************************************************************/ -char * -sysprt_CPUIPC(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIPC(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[15]; float ipc = 0.0; switch (sstat->cpu.all.cycle) { case 0: - *color = COLORINFO; sprintf(buf, "ipc notavail"); break; @@ -862,20 +808,23 @@ return buf; } -sys_printdef syspdef_CPUIPC = {"CPUIPC", sysprt_CPUIPC}; +static int +sysval_IPCVALIDATE(struct sstat *sstat) +{ + return sstat->cpu.all.cycle; +} + +sys_printdef syspdef_CPUIPC = {"CPUIPC", sysprt_CPUIPC, sysval_IPCVALIDATE}; /*******************************************************************/ -char * -sysprt_CPUIIPC(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUIIPC(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15]; float ipc = 0.0; switch (sstat->cpu.all.cycle) { case 0: - *color = COLORINFO; sprintf(buf, "ipc notavail"); break; @@ -895,20 +844,17 @@ return buf; } -sys_printdef syspdef_CPUIIPC = {"CPUIIPC", sysprt_CPUIIPC}; +sys_printdef syspdef_CPUIIPC = {"CPUIIPC", sysprt_CPUIIPC, sysval_IPCVALIDATE}; /*******************************************************************/ -char * -sysprt_CPUCYCLE(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUCYCLE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15] = "cycl "; switch (sstat->cpu.all.cycle) { case 0: - *color = COLORINFO; - sprintf(buf+5, "unknown"); + sprintf(buf+5, "missing"); break; case 1: @@ -924,20 +870,17 @@ return buf; } -sys_printdef syspdef_CPUCYCLE = {"CPUCYCLE", sysprt_CPUCYCLE}; +sys_printdef syspdef_CPUCYCLE = {"CPUCYCLE", sysprt_CPUCYCLE, sysval_IPCVALIDATE}; /*******************************************************************/ -char * -sysprt_CPUICYCLE(void *p, void *q, int badness, int *color) +static char * +sysprt_CPUICYCLE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[15] = "cycl "; switch (sstat->cpu.all.cycle) { case 0: - *color = COLORINFO; - sprintf(buf+5, "unknown"); + sprintf(buf+5, "missing"); break; case 1: @@ -953,12 +896,11 @@ return buf; } -sys_printdef syspdef_CPUICYCLE = {"CPUICYCLE", sysprt_CPUICYCLE}; +sys_printdef syspdef_CPUICYCLE = {"CPUICYCLE", sysprt_CPUICYCLE, sysval_IPCVALIDATE}; /*******************************************************************/ -char * -sysprt_CPLAVG1(void *p, void *notused, int badness, int *color) +static char * +sysprt_CPLAVG1(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[17]="avg1 "; if (sstat->cpu.lavg1 > 999999.0) @@ -976,12 +918,11 @@ return buf; } -sys_printdef syspdef_CPLAVG1 = {"CPLAVG1", sysprt_CPLAVG1}; +sys_printdef syspdef_CPLAVG1 = {"CPLAVG1", sysprt_CPLAVG1, NULL}; /*******************************************************************/ -char * -sysprt_CPLAVG5(void *p, void *notused, int badness, int *color) +static char * +sysprt_CPLAVG5(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[15]="avg5 "; if (sstat->cpu.lavg5 > 999999.0) @@ -999,12 +940,11 @@ return buf; } -sys_printdef syspdef_CPLAVG5 = {"CPLAVG5", sysprt_CPLAVG5}; +sys_printdef syspdef_CPLAVG5 = {"CPLAVG5", sysprt_CPLAVG5, NULL}; /*******************************************************************/ -char * -sysprt_CPLAVG15(void *p, void *notused, int badness, int *color) +static char * +sysprt_CPLAVG15(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[15]="avg15 "; if (sstat->cpu.lavg15 > (2 * sstat->cpu.nrcpu) ) @@ -1025,65 +965,55 @@ return buf; } -sys_printdef syspdef_CPLAVG15 = {"CPLAVG15", sysprt_CPLAVG15}; +sys_printdef syspdef_CPLAVG15 = {"CPLAVG15", sysprt_CPLAVG15, NULL}; /*******************************************************************/ -char * -sysprt_CPLCSW(void *p, void *q, int badness, int *color) +static char * +sysprt_CPLCSW(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="csw "; val2valstr(sstat->cpu.csw, buf+4 , 8,as->avgval,as->nsecs); return buf; } -sys_printdef syspdef_CPLCSW = {"CPLCSW", sysprt_CPLCSW}; +sys_printdef syspdef_CPLCSW = {"CPLCSW", sysprt_CPLCSW, NULL}; /*******************************************************************/ -char * -sysprt_PRCCLONES(void *p, void *q, int badness, int *color) +static char * +sysprt_PRCCLONES(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="clones "; val2valstr(sstat->cpu.nprocs, buf+7 , 5,as->avgval,as->nsecs); return buf; } -sys_printdef syspdef_PRCCLONES = {"PRCCLONES", sysprt_PRCCLONES}; +sys_printdef syspdef_PRCCLONES = {"PRCCLONES", sysprt_PRCCLONES, NULL}; /*******************************************************************/ -char * -sysprt_CPLNUMCPU(void *p, void *q, int badness, int *color) +static char * +sysprt_CPLNUMCPU(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="numcpu "; val2valstr(sstat->cpu.nrcpu, buf+7 , 5,0,as->nsecs); return buf; } -sys_printdef syspdef_CPLNUMCPU = {"CPLNUMCPU", sysprt_CPLNUMCPU}; +sys_printdef syspdef_CPLNUMCPU = {"CPLNUMCPU", sysprt_CPLNUMCPU, NULL}; /*******************************************************************/ -char * -sysprt_CPLINTR(void *p, void *q, int badness, int *color) +static char * +sysprt_CPLINTR(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="intr "; val2valstr(sstat->cpu.devint, buf+5 , 7,as->avgval,as->nsecs); return buf; } -sys_printdef syspdef_CPLINTR = {"CPLINTR", sysprt_CPLINTR}; +sys_printdef syspdef_CPLINTR = {"CPLINTR", sysprt_CPLINTR, NULL}; /*******************************************************************/ -char * -sysprt_GPUBUS(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUBUS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]; char *pn; int len; @@ -1097,13 +1027,11 @@ return buf; } -sys_printdef syspdef_GPUBUS = {"GPUBUS", sysprt_GPUBUS}; +sys_printdef syspdef_GPUBUS = {"GPUBUS", sysprt_GPUBUS, NULL}; /*******************************************************************/ -char * -sysprt_GPUTYPE(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUTYPE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]; char *pn; int len; @@ -1117,26 +1045,22 @@ return buf; } -sys_printdef syspdef_GPUTYPE = {"GPUTYPE", sysprt_GPUTYPE}; +sys_printdef syspdef_GPUTYPE = {"GPUTYPE", sysprt_GPUTYPE, NULL}; /*******************************************************************/ -char * -sysprt_GPUNRPROC(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUNRPROC(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16] = "#proc "; val2valstr(sstat->gpu.gpu[as->index].nrprocs, buf+6, 6, 0, 0); return buf; } -sys_printdef syspdef_GPUNRPROC = {"GPUNRPROC", sysprt_GPUNRPROC}; +sys_printdef syspdef_GPUNRPROC = {"GPUNRPROC", sysprt_GPUNRPROC, NULL}; /*******************************************************************/ -char * -sysprt_GPUMEMPERC(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUMEMPERC(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="membusy "; int perc = sstat->gpu.gpu[as->index].mempercnow; @@ -1160,13 +1084,11 @@ return buf; } -sys_printdef syspdef_GPUMEMPERC = {"GPUMEMPERC", sysprt_GPUMEMPERC}; +sys_printdef syspdef_GPUMEMPERC = {"GPUMEMPERC", sysprt_GPUMEMPERC, NULL}; /*******************************************************************/ -char * -sysprt_GPUGPUPERC(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUGPUPERC(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="gpubusy "; int perc = sstat->gpu.gpu[as->index].gpupercnow; @@ -1190,13 +1112,11 @@ return buf; } -sys_printdef syspdef_GPUGPUPERC = {"GPUGPUPERC", sysprt_GPUGPUPERC}; +sys_printdef syspdef_GPUGPUPERC = {"GPUGPUPERC", sysprt_GPUGPUPERC, NULL}; /*******************************************************************/ -char * -sysprt_GPUMEMOCC(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUMEMOCC(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="memocc "; int perc; @@ -1209,13 +1129,11 @@ return buf; } -sys_printdef syspdef_GPUMEMOCC = {"GPUMEMOCC", sysprt_GPUMEMOCC}; +sys_printdef syspdef_GPUMEMOCC = {"GPUMEMOCC", sysprt_GPUMEMOCC, NULL}; /*******************************************************************/ -char * -sysprt_GPUMEMTOT(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUMEMTOT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16] = "total "; val2memstr(sstat->gpu.gpu[as->index].memtotnow * 1024, buf+6, @@ -1223,13 +1141,11 @@ return buf; } -sys_printdef syspdef_GPUMEMTOT = {"GPUMEMTOT", sysprt_GPUMEMTOT}; +sys_printdef syspdef_GPUMEMTOT = {"GPUMEMTOT", sysprt_GPUMEMTOT, NULL}; /*******************************************************************/ -char * -sysprt_GPUMEMUSE(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUMEMUSE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16] = "used "; val2memstr(sstat->gpu.gpu[as->index].memusenow * 1024, @@ -1237,13 +1153,11 @@ return buf; } -sys_printdef syspdef_GPUMEMUSE = {"GPUMEMUSE", sysprt_GPUMEMUSE}; +sys_printdef syspdef_GPUMEMUSE = {"GPUMEMUSE", sysprt_GPUMEMUSE, NULL}; /*******************************************************************/ -char * -sysprt_GPUMEMAVG(void *p, void *q, int badness, int *color) +static char * +sysprt_GPUMEMAVG(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16] = "usavg "; if (sstat->gpu.gpu[as->index].samples) @@ -1256,218 +1170,361 @@ return buf; } -sys_printdef syspdef_GPUMEMAVG = {"GPUMEMAVG", sysprt_GPUMEMAVG}; +sys_printdef syspdef_GPUMEMAVG = {"GPUMEMAVG", sysprt_GPUMEMAVG, NULL}; /*******************************************************************/ -char * -sysprt_MEMTOT(void *p, void *notused, int badness, int *color) +static char * +sysprt_MEMTOT(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="tot "; *color = -1; val2memstr(sstat->mem.physmem * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_MEMTOT = {"MEMTOT", sysprt_MEMTOT}; +sys_printdef syspdef_MEMTOT = {"MEMTOT", sysprt_MEMTOT, NULL}; /*******************************************************************/ -char * -sysprt_MEMFREE(void *p, void *notused, int badness, int *color) +static char * +sysprt_MEMFREE(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="free "; *color = -1; val2memstr(sstat->mem.freemem * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_MEMFREE = {"MEMFREE", sysprt_MEMFREE}; +sys_printdef syspdef_MEMFREE = {"MEMFREE", sysprt_MEMFREE, NULL}; /*******************************************************************/ -char * -sysprt_MEMCACHE(void *p, void *notused, int badness, int *color) +static char * +sysprt_MEMCACHE(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="cache "; *color = -1; val2memstr(sstat->mem.cachemem * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_MEMCACHE = {"MEMCACHE", sysprt_MEMCACHE}; +sys_printdef syspdef_MEMCACHE = {"MEMCACHE", sysprt_MEMCACHE, NULL}; /*******************************************************************/ -char * -sysprt_MEMDIRTY(void *p, void *notused, int badness, int *color) +static char * +sysprt_MEMDIRTY(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16] = "dirty "; val2memstr(sstat->mem.cachedrt * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_MEMDIRTY = {"MEMDIRTY", sysprt_MEMDIRTY}; +sys_printdef syspdef_MEMDIRTY = {"MEMDIRTY", sysprt_MEMDIRTY, NULL}; /*******************************************************************/ -char * -sysprt_MEMBUFFER(void *p, void *notused, int badness, int *color) +static char * +sysprt_MEMBUFFER(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="buff "; *color = -1; val2memstr(sstat->mem.buffermem * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_MEMBUFFER = {"MEMBUFFER", sysprt_MEMBUFFER}; +sys_printdef syspdef_MEMBUFFER = {"MEMBUFFER", sysprt_MEMBUFFER, NULL}; /*******************************************************************/ -char * -sysprt_MEMSLAB(void *p, void *notused, int badness, int *color) +static char * +sysprt_MEMSLAB(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="slab "; *color = -1; val2memstr(sstat->mem.slabmem * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_MEMSLAB = {"MEMSLAB", sysprt_MEMSLAB}; +sys_printdef syspdef_MEMSLAB = {"MEMSLAB", sysprt_MEMSLAB, NULL}; /*******************************************************************/ -char * -sysprt_RECSLAB(void *p, void *notused, int badness, int *color) +static char * +sysprt_RECSLAB(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="slrec "; *color = -1; val2memstr(sstat->mem.slabreclaim * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_RECSLAB = {"RECSLAB", sysprt_RECSLAB}; +sys_printdef syspdef_RECSLAB = {"RECSLAB", sysprt_RECSLAB, NULL}; /*******************************************************************/ -char * -sysprt_SHMEM(void *p, void *notused, int badness, int *color) +static char * +sysprt_SHMEM(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="shmem "; *color = -1; val2memstr(sstat->mem.shmem * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_SHMEM = {"SHMEM", sysprt_SHMEM}; +sys_printdef syspdef_SHMEM = {"SHMEM", sysprt_SHMEM, NULL}; /*******************************************************************/ -char * -sysprt_SHMRSS(void *p, void *notused, int badness, int *color) +static char * +sysprt_SHMRSS(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="shrss "; *color = -1; val2memstr(sstat->mem.shmrss * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_SHMRSS = {"SHMRSS", sysprt_SHMRSS}; +sys_printdef syspdef_SHMRSS = {"SHMRSS", sysprt_SHMRSS, NULL}; /*******************************************************************/ -char * -sysprt_SHMSWP(void *p, void *notused, int badness, int *color) +static char * +sysprt_SHMSWP(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="shswp "; *color = -1; val2memstr(sstat->mem.shmswp * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_SHMSWP = {"SHMSWP", sysprt_SHMSWP}; +sys_printdef syspdef_SHMSWP = {"SHMSWP", sysprt_SHMSWP, NULL}; /*******************************************************************/ -char * -sysprt_HUPTOT(void *p, void *notused, int badness, int *color) +static char * +sysprt_HUPTOT(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="hptot "; + *color = -1; val2memstr(sstat->mem.tothugepage * sstat->mem.hugepagesz, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_HUPTOT = {"HUPTOT", sysprt_HUPTOT}; +static int +sysval_HUPTOT(struct sstat *sstat) +{ + return sstat->mem.tothugepage; +} + +sys_printdef syspdef_HUPTOT = {"HUPTOT", sysprt_HUPTOT, sysval_HUPTOT}; /*******************************************************************/ -char * -sysprt_HUPUSE(void *p, void *notused, int badness, int *color) +static char * +sysprt_HUPUSE(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="hpuse "; + *color = -1; val2memstr( (sstat->mem.tothugepage - sstat->mem.freehugepage) * sstat->mem.hugepagesz, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_HUPUSE = {"HUPUSE", sysprt_HUPUSE}; +static int +sysval_HUPUSE(struct sstat *sstat) +{ + return sstat->mem.tothugepage; +} + +sys_printdef syspdef_HUPUSE = {"HUPUSE", sysprt_HUPUSE, sysval_HUPUSE}; /*******************************************************************/ -char * -sysprt_VMWBAL(void *p, void *notused, int badness, int *color) +static char * +sysprt_VMWBAL(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="vmbal "; + *color = -1; val2memstr(sstat->mem.vmwballoon * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_VMWBAL = {"VMWBAL", sysprt_VMWBAL}; +static int +sysval_VMWBAL(struct sstat *sstat) +{ + if (sstat->mem.vmwballoon == -1) + return 0; + else + return 1; +} + +sys_printdef syspdef_VMWBAL = {"VMWBAL", sysprt_VMWBAL, sysval_VMWBAL}; /*******************************************************************/ -char * -sysprt_ZFSARC(void *p, void *notused, int badness, int *color) +static char * +sysprt_ZFSARC(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="zfarc "; - *color = -1; - val2memstr(sstat->mem.zfsarcsize * pagesize, buf+6, MBFORMAT, 0, 0); + + if (sstat->mem.zfsarcsize == -1) + { + val2memstr(0, buf+6, MBFORMAT, 0, 0); + } + else + { + *color = -1; + val2memstr(sstat->mem.zfsarcsize * pagesize, buf+6, + MBFORMAT, 0, 0); + } + return buf; } -sys_printdef syspdef_ZFSARC = {"ZFSARC", sysprt_ZFSARC}; +static int +sysval_ZFSARC(struct sstat *sstat) +{ + if (sstat->mem.zfsarcsize == -1) + return 0; + else + return 1; +} + +sys_printdef syspdef_ZFSARC = {"ZFSARC", sysprt_ZFSARC, sysval_ZFSARC}; /*******************************************************************/ -char * -sysprt_SWPTOT(void *p, void *notused, int badness, int *color) +static char * +sysprt_SWPTOT(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="tot "; *color = -1; val2memstr(sstat->mem.totswap * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_SWPTOT = {"SWPTOT", sysprt_SWPTOT}; +sys_printdef syspdef_SWPTOT = {"SWPTOT", sysprt_SWPTOT, NULL}; /*******************************************************************/ -char * -sysprt_SWPFREE(void *p, void *notused, int badness, int *color) +static char * +sysprt_SWPFREE(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="free "; *color = -1; val2memstr(sstat->mem.freeswap * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_SWPFREE = {"SWPFREE", sysprt_SWPFREE}; +sys_printdef syspdef_SWPFREE = {"SWPFREE", sysprt_SWPFREE, NULL}; /*******************************************************************/ -char * -sysprt_SWPCACHE(void *p, void *notused, int badness, int *color) +static char * +sysprt_SWPCACHE(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="swcac "; *color = -1; val2memstr(sstat->mem.swapcached * pagesize, buf+6, MBFORMAT, 0, 0); return buf; } -sys_printdef syspdef_SWPCACHE = {"SWPCACHE", sysprt_SWPCACHE}; +sys_printdef syspdef_SWPCACHE = {"SWPCACHE", sysprt_SWPCACHE, NULL}; +/*******************************************************************/ +static char * +sysprt_ZSWTOTAL(struct sstat *sstat, extraparam *notused, int badness, int *color) +{ + static char buf[16]="zpool "; + + *color = -1; + val2memstr(sstat->mem.zswtotpool * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +static int +sysval_ZSWTOTAL(struct sstat *sstat) +{ + if (sstat->mem.zswtotpool == -1) + return 0; + else + return 1; +} + +sys_printdef syspdef_ZSWTOTAL = {"ZSWTOTAL", sysprt_ZSWTOTAL, sysval_ZSWTOTAL}; +/*******************************************************************/ +static char * +sysprt_ZSWSTORED(struct sstat *sstat, extraparam *notused, int badness, int *color) +{ + static char buf[16]="zstor "; + + if (sstat->mem.zswstored == -1) + { + val2memstr(0, buf+6, MBFORMAT, 0, 0); + } + else + { + *color = -1; + val2memstr(sstat->mem.zswstored * pagesize, buf+6, MBFORMAT, 0, 0); + } + + return buf; +} + +static int +sysval_ZSWSTORED(struct sstat *sstat) +{ + if (sstat->mem.zswstored == -1) + return 0; + else + return 1; +} + +sys_printdef syspdef_ZSWSTORED = {"ZSWSTORED", sysprt_ZSWSTORED, sysval_ZSWSTORED}; +/*******************************************************************/ +static char * +sysprt_KSMSHARING(struct sstat *sstat, extraparam *notused, int badness, int *color) +{ + static char buf[16]="kssav "; + + if (sstat->mem.ksmsharing == -1) + { + val2memstr(0, buf+6, MBFORMAT, 0, 0); + } + else + { + *color = -1; + val2memstr(sstat->mem.ksmsharing * pagesize, buf+6, MBFORMAT, 0, 0); + } + + return buf; +} + +static int +sysval_KSMSHARING(struct sstat *sstat) +{ + if (sstat->mem.ksmsharing == -1) + return 0; + else + return 1; +} + +sys_printdef syspdef_KSMSHARING = {"KSMSHARING", sysprt_KSMSHARING, sysval_KSMSHARING}; +/*******************************************************************/ +static char * +sysprt_KSMSHARED(struct sstat *sstat, extraparam *notused, int badness, int *color) +{ + static char buf[16]="ksuse "; + + if (sstat->mem.ksmshared == -1) + { + val2memstr(0, buf+6, MBFORMAT, 0, 0); + } + else + { + *color = -1; + val2memstr(sstat->mem.ksmshared * pagesize, buf+6, MBFORMAT, 0, 0); + } + + return buf; +} + +static int +sysval_KSMSHARED(struct sstat *sstat) +{ + if (sstat->mem.ksmshared == -1) + return 0; + else + return 1; +} + +sys_printdef syspdef_KSMSHARED = {"KSMSHARED", sysprt_KSMSHARED, sysval_KSMSHARED}; /*******************************************************************/ -char * -sysprt_SWPCOMMITTED(void *p, void *notused, int badness, int *color) +static char * +sysprt_NUMNUMA(struct sstat *sstat, extraparam *notused, int badness, int *color) +{ + static char buf[16]="numnode "; + val2valstr(sstat->memnuma.nrnuma, buf+8, 4, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMNUMA = {"NUMNUMA", sysprt_NUMNUMA, NULL}; +/*******************************************************************/ +static char * +sysprt_SWPCOMMITTED(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="vmcom "; val2memstr(sstat->mem.committed * pagesize, buf+6, MBFORMAT, 0, 0); @@ -1477,12 +1534,11 @@ return buf; } -sys_printdef syspdef_SWPCOMMITTED = {"SWPCOMMITTED", sysprt_SWPCOMMITTED}; +sys_printdef syspdef_SWPCOMMITTED = {"SWPCOMMITTED", sysprt_SWPCOMMITTED, NULL}; /*******************************************************************/ -char * -sysprt_SWPCOMMITLIM(void *p, void *notused, int badness, int *color) +static char * +sysprt_SWPCOMMITLIM(struct sstat *sstat, extraparam *notused, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]="vmlim "; val2memstr(sstat->mem.commitlim * pagesize, buf+6, MBFORMAT, 0, 0); @@ -1492,68 +1548,397 @@ return buf; } -sys_printdef syspdef_SWPCOMMITLIM = {"SWPCOMMITLIM", sysprt_SWPCOMMITLIM}; +sys_printdef syspdef_SWPCOMMITLIM = {"SWPCOMMITLIM", sysprt_SWPCOMMITLIM, NULL}; /*******************************************************************/ -char * -sysprt_PAGSCAN(void *p, void *q, int badness, int *color) +static char * +sysprt_PAGSCAN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="scan "; val2valstr(sstat->mem.pgscans, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_PAGSCAN = {"PAGSCAN", sysprt_PAGSCAN}; +sys_printdef syspdef_PAGSCAN = {"PAGSCAN", sysprt_PAGSCAN, NULL}; /*******************************************************************/ -char * -sysprt_PAGSTEAL(void *p, void *q, int badness, int *color) +static char * +sysprt_PAGSTEAL(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="steal "; val2valstr(sstat->mem.pgsteal, buf+ 6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_PAGSTEAL = {"PAGSTEAL", sysprt_PAGSTEAL}; +sys_printdef syspdef_PAGSTEAL = {"PAGSTEAL", sysprt_PAGSTEAL, NULL}; /*******************************************************************/ -char * -sysprt_PAGSTALL(void *p, void *q, int badness, int *color) +static char * +sysprt_PAGSTALL(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="stall "; val2valstr(sstat->mem.allocstall, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_PAGSTALL = {"PAGSTALL", sysprt_PAGSTALL}; +sys_printdef syspdef_PAGSTALL = {"PAGSTALL", sysprt_PAGSTALL, NULL}; +/*******************************************************************/ +static char * +sysprt_PAGCOMPACT(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="compact "; + val2valstr(sstat->mem.compactstall, buf+8, 4, as->avgval, as->nsecs); + return buf; +} + +sys_printdef syspdef_PAGCOMPACT = {"PAGCOMPACT", sysprt_PAGCOMPACT, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMAMIGRATE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="numamig "; + + val2valstr(sstat->mem.numamigrate, buf+8, 4, as->avgval, as->nsecs); + return buf; +} + +sys_printdef syspdef_NUMAMIGRATE = {"NUMAMIGRATE", sysprt_NUMAMIGRATE, NULL}; + +/*******************************************************************/ +static char * +sysprt_PGMIGRATE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="migrate "; + + val2valstr(sstat->mem.pgmigrate, buf+8, 4, as->avgval, as->nsecs); + return buf; +} + +sys_printdef syspdef_PGMIGRATE = {"PGMIGRATE", sysprt_PGMIGRATE, NULL}; + /*******************************************************************/ -char * -sysprt_PAGSWIN(void *p, void *q, int badness, int *color) +static char * +sysprt_PAGSWIN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="swin "; val2valstr(sstat->mem.swins, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_PAGSWIN = {"PAGSWIN", sysprt_PAGSWIN}; +sys_printdef syspdef_PAGSWIN = {"PAGSWIN", sysprt_PAGSWIN, NULL}; /*******************************************************************/ -char * -sysprt_PAGSWOUT(void *p, void *q, int badness, int *color) +static char * +sysprt_PAGSWOUT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="swout "; *color = -1; val2valstr(sstat->mem.swouts, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_PAGSWOUT = {"PAGSWOUT", sysprt_PAGSWOUT}; +sys_printdef syspdef_PAGSWOUT = {"PAGSWOUT", sysprt_PAGSWOUT, NULL}; +/*******************************************************************/ +static char * +sysprt_OOMKILLS(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="oomkill "; + + if (sstat->mem.oomkills) + *color = COLORCRIT; + + val2valstr(sstat->mem.oomkills, buf+8, 4, as->avgval, as->nsecs); + return buf; +} + +static int +sysval_OOMKILLS(struct sstat *sstat) +{ + if (sstat->mem.oomkills == -1) // non-existing? + return 0; + else + return 1; +} + +sys_printdef syspdef_OOMKILLS = {"OOMKILLS", sysprt_OOMKILLS, sysval_OOMKILLS}; +/*******************************************************************/ +static char * +sysprt_NUMATOT(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="tot "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].totmem * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMATOT = {"NUMATOT", sysprt_NUMATOT, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMAFREE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="free "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].freemem * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMAFREE = {"NUMAFREE", sysprt_NUMAFREE, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMAFILE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="file "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].filepage * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMAFILEPAGE = {"NUMAFILEPAGE", sysprt_NUMAFILE, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMANR(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]; + *color = -1; + sprintf(buf, "numanode%04d", as->index); + return buf; +} + +sys_printdef syspdef_NUMANR = {"NUMANR", sysprt_NUMANR, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMADIRTY(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="dirty "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].dirtymem * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMADIRTY = {"NUMADIRTY", sysprt_NUMADIRTY, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMAACTIVE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="activ "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].active * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMAACTIVE = {"NUMAACTIVE", sysprt_NUMAACTIVE, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMAINACTIVE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="inact "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].inactive * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMAINACTIVE = {"NUMAINACTIVE", sysprt_NUMAINACTIVE, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMASLAB(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="slab "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].slabmem * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMASLAB = {"NUMASLAB", sysprt_NUMASLAB, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMASLABRECLAIM(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="slrec "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].slabreclaim * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMASLABRECLAIM = {"NUMASLABRECLAIM", sysprt_NUMASLABRECLAIM, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMASHMEM(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="shmem "; + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].shmem * pagesize, buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMASHMEM = {"NUMASHMEM", sysprt_NUMASHMEM, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMAFRAG(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = sstat->memnuma.numa[as->index].frag * 100.0; + if (perc > 1.0) + *color = -1; + + sprintf(buf, "frag %6.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMAFRAG = {"NUMAFRAG", sysprt_NUMAFRAG, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMAHUPTOT(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="hptot "; + if (sstat->mem.tothugepage == 0) + return NULL; + + *color = -1; + val2memstr(sstat->memnuma.numa[as->index].tothp * sstat->mem.hugepagesz, + buf+6, MBFORMAT, 0, 0); + return buf; +} + +sys_printdef syspdef_NUMAHUPTOT = {"NUMAHUPTOT", sysprt_NUMAHUPTOT, sysval_HUPTOT}; +/*******************************************************************/ +static char * +sysprt_NUMANUMCPU(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="numcpu "; + + val2valstr(sstat->cpunuma.numa[as->index].nrcpu, buf+7, 5,0,as->nsecs); + return buf; +} + +sys_printdef syspdef_NUMANUMCPU = {"NUMANUMCPU", sysprt_NUMANUMCPU, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUSYS(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = sstat->cpunuma.numa[as->index].stime * 100.0 / as->percputot; + + if (perc > 1.0) + *color = -1; + + sprintf(buf, "sys %6.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMACPUSYS = {"NUMACPUSYS", sysprt_NUMACPUSYS, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUUSER(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = sstat->cpunuma.numa[as->index].utime * 100.0 / as->percputot; + + if (perc > 1.0) + *color = -1; + + sprintf(buf, "user %6.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMACPUUSER = {"NUMACPUUSER", sysprt_NUMACPUUSER, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUNICE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = sstat->cpunuma.numa[as->index].ntime * 100.0 / as->percputot; + + if (perc > 1.0) + *color = -1; + + sprintf(buf, "nice %6.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMACPUNICE = {"NUMACPUNICE", sysprt_NUMACPUNICE, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUIRQ(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = sstat->cpunuma.numa[as->index].Itime * 100.0 / as->percputot; + + if (perc > 1.0) + *color = -1; + + sprintf(buf, "irq %6.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMACPUIRQ = {"NUMACPUIRQ", sysprt_NUMACPUIRQ, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUSOFTIRQ(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = sstat->cpunuma.numa[as->index].Stime * 100.0 / as->percputot; + + if (perc > 1.0) + *color = -1; + + sprintf(buf, "sirq %6.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMACPUSOFTIRQ = {"NUMACPUSOFTIRQ", sysprt_NUMACPUSOFTIRQ, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUIDLE(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + + sprintf(buf, "idle %6.0f%%", + (sstat->cpunuma.numa[as->index].itime * 100.0) / as->percputot); + return buf; +} + +sys_printdef syspdef_NUMACPUIDLE = {"NUMACPUIDLE", sysprt_NUMACPUIDLE, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUWAIT(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + + sprintf(buf, "nod%03d w%3.0f%%", + as->index, + (sstat->cpunuma.numa[as->index].wtime * 100.0) / as->percputot); + return buf; +} + +sys_printdef syspdef_NUMACPUWAIT = {"NUMACPUWAIT", sysprt_NUMACPUWAIT, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUSTEAL(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = (sstat->cpunuma.numa[as->index].steal * 100.0) + / as->percputot; + + if (perc > 1.0) + *color = -1; + + sprintf(buf, "steal %5.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMACPUSTEAL = {"NUMACPUSTEAL", sysprt_NUMACPUSTEAL, NULL}; +/*******************************************************************/ +static char * +sysprt_NUMACPUGUEST(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[15]; + float perc = (sstat->cpunuma.numa[as->index].guest * 100.0) + / as->percputot; + + if (perc > 1.0) + *color = -1; + + sprintf(buf, "guest %5.0f%%", perc); + return buf; +} + +sys_printdef syspdef_NUMACPUGUEST = {"NUMACPUGUEST", sysprt_NUMACPUGUEST, NULL}; /*******************************************************************/ // general formatting of PSI field in avg10/avg60/avg300 void @@ -1583,64 +1968,59 @@ snprintf(buf, bufsize, "%s %9s", head, tmpbuf); } -char * -sysprt_PSICPUS(void *p, void *q, int badness, int *color) +static char * +sysprt_PSICPUS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]; psiformatavg(&(sstat->psi.cpusome), "cs", buf, sizeof buf); return buf; } -sys_printdef syspdef_PSICPUS = {"PSICPUS", sysprt_PSICPUS}; +sys_printdef syspdef_PSICPUS = {"PSICPUS", sysprt_PSICPUS, NULL}; -char * -sysprt_PSIMEMS(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIMEMS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]; psiformatavg(&(sstat->psi.memsome), "ms", buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIMEMS = {"PSIMEMS", sysprt_PSIMEMS}; +sys_printdef syspdef_PSIMEMS = {"PSIMEMS", sysprt_PSIMEMS, NULL}; -char * -sysprt_PSIMEMF(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIMEMF(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]; psiformatavg(&(sstat->psi.memfull), "mf", buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIMEMF = {"PSIMEMF", sysprt_PSIMEMF}; +sys_printdef syspdef_PSIMEMF = {"PSIMEMF", sysprt_PSIMEMF, NULL}; -char * -sysprt_PSIIOS(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIIOS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]; psiformatavg(&(sstat->psi.iosome), "is", buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIIOS = {"PSIIOS", sysprt_PSIIOS}; +sys_printdef syspdef_PSIIOS = {"PSIIOS", sysprt_PSIIOS, NULL}; -char * -sysprt_PSIIOF(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIIOF(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[16]; psiformatavg(&(sstat->psi.iofull), "if", buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIIOF = {"PSIIOF", sysprt_PSIIOF}; +sys_printdef syspdef_PSIIOF = {"PSIIOF", sysprt_PSIIOF, NULL}; /*******************************************************************/ // general formatting of PSI field in total percentage void -psiformattot(struct psi *p, char *head, void *q, int *color, char *buf, int bufsize) +psiformattot(struct psi *p, char *head, extraparam *as, int *color, + char *buf, int bufsize) { static char formats[] = "%-7.7s %3lu%%"; - extraparam *as=q; - unsigned long perc = p->total/(as->nsecs*10000); + unsigned long perc = p->total/((count_t)as->nsecs*10000); if (perc > 100) perc = 100; @@ -1651,68 +2031,61 @@ snprintf(buf, bufsize, formats, head, perc); } -char * -sysprt_PSICPUSTOT(void *p, void *q, int badness, int *color) +static char * +sysprt_PSICPUSTOT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[32]; - psiformattot(&(sstat->psi.cpusome), "cpusome", q, color, buf, sizeof buf); + psiformattot(&(sstat->psi.cpusome), "cpusome", as, color, buf, sizeof buf); return buf; } -sys_printdef syspdef_PSICPUSTOT = {"PSICPUSTOT", sysprt_PSICPUSTOT}; +sys_printdef syspdef_PSICPUSTOT = {"PSICPUSTOT", sysprt_PSICPUSTOT, NULL}; -char * -sysprt_PSIMEMSTOT(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIMEMSTOT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[32]; - psiformattot(&(sstat->psi.memsome), "memsome", q, color, buf, sizeof buf); + psiformattot(&(sstat->psi.memsome), "memsome", as, color, buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIMEMSTOT = {"PSIMEMSTOT", sysprt_PSIMEMSTOT}; +sys_printdef syspdef_PSIMEMSTOT = {"PSIMEMSTOT", sysprt_PSIMEMSTOT, NULL}; -char * -sysprt_PSIMEMFTOT(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIMEMFTOT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[32]; - psiformattot(&(sstat->psi.memfull), "memfull", q, color, buf, sizeof buf); + psiformattot(&(sstat->psi.memfull), "memfull", as, color, buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIMEMFTOT = {"PSIMEMFTOT", sysprt_PSIMEMFTOT}; +sys_printdef syspdef_PSIMEMFTOT = {"PSIMEMFTOT", sysprt_PSIMEMFTOT, NULL}; -char * -sysprt_PSIIOSTOT(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIIOSTOT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[32]; - psiformattot(&(sstat->psi.iosome), "iosome", q, color, buf, sizeof buf); + psiformattot(&(sstat->psi.iosome), "iosome", as, color, buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIIOSTOT = {"PSIIOSTOT", sysprt_PSIIOSTOT}; +sys_printdef syspdef_PSIIOSTOT = {"PSIIOSTOT", sysprt_PSIIOSTOT, NULL}; -char * -sysprt_PSIIOFTOT(void *p, void *q, int badness, int *color) +static char * +sysprt_PSIIOFTOT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; static char buf[32]; - psiformattot(&(sstat->psi.iofull), "iofull", q, color, buf, sizeof buf); + psiformattot(&(sstat->psi.iofull), "iofull", as, color, buf, sizeof buf); return buf; } -sys_printdef syspdef_PSIIOFTOT = {"PSIIOFTOT", sysprt_PSIIOFTOT}; +sys_printdef syspdef_PSIIOFTOT = {"PSIIOFTOT", sysprt_PSIIOFTOT, NULL}; /*******************************************************************/ -char * -sysprt_CONTNAME(void *p, void *q, int badness, int *color) +static char * +sysprt_CONTNAME(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[32] = "ctid "; *color = -1; @@ -1721,13 +2094,11 @@ return buf; } -sys_printdef syspdef_CONTNAME = {"CONTNAME", sysprt_CONTNAME}; +sys_printdef syspdef_CONTNAME = {"CONTNAME", sysprt_CONTNAME, NULL}; /*******************************************************************/ -char * -sysprt_CONTNPROC(void *p, void *q, int badness, int *color) +static char * +sysprt_CONTNPROC(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="nproc "; *color = -1; @@ -1737,13 +2108,11 @@ return buf; } -sys_printdef syspdef_CONTNPROC = {"CONTNPROC", sysprt_CONTNPROC}; +sys_printdef syspdef_CONTNPROC = {"CONTNPROC", sysprt_CONTNPROC, NULL}; /*******************************************************************/ -char * -sysprt_CONTCPU(void *p, void *q, int badness, int *color) +static char * +sysprt_CONTCPU(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]; float perc; @@ -1764,13 +2133,11 @@ return buf; } -sys_printdef syspdef_CONTCPU = {"CONTCPU", sysprt_CONTCPU}; +sys_printdef syspdef_CONTCPU = {"CONTCPU", sysprt_CONTCPU, NULL}; /*******************************************************************/ -char * -sysprt_CONTMEM(void *p, void *q, int badness, int *color) +static char * +sysprt_CONTMEM(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="mem "; *color = -1; @@ -1780,12 +2147,11 @@ return buf; } -sys_printdef syspdef_CONTMEM = {"CONTMEM", sysprt_CONTMEM}; +sys_printdef syspdef_CONTMEM = {"CONTMEM", sysprt_CONTMEM, NULL}; /*******************************************************************/ -char * -sysprt_DSKNAME(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKNAME(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[16]; char *pn; int len; @@ -1801,12 +2167,11 @@ return buf; } -sys_printdef syspdef_DSKNAME = {"DSKNAME", sysprt_DSKNAME}; +sys_printdef syspdef_DSKNAME = {"DSKNAME", sysprt_DSKNAME, NULL}; /*******************************************************************/ -char * -sysprt_DSKBUSY(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKBUSY(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; double perc; static char buf[16]="busy "; @@ -1822,12 +2187,11 @@ return buf; } -sys_printdef syspdef_DSKBUSY = {"DSKBUSY", sysprt_DSKBUSY}; +sys_printdef syspdef_DSKBUSY = {"DSKBUSY", sysprt_DSKBUSY, NULL}; /*******************************************************************/ -char * -sysprt_DSKNREAD(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKNREAD(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[16]="read "; *color = -1; @@ -1838,12 +2202,11 @@ return buf; } -sys_printdef syspdef_DSKNREAD = {"DSKNREAD", sysprt_DSKNREAD}; +sys_printdef syspdef_DSKNREAD = {"DSKNREAD", sysprt_DSKNREAD, NULL}; /*******************************************************************/ -char * -sysprt_DSKNWRITE(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKNWRITE(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[16]="write "; *color = -1; @@ -1854,12 +2217,48 @@ return buf; } -sys_printdef syspdef_DSKNWRITE = {"DSKNWRITE", sysprt_DSKNWRITE}; +sys_printdef syspdef_DSKNWRITE = {"DSKNWRITE", sysprt_DSKNWRITE, NULL}; /*******************************************************************/ -char * -sysprt_DSKKBPERWR(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKNDISC(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="discrd "; + + *color = -1; + + // value might be -1 in case not supported --> "?" + val2valstr(as->perdsk[as->index].ndisc, + buf+7, 5, as->avgval, as->nsecs); + return buf; +} + +static int +sysval_DSKNDISK(struct sstat *sstat) +{ + if (sstat->dsk.ndsk > 0 && sstat->dsk.dsk[0].ndisc != -1) + return 1; + else + return 0; +} + +sys_printdef syspdef_DSKNDISC = {"DSKNDISC", sysprt_DSKNDISC, sysval_DSKNDISK}; +/*******************************************************************/ +static char * +sysprt_DSKKBPERRD(struct sstat *sstat, extraparam *as, int badness, int *color) +{ + static char buf[16]="KiB/r "; + struct perdsk *dp = &(as->perdsk[as->index]); + + val2valstr(dp->nread > 0 ? dp->nrsect / dp->nread / 2 : 0, + buf+6, 6, 0, as->nsecs); + return buf; +} + +sys_printdef syspdef_DSKKBPERRD = {"DSKKBPERRD", sysprt_DSKKBPERRD, NULL}; +/*******************************************************************/ +static char * +sysprt_DSKKBPERWR(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[16]="KiB/w "; struct perdsk *dp = &(as->perdsk[as->index]); @@ -1868,26 +2267,26 @@ return buf; } -sys_printdef syspdef_DSKKBPERWR = {"DSKKBPERWR", sysprt_DSKKBPERWR}; +sys_printdef syspdef_DSKKBPERWR = {"DSKKBPERWR", sysprt_DSKKBPERWR, NULL}; /*******************************************************************/ -char * -sysprt_DSKKBPERRD(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKKBPERDS(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; - static char buf[16]="KiB/r "; + static char buf[16]="KiB/d ?"; struct perdsk *dp = &(as->perdsk[as->index]); - val2valstr(dp->nread > 0 ? dp->nrsect / dp->nread / 2 : 0, + if (dp->ndisc != -1) + val2valstr(dp->ndisc > 0 ? dp->ndsect/dp->ndisc/2 : 0, buf+6, 6, 0, as->nsecs); + return buf; } -sys_printdef syspdef_DSKKBPERRD = {"DSKKBPERRD", sysprt_DSKKBPERRD}; +sys_printdef syspdef_DSKKBPERDS = {"DSKKBPERDS", sysprt_DSKKBPERDS, sysval_DSKNDISK}; /*******************************************************************/ -char * -sysprt_DSKMBPERSECWR(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKMBPERSECWR(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[16]="MBw/s "; struct perdsk *dp = &(as->perdsk[as->index]); @@ -1897,12 +2296,11 @@ return buf; } -sys_printdef syspdef_DSKMBPERSECWR = {"DSKMBPERSECWR", sysprt_DSKMBPERSECWR}; +sys_printdef syspdef_DSKMBPERSECWR = {"DSKMBPERSECWR", sysprt_DSKMBPERSECWR, NULL}; /*******************************************************************/ -char * -sysprt_DSKMBPERSECRD(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKMBPERSECRD(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[16]="MBr/s "; struct perdsk *dp = &(as->perdsk[as->index]); @@ -1911,12 +2309,11 @@ return buf; } -sys_printdef syspdef_DSKMBPERSECRD = {"DSKMBPERSECRD", sysprt_DSKMBPERSECRD}; +sys_printdef syspdef_DSKMBPERSECRD = {"DSKMBPERSECRD", sysprt_DSKMBPERSECRD, NULL}; /*******************************************************************/ -char * -sysprt_DSKAVQUEUE(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKAVQUEUE(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; static char buf[16]="avq "; struct perdsk *dp = &(as->perdsk[as->index]); @@ -1925,169 +2322,152 @@ return buf; } -sys_printdef syspdef_DSKAVQUEUE = {"DSKAVQUEUE", sysprt_DSKAVQUEUE}; +sys_printdef syspdef_DSKAVQUEUE = {"DSKAVQUEUE", sysprt_DSKAVQUEUE, NULL}; /*******************************************************************/ -char * -sysprt_DSKAVIO(void *p, void *q, int badness, int *color) +static char * +sysprt_DSKAVIO(struct sstat *sstat, extraparam *as, int badness, int *color) { - extraparam *as=q; - static char buf[16]="avio "; - double tim = as->iotot > 0 ? + static char buf[32]="avio "; + double avioms = as->iotot > 0 ? (double)(as->perdsk[as->index].io_ms)/as->iotot:0.0; *color = -1; - if (tim >= 100.0) - { - sprintf(buf+5, "%4.0lf ms", tim); - } - else if (tim >= 10.0) - { - sprintf(buf+5, "%4.1lf ms", tim); - } - else if (tim >= 0.1) - { - sprintf(buf+5, "%4.2lf ms", tim); - } - else if (tim >= 0.01) - { - sprintf(buf+5, "%4.1lf µs", tim * 1000.0); - } - else if (tim >= 0.0001) - { - sprintf(buf+5, "%4.2lf µs", tim * 1000.0); - } - else - { - sprintf(buf+5, "%4.1lf ns", tim * 1000000.0); - } + if (avioms >= 9995.0) + { + val2valstr((unsigned long long)avioms / 1000, buf+5, 5, 0, 0); + sprintf(buf+10, " s"); + } + else if (avioms >= 99.95) + { + } + else if (avioms >= 9.995) + { + sprintf(buf+5, "%4.1lf ms", avioms); + } + else if (avioms >= 0.09995) + { + sprintf(buf+5, "%4.2lf ms", avioms); + } + else if (avioms >= 0.01) + { + sprintf(buf+5, "%4.1lf µs", avioms * 1000.0); + } + else if (avioms >= 0.0001) + { + sprintf(buf+5, "%4.2lf µs", avioms * 1000.0); + } + else + { + sprintf(buf+5, "%4.1lf ns", avioms * 1000000.0); + } return buf; } -sys_printdef syspdef_DSKAVIO = {"DSKAVIO", sysprt_DSKAVIO}; +sys_printdef syspdef_DSKAVIO = {"DSKAVIO", sysprt_DSKAVIO, NULL}; /*******************************************************************/ -char * -sysprt_NETTRANSPORT(void *p, void *notused, int badness, int *color) +static char * +sysprt_NETTRANSPORT(struct sstat *sstat, extraparam *notused, int badness, int *color) { return "transport "; } -sys_printdef syspdef_NETTRANSPORT = {"NETTRANSPORT", sysprt_NETTRANSPORT}; +sys_printdef syspdef_NETTRANSPORT = {"NETTRANSPORT", sysprt_NETTRANSPORT, NULL}; /*******************************************************************/ -char * -sysprt_NETTCPI(void *p, void *q, int badness, int *color) +static char * +sysprt_NETTCPI(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="tcpi "; val2valstr(sstat->net.tcp.InSegs, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETTCPI = {"NETTCPI", sysprt_NETTCPI}; +sys_printdef syspdef_NETTCPI = {"NETTCPI", sysprt_NETTCPI, NULL}; /*******************************************************************/ -char * -sysprt_NETTCPO(void *p, void *q, int badness, int *color) +static char * +sysprt_NETTCPO(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="tcpo "; val2valstr(sstat->net.tcp.OutSegs, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETTCPO = {"NETTCPO", sysprt_NETTCPO}; +sys_printdef syspdef_NETTCPO = {"NETTCPO", sysprt_NETTCPO, NULL}; /*******************************************************************/ -char * -sysprt_NETTCPACTOPEN(void *p, void *q, int badness, int *color) +static char * +sysprt_NETTCPACTOPEN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="tcpao "; val2valstr(sstat->net.tcp.ActiveOpens, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETTCPACTOPEN = {"NETTCPACTOPEN", sysprt_NETTCPACTOPEN}; +sys_printdef syspdef_NETTCPACTOPEN = {"NETTCPACTOPEN", sysprt_NETTCPACTOPEN, NULL}; /*******************************************************************/ -char * -sysprt_NETTCPPASVOPEN(void *p, void *q, int badness, int *color) +static char * +sysprt_NETTCPPASVOPEN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="tcppo "; val2valstr(sstat->net.tcp.PassiveOpens, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETTCPPASVOPEN = {"NETTCPPASVOPEN", sysprt_NETTCPPASVOPEN}; +sys_printdef syspdef_NETTCPPASVOPEN = {"NETTCPPASVOPEN", sysprt_NETTCPPASVOPEN, NULL}; /*******************************************************************/ -char * -sysprt_NETTCPRETRANS(void *p, void *q, int badness, int *color) +static char * +sysprt_NETTCPRETRANS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="tcprs "; val2valstr(sstat->net.tcp.RetransSegs, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETTCPRETRANS = {"NETTCPRETRANS", sysprt_NETTCPRETRANS}; +sys_printdef syspdef_NETTCPRETRANS = {"NETTCPRETRANS", sysprt_NETTCPRETRANS, NULL}; /*******************************************************************/ -char * -sysprt_NETTCPINERR(void *p, void *q, int badness, int *color) +static char * +sysprt_NETTCPINERR(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="tcpie "; val2valstr(sstat->net.tcp.InErrs, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETTCPINERR = {"NETTCPINERR", sysprt_NETTCPINERR}; +sys_printdef syspdef_NETTCPINERR = {"NETTCPINERR", sysprt_NETTCPINERR, NULL}; /*******************************************************************/ -char * -sysprt_NETTCPORESET(void *p, void *q, int badness, int *color) +static char * +sysprt_NETTCPORESET(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="tcpor "; val2valstr(sstat->net.tcp.OutRsts, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETTCPORESET = {"NETTCPORESET", sysprt_NETTCPORESET}; +sys_printdef syspdef_NETTCPORESET = {"NETTCPORESET", sysprt_NETTCPORESET, NULL}; /*******************************************************************/ -char * -sysprt_NETUDPNOPORT(void *p, void *q, int badness, int *color) +static char * +sysprt_NETUDPNOPORT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="udpnp "; val2valstr(sstat->net.udpv4.NoPorts, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETUDPNOPORT = {"NETUDPNOPORT", sysprt_NETUDPNOPORT}; +sys_printdef syspdef_NETUDPNOPORT = {"NETUDPNOPORT", sysprt_NETUDPNOPORT, NULL}; /*******************************************************************/ -char * -sysprt_NETUDPINERR(void *p, void *q, int badness, int *color) +static char * +sysprt_NETUDPINERR(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="udpie "; val2valstr(sstat->net.udpv4.InErrors, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETUDPINERR = {"NETUDPINERR", sysprt_NETUDPINERR}; +sys_printdef syspdef_NETUDPINERR = {"NETUDPINERR", sysprt_NETUDPINERR, NULL}; /*******************************************************************/ -char * -sysprt_NETUDPI(void *p, void *q, int badness, int *color) +static char * +sysprt_NETUDPI(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="udpi "; count_t udpin = sstat->net.udpv4.InDatagrams + sstat->net.udpv6.Udp6InDatagrams; @@ -2095,13 +2475,11 @@ return buf; } -sys_printdef syspdef_NETUDPI = {"NETUDPI", sysprt_NETUDPI}; +sys_printdef syspdef_NETUDPI = {"NETUDPI", sysprt_NETUDPI, NULL}; /*******************************************************************/ -char * -sysprt_NETUDPO(void *p, void *q, int badness, int *color) +static char * +sysprt_NETUDPO(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="udpo "; count_t udpout = sstat->net.udpv4.OutDatagrams + sstat->net.udpv6.Udp6OutDatagrams; @@ -2109,21 +2487,19 @@ return buf; } -sys_printdef syspdef_NETUDPO = {"NETUDPO", sysprt_NETUDPO}; +sys_printdef syspdef_NETUDPO = {"NETUDPO", sysprt_NETUDPO, NULL}; /*******************************************************************/ -char * -sysprt_NETNETWORK(void *p, void *notused, int badness, int *color) +static char * +sysprt_NETNETWORK(struct sstat *sstat, extraparam *notused, int badness, int *color) { return "network "; } -sys_printdef syspdef_NETNETWORK = {"NETNETWORK", sysprt_NETNETWORK}; +sys_printdef syspdef_NETNETWORK = {"NETNETWORK", sysprt_NETNETWORK, NULL}; /*******************************************************************/ -char * -sysprt_NETIPI(void *p, void *q, int badness, int *color) +static char * +sysprt_NETIPI(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="ipi "; count_t ipin = sstat->net.ipv4.InReceives + sstat->net.ipv6.Ip6InReceives; @@ -2131,13 +2507,11 @@ return buf; } -sys_printdef syspdef_NETIPI = {"NETIPI", sysprt_NETIPI}; +sys_printdef syspdef_NETIPI = {"NETIPI", sysprt_NETIPI, NULL}; /*******************************************************************/ -char * -sysprt_NETIPO(void *p, void *q, int badness, int *color) +static char * +sysprt_NETIPO(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="ipo "; count_t ipout = sstat->net.ipv4.OutRequests + sstat->net.ipv6.Ip6OutRequests; @@ -2145,13 +2519,11 @@ return buf; } -sys_printdef syspdef_NETIPO = {"NETIPO", sysprt_NETIPO}; +sys_printdef syspdef_NETIPO = {"NETIPO", sysprt_NETIPO, NULL}; /*******************************************************************/ -char * -sysprt_NETIPFRW(void *p, void *q, int badness, int *color) +static char * +sysprt_NETIPFRW(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="ipfrw "; count_t ipfrw = sstat->net.ipv4.ForwDatagrams + sstat->net.ipv6.Ip6OutForwDatagrams; @@ -2159,13 +2531,11 @@ return buf; } -sys_printdef syspdef_NETIPFRW = {"NETIPFRW", sysprt_NETIPFRW}; +sys_printdef syspdef_NETIPFRW = {"NETIPFRW", sysprt_NETIPFRW, NULL}; /*******************************************************************/ -char * -sysprt_NETIPDELIV(void *p, void *q, int badness, int *color) +static char * +sysprt_NETIPDELIV(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="deliv "; count_t ipindel = sstat->net.ipv4.InDelivers + sstat->net.ipv6.Ip6InDelivers; @@ -2173,13 +2543,11 @@ return buf; } -sys_printdef syspdef_NETIPDELIV = {"NETIPDELIV", sysprt_NETIPDELIV}; +sys_printdef syspdef_NETIPDELIV = {"NETIPDELIV", sysprt_NETIPDELIV, NULL}; /*******************************************************************/ -char * -sysprt_NETICMPIN(void *p, void *q, int badness, int *color) +static char * +sysprt_NETICMPIN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="icmpi "; count_t icmpin = sstat->net.icmpv4.InMsgs+ sstat->net.icmpv6.Icmp6InMsgs; @@ -2187,13 +2555,11 @@ return buf; } -sys_printdef syspdef_NETICMPIN = {"NETICMPIN", sysprt_NETICMPIN}; +sys_printdef syspdef_NETICMPIN = {"NETICMPIN", sysprt_NETICMPIN, NULL}; /*******************************************************************/ -char * -sysprt_NETICMPOUT(void *p, void *q, int badness, int *color) +static char * +sysprt_NETICMPOUT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="icmpo "; count_t icmpin = sstat->net.icmpv4.OutMsgs+ sstat->net.icmpv6.Icmp6OutMsgs; @@ -2201,13 +2567,11 @@ return buf; } -sys_printdef syspdef_NETICMPOUT = {"NETICMPOUT", sysprt_NETICMPOUT}; +sys_printdef syspdef_NETICMPOUT = {"NETICMPOUT", sysprt_NETICMPOUT, NULL}; /*******************************************************************/ -char * -sysprt_NETNAME(void *p, void *q, int badness, int *color) +static char * +sysprt_NETNAME(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; count_t busy; count_t ival = sstat->intf.intf[as->index].rbyte/125/as->nsecs; count_t oval = sstat->intf.intf[as->index].sbyte/125/as->nsecs; @@ -2266,13 +2630,11 @@ return buf; } -sys_printdef syspdef_NETNAME = {"NETNAME", sysprt_NETNAME}; +sys_printdef syspdef_NETNAME = {"NETNAME", sysprt_NETNAME, NULL}; /*******************************************************************/ -char * -sysprt_NETPCKI(void *p, void *q, int badness, int *color) +static char * +sysprt_NETPCKI(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="pcki "; *color = -1; @@ -2282,13 +2644,11 @@ return buf; } -sys_printdef syspdef_NETPCKI = {"NETPCKI", sysprt_NETPCKI}; +sys_printdef syspdef_NETPCKI = {"NETPCKI", sysprt_NETPCKI, NULL}; /*******************************************************************/ -char * -sysprt_NETPCKO(void *p, void *q, int badness, int *color) +static char * +sysprt_NETPCKO(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="pcko "; *color = -1; @@ -2298,14 +2658,14 @@ return buf; } -sys_printdef syspdef_NETPCKO = {"NETPCKO", sysprt_NETPCKO}; +sys_printdef syspdef_NETPCKO = {"NETPCKO", sysprt_NETPCKO, NULL}; /*******************************************************************/ /* ** convert byte-transfers to bit-transfers (* 8) ** convert bit-transfers to kilobit-transfers (/ 1000) ** per second */ -char *makenetspeed(count_t val, int nsecs) +static char *makenetspeed(count_t val, int nsecs) { char c; static char buf[16]="si ?bps"; @@ -2348,11 +2708,9 @@ return buf; } /*******************************************************************/ -char * -sysprt_NETSPEEDMAX(void *p, void *q, int badness, int *color) +static char * +sysprt_NETSPEEDMAX(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat = p; - extraparam *as = q; static char buf[16]; count_t speed = sstat->intf.intf[as->index].speed; @@ -2379,13 +2737,11 @@ return buf; } -sys_printdef syspdef_NETSPEEDMAX = {"NETSPEEDMAX", sysprt_NETSPEEDMAX}; +sys_printdef syspdef_NETSPEEDMAX = {"NETSPEEDMAX", sysprt_NETSPEEDMAX, NULL}; /*******************************************************************/ -char * -sysprt_NETSPEEDIN(void *p, void *q, int badness, int *color) +static char * +sysprt_NETSPEEDIN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; *color = -1; @@ -2395,13 +2751,11 @@ return ps; } -sys_printdef syspdef_NETSPEEDIN = {"NETSPEEDIN", sysprt_NETSPEEDIN}; +sys_printdef syspdef_NETSPEEDIN = {"NETSPEEDIN", sysprt_NETSPEEDIN, NULL}; /*******************************************************************/ -char * -sysprt_NETSPEEDOUT(void *p, void *q, int badness, int *color) +static char * +sysprt_NETSPEEDOUT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; *color = -1; @@ -2411,91 +2765,77 @@ return ps; } -sys_printdef syspdef_NETSPEEDOUT = {"NETSPEEDOUT", sysprt_NETSPEEDOUT}; +sys_printdef syspdef_NETSPEEDOUT = {"NETSPEEDOUT", sysprt_NETSPEEDOUT, NULL}; /*******************************************************************/ -char * -sysprt_NETCOLLIS(void *p, void *q, int badness, int *color) +static char * +sysprt_NETCOLLIS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="coll "; val2valstr(sstat->intf.intf[as->index].scollis, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETCOLLIS = {"NETCOLLIS", sysprt_NETCOLLIS}; +sys_printdef syspdef_NETCOLLIS = {"NETCOLLIS", sysprt_NETCOLLIS, NULL}; /*******************************************************************/ -char * -sysprt_NETMULTICASTIN(void *p, void *q, int badness, int *color) +static char * +sysprt_NETMULTICASTIN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="mlti "; val2valstr(sstat->intf.intf[as->index].rmultic, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETMULTICASTIN = {"NETMULTICASTIN", sysprt_NETMULTICASTIN}; +sys_printdef syspdef_NETMULTICASTIN = {"NETMULTICASTIN", sysprt_NETMULTICASTIN, NULL}; /*******************************************************************/ -char * -sysprt_NETRCVERR(void *p, void *q, int badness, int *color) +static char * +sysprt_NETRCVERR(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="erri "; val2valstr(sstat->intf.intf[as->index].rerrs, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETRCVERR = {"NETRCVERR", sysprt_NETRCVERR}; +sys_printdef syspdef_NETRCVERR = {"NETRCVERR", sysprt_NETRCVERR, NULL}; /*******************************************************************/ -char * -sysprt_NETSNDERR(void *p, void *q, int badness, int *color) +static char * +sysprt_NETSNDERR(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="erro "; val2valstr(sstat->intf.intf[as->index].serrs, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETSNDERR = {"NETSNDERR", sysprt_NETSNDERR}; +sys_printdef syspdef_NETSNDERR = {"NETSNDERR", sysprt_NETSNDERR, NULL}; /*******************************************************************/ -char * -sysprt_NETRCVDROP(void *p, void *q, int badness, int *color) +static char * +sysprt_NETRCVDROP(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="drpi "; val2valstr(sstat->intf.intf[as->index].rdrop, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETRCVDROP = {"NETRCVDROP", sysprt_NETRCVDROP}; +sys_printdef syspdef_NETRCVDROP = {"NETRCVDROP", sysprt_NETRCVDROP, NULL}; /*******************************************************************/ -char * -sysprt_NETSNDDROP(void *p, void *q, int badness, int *color) +static char * +sysprt_NETSNDDROP(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="drpo "; val2valstr(sstat->intf.intf[as->index].sdrop, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NETSNDDROP = {"NETSNDDROP", sysprt_NETSNDDROP}; +sys_printdef syspdef_NETSNDDROP = {"NETSNDDROP", sysprt_NETSNDDROP, NULL}; /*******************************************************************/ -char * -sysprt_IFBNAME(void *p, void *q, int badness, int *color) +static char * +sysprt_IFBNAME(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; count_t busy; count_t ival = sstat->ifb.ifb[as->index].rcvb/125/as->nsecs; count_t oval = sstat->ifb.ifb[as->index].sndb/125/as->nsecs; @@ -2520,13 +2860,11 @@ return buf; } -sys_printdef syspdef_IFBNAME = {"IFBNAME", sysprt_IFBNAME}; +sys_printdef syspdef_IFBNAME = {"IFBNAME", sysprt_IFBNAME, NULL}; /*******************************************************************/ -char * -sysprt_IFBPCKI(void *p, void *q, int badness, int *color) +static char * +sysprt_IFBPCKI(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="pcki "; *color = -1; @@ -2536,13 +2874,11 @@ return buf; } -sys_printdef syspdef_IFBPCKI = {"IFBPCKI", sysprt_IFBPCKI}; +sys_printdef syspdef_IFBPCKI = {"IFBPCKI", sysprt_IFBPCKI, NULL}; /*******************************************************************/ -char * -sysprt_IFBPCKO(void *p, void *q, int badness, int *color) +static char * +sysprt_IFBPCKO(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="pcko "; *color = -1; @@ -2552,13 +2888,11 @@ return buf; } -sys_printdef syspdef_IFBPCKO = {"IFBPCKO", sysprt_IFBPCKO}; +sys_printdef syspdef_IFBPCKO = {"IFBPCKO", sysprt_IFBPCKO, NULL}; /*******************************************************************/ -char * -sysprt_IFBSPEEDMAX(void *p, void *q, int badness, int *color) +static char * +sysprt_IFBSPEEDMAX(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat = p; - extraparam *as = q; static char buf[64]; count_t rate = sstat->ifb.ifb[as->index].rate; @@ -2582,25 +2916,21 @@ return buf; } -sys_printdef syspdef_IFBSPEEDMAX = {"IFBSPEEDMAX", sysprt_IFBSPEEDMAX}; +sys_printdef syspdef_IFBSPEEDMAX = {"IFBSPEEDMAX", sysprt_IFBSPEEDMAX, NULL}; /*******************************************************************/ -char * -sysprt_IFBLANES(void *p, void *q, int badness, int *color) +static char * +sysprt_IFBLANES(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat = p; - extraparam *as = q; static char buf[16]="lanes "; val2valstr(sstat->ifb.ifb[as->index].lanes, buf+6, 6, 0, 0); return buf; } -sys_printdef syspdef_IFBLANES = {"IFBLANES", sysprt_IFBLANES}; +sys_printdef syspdef_IFBLANES = {"IFBLANES", sysprt_IFBLANES, NULL}; /*******************************************************************/ -char * -sysprt_IFBSPEEDIN(void *p, void *q, int badness, int *color) +static char * +sysprt_IFBSPEEDIN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; *color = -1; @@ -2611,13 +2941,11 @@ return ps; } -sys_printdef syspdef_IFBSPEEDIN = {"IFBSPEEDIN", sysprt_IFBSPEEDIN}; +sys_printdef syspdef_IFBSPEEDIN = {"IFBSPEEDIN", sysprt_IFBSPEEDIN, NULL}; /*******************************************************************/ -char * -sysprt_IFBSPEEDOUT(void *p, void *q, int badness, int *color) +static char * +sysprt_IFBSPEEDOUT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; *color = -1; @@ -2628,13 +2956,11 @@ return ps; } -sys_printdef syspdef_IFBSPEEDOUT = {"IFBSPEEDOUT", sysprt_IFBSPEEDOUT}; +sys_printdef syspdef_IFBSPEEDOUT = {"IFBSPEEDOUT", sysprt_IFBSPEEDOUT, NULL}; /*******************************************************************/ -char * -sysprt_NFMSERVER(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMSERVER(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16] = "srv "; char mntdev[128], *ps; @@ -2650,13 +2976,11 @@ return buf; } -sys_printdef syspdef_NFMSERVER = {"NFMSERVER", sysprt_NFMSERVER}; +sys_printdef syspdef_NFMSERVER = {"NFMSERVER", sysprt_NFMSERVER, NULL}; /*******************************************************************/ -char * -sysprt_NFMPATH(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMPATH(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]; char mntdev[128], *ps; int len; @@ -2677,13 +3001,11 @@ return buf; } -sys_printdef syspdef_NFMPATH = {"NFMPATH", sysprt_NFMPATH}; +sys_printdef syspdef_NFMPATH = {"NFMPATH", sysprt_NFMPATH, NULL}; /*******************************************************************/ -char * -sysprt_NFMTOTREAD(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMTOTREAD(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="read "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].bytestotread, @@ -2691,13 +3013,11 @@ return buf; } -sys_printdef syspdef_NFMTOTREAD = {"NFMTOTREAD", sysprt_NFMTOTREAD}; +sys_printdef syspdef_NFMTOTREAD = {"NFMTOTREAD", sysprt_NFMTOTREAD, NULL}; /*******************************************************************/ -char * -sysprt_NFMTOTWRITE(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMTOTWRITE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="write "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].bytestotwrite, @@ -2705,13 +3025,11 @@ return buf; } -sys_printdef syspdef_NFMTOTWRITE = {"NFMTOTWRITE", sysprt_NFMTOTWRITE}; +sys_printdef syspdef_NFMTOTWRITE = {"NFMTOTWRITE", sysprt_NFMTOTWRITE, NULL}; /*******************************************************************/ -char * -sysprt_NFMNREAD(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMNREAD(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="nread "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].bytesread, @@ -2719,13 +3037,11 @@ return buf; } -sys_printdef syspdef_NFMNREAD = {"NFMNREAD", sysprt_NFMNREAD}; +sys_printdef syspdef_NFMNREAD = {"NFMNREAD", sysprt_NFMNREAD, NULL}; /*******************************************************************/ -char * -sysprt_NFMNWRITE(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMNWRITE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="nwrit "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].byteswrite, @@ -2733,13 +3049,11 @@ return buf; } -sys_printdef syspdef_NFMNWRITE = {"NFMNWRITE", sysprt_NFMNWRITE}; +sys_printdef syspdef_NFMNWRITE = {"NFMNWRITE", sysprt_NFMNWRITE, NULL}; /*******************************************************************/ -char * -sysprt_NFMDREAD(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMDREAD(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="dread "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].bytesdread, @@ -2747,13 +3061,11 @@ return buf; } -sys_printdef syspdef_NFMDREAD = {"NFMDREAD", sysprt_NFMDREAD}; +sys_printdef syspdef_NFMDREAD = {"NFMDREAD", sysprt_NFMDREAD, NULL}; /*******************************************************************/ -char * -sysprt_NFMDWRITE(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMDWRITE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="dwrit "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].bytesdwrite, @@ -2761,13 +3073,11 @@ return buf; } -sys_printdef syspdef_NFMDWRITE = {"NFMDWRITE", sysprt_NFMDWRITE}; +sys_printdef syspdef_NFMDWRITE = {"NFMDWRITE", sysprt_NFMDWRITE, NULL}; /*******************************************************************/ -char * -sysprt_NFMMREAD(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMMREAD(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="mread "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].pagesmread *pagesize, @@ -2775,13 +3085,11 @@ return buf; } -sys_printdef syspdef_NFMMREAD = {"NFMMREAD", sysprt_NFMMREAD}; +sys_printdef syspdef_NFMMREAD = {"NFMMREAD", sysprt_NFMMREAD, NULL}; /*******************************************************************/ -char * -sysprt_NFMMWRITE(void *p, void *q, int badness, int *color) +static char * +sysprt_NFMMWRITE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="mwrit "; val2memstr(sstat->nfs.nfsmounts.nfsmnt[as->index].pagesmwrite *pagesize, @@ -2789,182 +3097,154 @@ return buf; } -sys_printdef syspdef_NFMMWRITE = {"NFMMWRITE", sysprt_NFMMWRITE}; +sys_printdef syspdef_NFMMWRITE = {"NFMMWRITE", sysprt_NFMMWRITE, NULL}; /*******************************************************************/ -char * -sysprt_NFCRPCCNT(void *p, void *q, int badness, int *color) +static char * +sysprt_NFCRPCCNT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="rpc "; val2valstr(sstat->nfs.client.rpccnt, buf+4, 8, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFCRPCCNT = {"NFCRPCCNT", sysprt_NFCRPCCNT}; +sys_printdef syspdef_NFCRPCCNT = {"NFCRPCCNT", sysprt_NFCRPCCNT, NULL}; /*******************************************************************/ -char * -sysprt_NFCRPCREAD(void *p, void *q, int badness, int *color) +static char * +sysprt_NFCRPCREAD(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="read "; val2valstr(sstat->nfs.client.rpcread, buf+5, 7, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFCRPCREAD = {"NFCRPCREAD", sysprt_NFCRPCREAD}; +sys_printdef syspdef_NFCRPCREAD = {"NFCRPCREAD", sysprt_NFCRPCREAD, NULL}; /*******************************************************************/ -char * -sysprt_NFCRPCWRITE(void *p, void *q, int badness, int *color) +static char * +sysprt_NFCRPCWRITE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="write "; val2valstr(sstat->nfs.client.rpcwrite, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFCRPCWRITE = {"NFCRPCWRITE", sysprt_NFCRPCWRITE}; +sys_printdef syspdef_NFCRPCWRITE = {"NFCRPCWRITE", sysprt_NFCRPCWRITE, NULL}; /*******************************************************************/ -char * -sysprt_NFCRPCRET(void *p, void *q, int badness, int *color) +static char * +sysprt_NFCRPCRET(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="retxmit "; val2valstr(sstat->nfs.client.rpcretrans, buf+8, 4, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFCRPCRET = {"NFCRPCRET", sysprt_NFCRPCRET}; +sys_printdef syspdef_NFCRPCRET = {"NFCRPCRET", sysprt_NFCRPCRET, NULL}; /*******************************************************************/ -char * -sysprt_NFCRPCARF(void *p, void *q, int badness, int *color) +static char * +sysprt_NFCRPCARF(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="autref "; val2valstr(sstat->nfs.client.rpcautrefresh, buf+7, 5, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFCRPCARF = {"NFCRPCARF", sysprt_NFCRPCARF}; +sys_printdef syspdef_NFCRPCARF = {"NFCRPCARF", sysprt_NFCRPCARF, NULL}; /*******************************************************************/ -char * -sysprt_NFSRPCCNT(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSRPCCNT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="rpc "; val2valstr(sstat->nfs.server.rpccnt, buf+4, 8, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSRPCCNT = {"NFSRPCCNT", sysprt_NFSRPCCNT}; +sys_printdef syspdef_NFSRPCCNT = {"NFSRPCCNT", sysprt_NFSRPCCNT, NULL}; /*******************************************************************/ -char * -sysprt_NFSRPCREAD(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSRPCREAD(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="cread "; val2valstr(sstat->nfs.server.rpcread, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSRPCREAD = {"NFSRPCREAD", sysprt_NFSRPCREAD}; +sys_printdef syspdef_NFSRPCREAD = {"NFSRPCREAD", sysprt_NFSRPCREAD, NULL}; /*******************************************************************/ -char * -sysprt_NFSRPCWRITE(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSRPCWRITE(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="cwrit "; val2valstr(sstat->nfs.server.rpcwrite, buf+6, 6, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSRPCWRITE = {"NFSRPCWRITE", sysprt_NFSRPCWRITE}; +sys_printdef syspdef_NFSRPCWRITE = {"NFSRPCWRITE", sysprt_NFSRPCWRITE, NULL}; /*******************************************************************/ -char * -sysprt_NFSBADFMT(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSBADFMT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="badfmt "; val2valstr(sstat->nfs.server.rpcbadfmt, buf+7, 5, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSBADFMT = {"NFSBADFMT", sysprt_NFSBADFMT}; +sys_printdef syspdef_NFSBADFMT = {"NFSBADFMT", sysprt_NFSBADFMT, NULL}; /*******************************************************************/ -char * -sysprt_NFSBADAUT(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSBADAUT(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="badaut "; val2valstr(sstat->nfs.server.rpcbadaut, buf+7, 5, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSBADAUT = {"NFSBADAUT", sysprt_NFSBADAUT}; +sys_printdef syspdef_NFSBADAUT = {"NFSBADAUT", sysprt_NFSBADAUT, NULL}; /*******************************************************************/ -char * -sysprt_NFSBADCLN(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSBADCLN(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="badcln "; val2valstr(sstat->nfs.server.rpcbadcln, buf+7, 5, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSBADCLN = {"NFSBADCLN", sysprt_NFSBADCLN}; +sys_printdef syspdef_NFSBADCLN = {"NFSBADCLN", sysprt_NFSBADCLN, NULL}; /*******************************************************************/ -char * -sysprt_NFSNETTCP(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSNETTCP(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="nettcp "; val2valstr(sstat->nfs.server.nettcpcnt, buf+7, 5, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSNETTCP = {"NFSNETTCP", sysprt_NFSNETTCP}; +sys_printdef syspdef_NFSNETTCP = {"NFSNETTCP", sysprt_NFSNETTCP, NULL}; /*******************************************************************/ -char * -sysprt_NFSNETUDP(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSNETUDP(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="netudp "; val2valstr(sstat->nfs.server.netudpcnt, buf+7, 5, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSNETUDP = {"NFSNETUDP", sysprt_NFSNETUDP}; +sys_printdef syspdef_NFSNETUDP = {"NFSNETUDP", sysprt_NFSNETUDP, NULL}; /*******************************************************************/ -char * -sysprt_NFSNRBYTES(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSNRBYTES(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[32]="MBcr/s "; sprintf(buf+7, "%5.1lf", @@ -2973,13 +3253,11 @@ return buf; } -sys_printdef syspdef_NFSNRBYTES = {"NFSNRBYTES", sysprt_NFSNRBYTES}; +sys_printdef syspdef_NFSNRBYTES = {"NFSNRBYTES", sysprt_NFSNRBYTES, NULL}; /*******************************************************************/ -char * -sysprt_NFSNWBYTES(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSNWBYTES(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[32]="MBcw/s "; sprintf(buf+7, "%5.1lf", @@ -2988,51 +3266,45 @@ return buf; } -sys_printdef syspdef_NFSNWBYTES = {"NFSNWBYTES", sysprt_NFSNWBYTES}; +sys_printdef syspdef_NFSNWBYTES = {"NFSNWBYTES", sysprt_NFSNWBYTES, NULL}; /*******************************************************************/ -char * -sysprt_NFSRCHITS(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSRCHITS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="rchits "; val2valstr(sstat->nfs.server.rchits, buf+8, 4, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSRCHITS = {"NFSRCHITS", sysprt_NFSRCHITS}; +sys_printdef syspdef_NFSRCHITS = {"NFSRCHITS", sysprt_NFSRCHITS, NULL}; /*******************************************************************/ -char * -sysprt_NFSRCMISS(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSRCMISS(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="rcmiss "; val2valstr(sstat->nfs.server.rcmiss, buf+8, 4, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSRCMISS = {"NFSRCMISS", sysprt_NFSRCMISS}; +sys_printdef syspdef_NFSRCMISS = {"NFSRCMISS", sysprt_NFSRCMISS, NULL}; /*******************************************************************/ -char * -sysprt_NFSRCNOCA(void *p, void *q, int badness, int *color) +static char * +sysprt_NFSRCNOCA(struct sstat *sstat, extraparam *as, int badness, int *color) { - struct sstat *sstat=p; - extraparam *as=q; static char buf[16]="rcnoca "; val2valstr(sstat->nfs.server.rcnoca, buf+8, 4, as->avgval, as->nsecs); return buf; } -sys_printdef syspdef_NFSRCNOCA = {"NFSRCNOCA", sysprt_NFSRCNOCA}; +sys_printdef syspdef_NFSRCNOCA = {"NFSRCNOCA", sysprt_NFSRCNOCA, NULL}; /*******************************************************************/ -char * -sysprt_BLANKBOX(void *p, void *notused, int badness, int *color) +static char * +sysprt_BLANKBOX(struct sstat *sstat, extraparam *notused, int badness, int *color) { return " "; } -sys_printdef syspdef_BLANKBOX = {"BLANKBOX", sysprt_BLANKBOX}; +sys_printdef syspdef_BLANKBOX = {"BLANKBOX", sysprt_BLANKBOX, NULL}; diff -Nru atop-2.6.0/various.c atop-2.7.1/various.c --- atop-2.6.0/various.c 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/various.c 2022-01-08 11:49:00.000000000 +0000 @@ -486,11 +486,16 @@ #define ONETBYTE 1099511627776LL #define ONEPBYTE 1125899906842624LL -#define MAXBYTE 1024 -#define MAXKBYTE ONEKBYTE*99999L +#define MAXBYTE 999 +#define MAXKBYTE ONEKBYTE*999L +#define MAXKBYTE9 ONEKBYTE*9L #define MAXMBYTE ONEMBYTE*999L +#define MAXMBYTE9 ONEMBYTE*9L #define MAXGBYTE ONEGBYTE*999LL +#define MAXGBYTE9 ONEGBYTE*9LL #define MAXTBYTE ONETBYTE*999LL +#define MAXTBYTE9 ONETBYTE*9LL +#define MAXPBYTE9 ONEPBYTE*9LL char * val2memstr(count_t value, char *strvalue, int pformat, int avgval, int nsecs) @@ -516,31 +521,71 @@ */ if (avgval && nsecs) { - value /= nsecs; - verifyval = verifyval * 100 /nsecs; - basewidth -= 2; - suffix = "/s"; - } - + value = llround((double)((double)value/(double)nsecs)); + verifyval = llround((double)((double)verifyval/(double)nsecs)); + basewidth -= 2; + suffix = "/s"; + + if (verifyval <= MAXBYTE) /* bytes ? */ + aformat = BFORMAT; + else + if (verifyval <= MAXKBYTE9) /* kbytes 1-9 ? */ + aformat = KBFORMAT; + else + if (verifyval <= MAXKBYTE) /* kbytes ? */ + aformat = KBFORMAT_INT; + else + if (verifyval <= MAXMBYTE9) /* mbytes 1-9 ? */ + aformat = MBFORMAT; + else + if (verifyval <= MAXMBYTE) /* mbytes 10-999 ? */ + aformat = MBFORMAT_INT; + else + if (verifyval <= MAXGBYTE9) /* gbytes 1-9 ? */ + aformat = GBFORMAT; + else + if (verifyval <= MAXGBYTE) /* gbytes 10-999 ? */ + aformat = GBFORMAT_INT; + else + if (verifyval <= MAXTBYTE9)/* tbytes 1-9 ? */ + aformat = TBFORMAT;/* tbytes! */ + else + if (verifyval <= MAXTBYTE)/* tbytes 10-999? */ + aformat = TBFORMAT_INT;/* tbytes! */ + else + if (verifyval <= MAXPBYTE9)/* pbytes 1-9 ? */ + aformat = PBFORMAT;/* pbytes! */ + else + aformat = PBFORMAT_INT;/* pbytes! */ + + } else /* - ** determine which format will be used on bases of the value itself + ** printed value per interval (normal mode) */ - if (verifyval <= MAXBYTE) /* bytes ? */ - aformat = ANYFORMAT; - else - if (verifyval <= MAXKBYTE) /* kbytes ? */ - aformat = KBFORMAT; + { + /* + ** determine which format will be used on bases of the value itself + */ + if (verifyval <= MAXBYTE) /* bytes ? */ + aformat = BFORMAT; else - if (verifyval <= MAXMBYTE) /* mbytes ? */ - aformat = MBFORMAT; + if (verifyval <= MAXKBYTE) /* kbytes ? */ + aformat = KBFORMAT; else - if (verifyval <= MAXGBYTE) /* gbytes ? */ - aformat = GBFORMAT; + if (verifyval <= MAXMBYTE) /* mbytes ? */ + aformat = MBFORMAT; else - if (verifyval <= MAXTBYTE)/* tbytes? */ - aformat = TBFORMAT;/* tbytes! */ + if (verifyval <= MAXGBYTE) /* gbytes ? */ + aformat = GBFORMAT; else - aformat = PBFORMAT;/* pbytes! */ + if (verifyval <= MAXTBYTE)/* tbytes? */ + aformat = TBFORMAT;/* tbytes! */ + else + aformat = PBFORMAT;/* pbytes! */ + + + } + /* ** check if this is also the preferred format @@ -550,14 +595,19 @@ switch (aformat) { - case ANYFORMAT: - sprintf(strvalue, "%*lld%s", - basewidth, value, suffix); + case BFORMAT: + sprintf(strvalue, "%*lldB%s", + basewidth-1, value, suffix); break; case KBFORMAT: + sprintf(strvalue, "%*.1lfK%s", + basewidth-1, (double)((double)value/ONEKBYTE), suffix); + break; + + case KBFORMAT_INT: sprintf(strvalue, "%*lldK%s", - basewidth-1, value/ONEKBYTE, suffix); + basewidth-1, llround((double)((double)value/ONEKBYTE)), suffix); break; case MBFORMAT: @@ -565,21 +615,41 @@ basewidth-1, (double)((double)value/ONEMBYTE), suffix); break; + case MBFORMAT_INT: + sprintf(strvalue, "%*lldM%s", + basewidth-1, llround((double)((double)value/ONEMBYTE)), suffix); + break; + case GBFORMAT: sprintf(strvalue, "%*.1lfG%s", basewidth-1, (double)((double)value/ONEGBYTE), suffix); break; + case GBFORMAT_INT: + sprintf(strvalue, "%*lldG%s", + basewidth-1, llround((double)((double)value/ONEGBYTE)), suffix); + break; + case TBFORMAT: sprintf(strvalue, "%*.1lfT%s", basewidth-1, (double)((double)value/ONETBYTE), suffix); break; + case TBFORMAT_INT: + sprintf(strvalue, "%*lldT%s", + basewidth-1, llround((double)((double)value/ONETBYTE)), suffix); + break; + case PBFORMAT: sprintf(strvalue, "%*.1lfP%s", basewidth-1, (double)((double)value/ONEPBYTE), suffix); break; + case PBFORMAT_INT: + sprintf(strvalue, "%*lldP%s", + basewidth-1, llround((double)((double)value/ONEPBYTE)), suffix); + break; + default: sprintf(strvalue, "!TILT!"); } diff -Nru atop-2.6.0/versdate.h atop-2.7.1/versdate.h --- atop-2.6.0/versdate.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/versdate.h 2022-01-08 11:49:00.000000000 +0000 @@ -1 +1 @@ -#define ATOPDATE "2020/12/21 20:45:10" +#define ATOPDATE "2022/01/08 12:48:36" diff -Nru atop-2.6.0/version.h atop-2.7.1/version.h --- atop-2.6.0/version.h 2020-12-21 19:57:55.000000000 +0000 +++ atop-2.7.1/version.h 2022-01-08 11:49:00.000000000 +0000 @@ -1 +1 @@ -#define ATOPVERS "2.6.0" +#define ATOPVERS "2.7.1"