summaryrefslogtreecommitdiffstats
path: root/linux/LinuxProcess.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-01-09 23:10:03 +0100
committercgzones <cgzones@googlemail.com>2024-04-06 19:42:28 +0200
commit85c3c3a88a000481254e01740ad396143ac2bca1 (patch)
treee5fc5a3aa49e461708a74f241c569ae0b1d40433 /linux/LinuxProcess.c
parent22d25db4678b844842af516c0f2d117382f7c632 (diff)
Linux: add process column whether it is marked a container process
Might be useful for some users and for debugging the hideRunningInContainer detection.
Diffstat (limited to 'linux/LinuxProcess.c')
-rw-r--r--linux/LinuxProcess.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index b97a9ad7..61fb10e9 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -106,6 +106,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
[CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, },
[AUTOGROUP_ID] = { .name = "AUTOGROUP_ID", .title = "AGRP", .description = "The autogroup identifier of the process", .flags = PROCESS_FLAG_LINUX_AUTOGROUP, },
[AUTOGROUP_NICE] = { .name = "AUTOGROUP_NICE", .title = " ANI", .description = "Nice value (the higher the value, the more other processes take priority) associated with the process autogroup", .flags = PROCESS_FLAG_LINUX_AUTOGROUP, },
+ [ISCONTAINER] = { .name = "ISCONTAINER", .title = "CONT ", .description = "Whether the process is running inside a child container", .flags = PROCESS_FLAG_LINUX_CONTAINER, },
#ifdef SCHEDULER_SUPPORT
[SCHEDULERPOLICY] = { .name = "SCHEDULERPOLICY", .title = "SCHED ", .description = "Current scheduling policy of the process", .flags = PROCESS_FLAG_SCHEDPOL, },
#endif
@@ -336,6 +337,19 @@ static void LinuxProcess_rowWriteField(const Row* super, RichString* str, Proces
xSnprintf(buffer, n, "N/A ");
}
break;
+ case ISCONTAINER:
+ switch (this->isRunningInContainer) {
+ case TRI_ON:
+ xSnprintf(buffer, n, "YES ");
+ break;
+ case TRI_OFF:
+ xSnprintf(buffer, n, "NO ");
+ break;
+ default:
+ attr = CRT_colors[PROCESS_SHADOW];
+ xSnprintf(buffer, n, "N/A ");
+ }
+ break;
default:
Process_writeField(this, str, field);
return;
@@ -438,6 +452,8 @@ static int LinuxProcess_compareByKey(const Process* v1, const Process* v2, Proce
}
case GPU_TIME:
return SPACESHIP_NUMBER(p1->gpu_time, p2->gpu_time);
+ case ISCONTAINER:
+ return SPACESHIP_NUMBER(v1->isRunningInContainer, v2->isRunningInContainer);
default:
return Process_compareByKey_Base(v1, v2, key);
}

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