From da494896914a327476ab7e0298619d742a6205d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 10 Jan 2023 19:40:04 +0100 Subject: 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 --- Process.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Process.h') 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; -- cgit v1.2.3