diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-01-10 19:40:04 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-02-05 00:17:33 +0100 |
commit | da494896914a327476ab7e0298619d742a6205d4 (patch) | |
tree | 700db7b14d148c492b1fb0295462fee2214239ed /Process.h | |
parent | f1da8cfa28cce46cc7a4ab1661be35e2173155ab (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.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |