summaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-01-27 15:11:37 +0100
committerBenBE <BenBE@geshi.org>2021-01-30 14:21:26 +0100
commit03d6345c891b93b4658481f891fa2af5ce1c951b (patch)
tree889989b087659b88a02d55594d755a3904fe41d4 /Process.h
parent93378b9ee5de9b1087dea259c3d5f98fc941bb0a (diff)
Process: document process fields
Drop unused fields 'flags' and 'exit_signal'
Diffstat (limited to 'Process.h')
-rw-r--r--Process.h123
1 files changed, 105 insertions, 18 deletions
diff --git a/Process.h b/Process.h
index d283f592..d6d323ce 100644
--- a/Process.h
+++ b/Process.h
@@ -56,55 +56,131 @@ typedef enum ProcessField_ {
struct Settings_;
typedef struct Process_ {
+ /* Super object for emulated OOP */
Object super;
+ /* Pointer to quasi-global data structures */
const struct ProcessList_* processList;
const struct Settings_* settings;
+ /* Process runtime (in hundredth of a second) */
unsigned long long int time;
+
+ /* Process identifier */
pid_t pid;
+
+ /* Parent process identifier */
pid_t ppid;
- pid_t tgid;
- char* comm; /* use Process_getCommand() for Command actually displayed */
- int indent;
- int basenameOffset;
- bool updated;
+ /* Thread group identifier */
+ pid_t tgid;
- char state;
- bool tag;
- bool showChildren;
- bool show;
- bool wasShown;
+ /* Process group identifier */
unsigned int pgrp;
+
+ /* Session identifier */
unsigned int session;
- unsigned int tty_nr;
+
+ /* Foreground group identifier of the controlling terminal */
int tpgid;
+
+ /*
+ * Controlling terminal of the process.
+ * The minor device number is contained in the combination of bits 31 to 20 and 7 to 0; the major device number is in bits 15 to 8.
+ * */
+ unsigned int tty_nr;
+
+ /* User identifier */
uid_t st_uid;
- unsigned long int flags;
+
+ /* User name */
+ const char* user;
+
+ /*
+ * Process name including arguments.
+ * Use Process_getCommand() for Command actually displayed.
+ */
+ char* comm;
+
+ /* Offset in comm of the process basename */
+ int basenameOffset;
+
+ /* CPU number last executed on */
int processor;
+ /* CPU usage during last cycle (in percent) */
float percent_cpu;
+
+ /* Memory usage during last cycle (in percent) */
float percent_mem;
- const char* user;
+ /* Scheduling priority */
long int priority;
+
+ /* Nice value */
long int nice;
+
+ /* Number of threads in this process */
long int nlwp;
- char starttime_show[8];
+
+ /* Process start time (in seconds elapsed since the Epoch) */
time_t starttime_ctime;
+ /* Process start time (cached formatted string) */
+ char starttime_show[8];
+
+ /* Total program size (in kilobytes) */
long m_virt;
+
+ /* Resident set size (in kilobytes) */
long m_resident;
- int exit_signal;
+ /* Number of minor faults the process has made which have not required loading a memory page from disk */
+ unsigned long int minflt;
+
+ /* Number of major faults the process has made which have required loading a memory page from disk */
+ unsigned long int majflt;
+
+ /*
+ * Process state (platform dependent):
+ * D - Waiting
+ * I - Idle
+ * L - Acquiring lock
+ * R - Running
+ * S - Sleeping
+ * T - Stopped (on a signal)
+ * X - Dead
+ * Z - Zombie
+ * t - Tracing stop
+ * ? - Unknown
+ */
+ char state;
+
+ /* Whether the process was updated during the current scan */
+ bool updated;
+
+ /* Whether the process was tagged by the user */
+ bool tag;
+
+ /* Whether to display this process */
+ bool show;
+
+ /* Whether this process was shown last cycle */
+ bool wasShown;
+ /* Whether to show children of this process in tree-mode */
+ bool showChildren;
+
+ /*
+ * Internal time counts for showing new and exited processes.
+ */
time_t seenTs;
time_t tombTs;
- unsigned long int minflt;
- unsigned long int majflt;
-
+ /*
+ * Internal state for tree-mode.
+ */
+ int indent;
unsigned int tree_left;
unsigned int tree_right;
unsigned int tree_depth;
@@ -112,11 +188,22 @@ typedef struct Process_ {
} Process;
typedef struct ProcessFieldData_ {
+ /* Name (displayed in setup menu) */
const char* name;
+
+ /* Title (display in main screen); must have same width as the printed values */
const char* title;
+
+ /* Description (displayed in setup menu) */
const char* description;
+
+ /* Scan flag to enable scan-method otherwise not run */
uint32_t flags;
+
+ /* Whether the values are process identifies; adjusts the width of title and values if true */
bool pidColumn;
+
+ /* Whether the column should be sorted in descending order by default */
bool defaultSortDesc;
} ProcessFieldData;

© 2014-2024 Faster IT GmbH | imprint | privacy policy