diff options
author | Narendran Gopalakrishnan <g_narendran142@yahoo.com> | 2020-10-17 16:24:45 +0530 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-11-24 19:05:48 +0100 |
commit | 09fe94da18d33d2c4e1fe415e8346fa99b9944b4 (patch) | |
tree | d5d405e4bfdbbe8e4940ffe92f8b50def3cb6122 /linux/LinuxProcess.h | |
parent | 42c842c190912de58ccf3f41bd58c452c595e40d (diff) |
Improving Command display/sort
Diffstat (limited to 'linux/LinuxProcess.h')
-rw-r--r-- | linux/LinuxProcess.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h index 6116808e..88da78f1 100644 --- a/linux/LinuxProcess.h +++ b/linux/LinuxProcess.h @@ -95,11 +95,42 @@ typedef enum LinuxProcessFields { M_PSSWP = 121, CTXT = 122, SECATTR = 123, - LAST_PROCESSFIELD = 124, + PROC_COMM = 124, + PROC_EXE = 125, + LAST_PROCESSFIELD = 126, } LinuxProcessField; +/* LinuxProcessMergedCommand is populated by LinuxProcess_makeCommandStr: It + * contains the merged Command string, and the information needed by + * LinuxProcess_writeCommand to color the string. str will be NULL for kernel + * threads and zombies */ +typedef struct LinuxProcessMergedCommand_ { + char *str; /* merged Command string */ + int maxLen; /* maximum expected length of Command string */ + int baseStart; /* basename's start offset */ + int baseEnd; /* basename's end offset */ + int commStart; /* comm's start offset */ + int commEnd; /* comm's end offset */ + bool separateComm; /* whether comm is a separate field */ + bool unmatchedExe; /* whether exe matched with cmdline */ + bool cmdlineChanged; /* whether cmdline changed */ + bool exeChanged; /* whether exe changed */ + bool commChanged; /* whether comm changed */ + bool prevMergeSet; /* whether showMergedCommand was set */ + bool prevPathSet; /* whether showProgramPath was set */ + bool prevCommSet; /* whether findCommInCmdline was set */ + bool prevCmdlineSet; /* whether findCommInCmdline was set */ +} LinuxProcessMergedCommand; + typedef struct LinuxProcess_ { Process super; + char *procComm; + char *procExe; + int procExeLen; + int procExeBasenameOffset; + int procCmdlineBasenameOffset; + int procCmdlineBasenameEnd; + LinuxProcessMergedCommand mergedCommand; bool isKernelThread; IOPriority ioPriority; unsigned long int cminflt; @@ -177,6 +208,10 @@ IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this); bool LinuxProcess_setIOPriority(Process* this, Arg ioprio); +/* This function constructs the string that is displayed by + * LinuxProcess_writeCommand and also returned by LinuxProcess_getCommandStr */ +void LinuxProcess_makeCommandStr(Process *this); + bool Process_isThread(const Process* this); #endif |