"Fossies" - the Fresh Open Source Software Archive 
Member "atop-2.8.1/showgeneric.h" (7 Jan 2023, 3901 Bytes) of package /linux/misc/atop-2.8.1.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "showgeneric.h" see the
Fossies "Dox" file reference documentation and the last
Fossies "Diffs" side-by-side code changes report:
2.7.1_vs_2.8.0.
1 /*
2 ** ATOP - System & Process Monitor
3 **
4 ** The program 'atop' offers the possibility to view the activity of
5 ** the system on system-level as well as process-level.
6 **
7 ** Include-file describing prototypes and structures for visualization
8 ** of counters.
9 ** ================================================================
10 ** Author: Gerlof Langeveld
11 ** E-mail: gerlof.langeveld@atoptool.nl
12 ** Date: July 2002
13 **
14 ** This program is free software; you can redistribute it and/or modify it
15 ** under the terms of the GNU General Public License as published by the
16 ** Free Software Foundation; either version 2, or (at your option) any
17 ** later version.
18 **
19 ** This program is distributed in the hope that it will be useful, but
20 ** WITHOUT ANY WARRANTY; without even the implied warranty of
21 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 ** See the GNU General Public License for more details.
23 */
24 #define USERSTUB 9999999
25 #define MAXUSERSEL 64
26 #define MAXPID 32
27
28 struct syscap {
29 int nrcpu;
30 count_t availcpu;
31 count_t availmem;
32 count_t availdsk;
33 count_t availnet;
34 int nrgpu;
35 count_t availgpumem; // GPU memory in Kb!
36 int nrmemnuma;
37 int nrcpunuma;
38 };
39
40 struct pselection {
41 char username[256];
42 uid_t userid[MAXUSERSEL];
43
44 pid_t pid[MAXPID];
45
46 char progname[64];
47 int prognamesz;
48 regex_t progregex;
49
50 char argname[64];
51 int argnamesz;
52 regex_t argregex;
53
54 char container[16];
55
56 char states[16];
57 };
58
59 struct sselection {
60 char lvmname[64]; // logical volume selection
61 int lvmnamesz;
62 regex_t lvmregex;
63
64 char dskname[64]; // disk selection
65 int dsknamesz;
66 regex_t dskregex;
67
68 char itfname[64]; // network interface selection
69 int itfnamesz;
70 regex_t itfregex;
71 };
72
73 /*
74 ** color names
75 */
76 #define COLORINFO 2
77 #define COLORALMOST 3
78 #define COLORCRIT 4
79 #define COLORTHR 5
80
81 /*
82 ** list with keystrokes/flags
83 */
84 #define MPROCGEN 'g'
85 #define MPROCMEM 'm'
86 #define MPROCDSK 'd'
87 #define MPROCNET 'n'
88 #define MPROCGPU 'e'
89 #define MPROCSCH 's'
90 #define MPROCVAR 'v'
91 #define MPROCARG 'c'
92 #define MPROCCGR 'X'
93 #define MPROCOWN 'o'
94
95 #define MCUMUSER 'u'
96 #define MCUMPROC 'p'
97 #define MCUMCONT 'j'
98
99 #define MSORTCPU 'C'
100 #define MSORTDSK 'D'
101 #define MSORTMEM 'M'
102 #define MSORTNET 'N'
103 #define MSORTGPU 'E'
104 #define MSORTAUTO 'A'
105
106 #define MTHREAD 'y'
107 #define MTHRSORT 'Y'
108 #define MCALCPSS 'R'
109 #define MGETWCHAN 'W'
110 #define MSUPEXITS 'G'
111 #define MCOLORS 'x'
112 #define MSYSFIXED 'f'
113 #define MSYSNOSORT 'F'
114 #define MSYSLIMIT 'l'
115 #define MRMSPACES 'Z'
116
117 #define MSELUSER 'U'
118 #define MSELPROC 'P'
119 #define MSELCONT 'J'
120 #define MSELPID 'I'
121 #define MSELARG '/'
122 #define MSELSTATE 'Q'
123 #define MSELSYS 'S'
124
125 #define MALLPROC 'a'
126 #define MKILLPROC 'k'
127 #define MLISTFW 0x06
128 #define MLISTBW 0x02
129 #define MREDRAW 0x0c
130 #define MINTERVAL 'i'
131 #define MPAUSE 'z'
132 #define MQUIT 'q'
133 #define MRESET 'r'
134 #define MSAMPNEXT 't'
135 #define MSAMPPREV 'T'
136 #define MSAMPBRANCH 'b'
137 #define MVERSION 'V'
138 #define MAVGVAL '1'
139 #define MHELP1 '?'
140 #define MHELP2 'h'
141
142 /*
143 ** general function prototypes
144 */
145 void totalcap (struct syscap *, struct sstat *, struct tstat **, int);
146 void pricumproc (struct sstat *, struct devtstat *,
147 int, unsigned int, int, int);
148
149 void showgenproc(struct tstat *, double, int, int);
150 void showmemproc(struct tstat *, double, int, int);
151 void showdskproc(struct tstat *, double, int, int);
152 void shownetproc(struct tstat *, double, int, int);
153 void showvarproc(struct tstat *, double, int, int);
154 void showschproc(struct tstat *, double, int, int);
155 void showtotproc(struct tstat *, double, int, int);
156 void showcmdproc(struct tstat *, double, int, int);
157
158 void printg (const char *, ...);
159 int prisyst(struct sstat *, int, int, int, int, struct sselection *,
160 char *, int, int, int, int, int, int, int, int, int, int, int);
161 int priproc(struct tstat **, int, int, int, int, int, char, char,
162 struct syscap *, int, int);
163 void priphead(int, int, char *, char *, char, count_t);