summaryrefslogtreecommitdiffstats
path: root/linux/LinuxProcess.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-01-10 19:40:04 +0100
committerBenBE <BenBE@geshi.org>2023-02-05 00:17:33 +0100
commitda494896914a327476ab7e0298619d742a6205d4 (patch)
tree700db7b14d148c492b1fb0295462fee2214239ed /linux/LinuxProcess.c
parentf1da8cfa28cce46cc7a4ab1661be35e2173155ab (diff)
Add support for scheduling policies
Add a process column for scheduling policy to show the current scheduling policy of the process. Add a the ability to change the scheduling policy of a process via the key 'Y'. Currently implemented on Linux and FreeBSD only but should be portable, since sched_getscheduler(2) is part of POSIX.1-2001. Closes: #1161
Diffstat (limited to 'linux/LinuxProcess.c')
-rw-r--r--linux/LinuxProcess.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index 381b7cf5..8f9c3462 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -19,6 +19,7 @@ in the source distribution for its full text.
#include "Process.h"
#include "ProvideCurses.h"
#include "RichString.h"
+#include "Scheduling.h"
#include "XUtils.h"
#include "linux/IOPriority.h"
@@ -100,6 +101,9 @@ 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, },
+#ifdef SCHEDULER_SUPPORT
+ [SCHEDULERPOLICY] = { .name = "SCHEDULERPOLICY", .title = "SCHED ", .description = "Current scheduling policy of the process", .flags = PROCESS_FLAG_SCHEDPOL, },
+#endif
};
Process* LinuxProcess_new(const Settings* settings) {

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