summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-09-21 12:30:25 +0200
committercgzones <cgzones@googlemail.com>2020-11-25 20:49:39 +0100
commitc88c80e3bd0c858e4909412743064a4a1ed211b5 (patch)
tree185144437fc1ba7266d97fb31bad4ef0bac4a081 /linux
parent267014cbfe584ff9a1bc74d671f8aaa27251fd49 (diff)
Drop cgroup conditional
cgroup is only checked on runtime if the column CGROUP is selected. cgroup is currently disabled by default, but most distributions do enable it. Drop the cgroup configuration switch, to reduce the maintenance cost.
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcess.c8
-rw-r--r--linux/LinuxProcess.h4
-rw-r--r--linux/LinuxProcessList.c6
3 files changed, 0 insertions, 18 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index 3eaa6cbe..8cd59a5b 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -102,9 +102,7 @@ ProcessFieldData Process_fields[] = {
[IO_WRITE_RATE] = { .name = "IO_WRITE_RATE", .title = " DISK WRITE ", .description = "The I/O rate of write(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, },
[IO_RATE] = { .name = "IO_RATE", .title = " DISK R/W ", .description = "Total I/O rate in bytes per second", .flags = PROCESS_FLAG_IO, },
#endif
-#ifdef HAVE_CGROUP
[CGROUP] = { .name = "CGROUP", .title = " CGROUP ", .description = "Which cgroup the process is in", .flags = PROCESS_FLAG_LINUX_CGROUP, },
-#endif
[OOM] = { .name = "OOM", .title = " OOM ", .description = "OOM (Out-of-Memory) killer score", .flags = PROCESS_FLAG_LINUX_OOM, },
[IO_PRIORITY] = { .name = "IO_PRIORITY", .title = "IO ", .description = "I/O priority", .flags = PROCESS_FLAG_LINUX_IOPRIO, },
#ifdef HAVE_DELAYACCT
@@ -156,9 +154,7 @@ Process* LinuxProcess_new(const Settings* settings) {
void Process_delete(Object* cast) {
LinuxProcess* this = (LinuxProcess*) cast;
Process_done((Process*)cast);
-#ifdef HAVE_CGROUP
free(this->cgroup);
-#endif
#ifdef HAVE_OPENVZ
free(this->ctid);
#endif
@@ -680,9 +676,7 @@ static void LinuxProcess_writeField(const Process* this, RichString* str, Proces
#ifdef HAVE_VSERVER
case VXID: xSnprintf(buffer, n, "%5u ", lp->vxid); break;
#endif
- #ifdef HAVE_CGROUP
case CGROUP: xSnprintf(buffer, n, "%-10s ", lp->cgroup ? lp->cgroup : ""); break;
- #endif
case OOM: xSnprintf(buffer, n, "%4u ", lp->oom); break;
case IO_PRIORITY: {
int klass = IOPriority_class(lp->ioPriority);
@@ -821,10 +815,8 @@ static long LinuxProcess_compare(const void* v1, const void* v2) {
case VXID:
return SPACESHIP_NUMBER(p2->vxid, p1->vxid);
#endif
- #ifdef HAVE_CGROUP
case CGROUP:
return SPACESHIP_NULLSTR(p1->cgroup, p2->cgroup);
- #endif
case OOM:
return SPACESHIP_NUMBER(p2->oom, p1->oom);
#ifdef HAVE_DELAYACCT
diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h
index f5f33a77..d843a0c8 100644
--- a/linux/LinuxProcess.h
+++ b/linux/LinuxProcess.h
@@ -80,9 +80,7 @@ typedef enum LinuxProcessFields {
IO_WRITE_RATE = 111,
IO_RATE = 112,
#endif
- #ifdef HAVE_CGROUP
CGROUP = 113,
- #endif
OOM = 114,
IO_PRIORITY = 115,
#ifdef HAVE_DELAYACCT
@@ -170,9 +168,7 @@ typedef struct LinuxProcess_ {
#ifdef HAVE_VSERVER
unsigned int vxid;
#endif
- #ifdef HAVE_CGROUP
char* cgroup;
- #endif
unsigned int oom;
char* ttyDevice;
#ifdef HAVE_DELAYACCT
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 8dafb681..506bea66 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -644,8 +644,6 @@ static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* d
#endif
-#ifdef HAVE_CGROUP
-
static void LinuxProcessList_readCGroupFile(LinuxProcess* process, const char* dirname, const char* name) {
char filename[MAX_NAME + 1];
xSnprintf(filename, MAX_NAME, "%s/%s/cgroup", dirname, name);
@@ -684,8 +682,6 @@ static void LinuxProcessList_readCGroupFile(LinuxProcess* process, const char* d
process->cgroup = xStrdup(output);
}
-#endif
-
#ifdef HAVE_VSERVER
static void LinuxProcessList_readVServerData(LinuxProcess* process, const char* dirname, const char* name) {
@@ -1294,11 +1290,9 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
LinuxProcessList_readDelayAcctData(this, lp);
#endif
- #ifdef HAVE_CGROUP
if (settings->flags & PROCESS_FLAG_LINUX_CGROUP) {
LinuxProcessList_readCGroupFile(lp, dirname, name);
}
- #endif
if (settings->flags & PROCESS_FLAG_LINUX_OOM) {
LinuxProcessList_readOomData(lp, dirname, name);

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