summaryrefslogtreecommitdiffstats
path: root/Process.h
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 /Process.h
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 'Process.h')
-rw-r--r--Process.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Process.h b/Process.h
index eb79470d..0fdc392b 100644
--- a/Process.h
+++ b/Process.h
@@ -19,6 +19,7 @@ in the source distribution for its full text.
#define PROCESS_FLAG_IO 0x00000001
#define PROCESS_FLAG_CWD 0x00000002
+#define PROCESS_FLAG_SCHEDPOL 0x00000004
#define DEFAULT_HIGHLIGHT_SECS 5
@@ -49,6 +50,7 @@ typedef enum ProcessField_ {
TGID = 52,
PERCENT_NORM_CPU = 53,
ELAPSED = 54,
+ SCHEDULERPOLICY = 55,
PROC_COMM = 124,
PROC_EXE = 125,
CWD = 126,
@@ -221,6 +223,9 @@ typedef struct Process_ {
/* Process state enum field (platform dependent) */
ProcessState state;
+ /* Current scheduling policy */
+ int scheduling_policy;
+
/* Whether the process was updated during the current scan */
bool updated;

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