mirror of https://github.com/xzeldon/htop.git
Use screen's flags when reading process data
This commit is contained in:
parent
2df1f61d77
commit
b4a8f048d1
|
@ -48,7 +48,6 @@ typedef struct Settings_ {
|
||||||
unsigned int ssIndex;
|
unsigned int ssIndex;
|
||||||
ScreenSettings* ss;
|
ScreenSettings* ss;
|
||||||
|
|
||||||
int flags;
|
|
||||||
int colorScheme;
|
int colorScheme;
|
||||||
int delay;
|
int delay;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ typedef struct Settings_ {
|
||||||
unsigned int ssIndex;
|
unsigned int ssIndex;
|
||||||
ScreenSettings* ss;
|
ScreenSettings* ss;
|
||||||
|
|
||||||
int flags;
|
|
||||||
int colorScheme;
|
int colorScheme;
|
||||||
int delay;
|
int delay;
|
||||||
|
|
||||||
|
|
|
@ -475,4 +475,3 @@ long LinuxProcess_compare(const void* v1, const void* v2) {
|
||||||
bool Process_isThread(Process* this) {
|
bool Process_isThread(Process* this) {
|
||||||
return (Process_isUserlandThread(this) || Process_isKernelThread(this));
|
return (Process_isUserlandThread(this) || Process_isKernelThread(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,5 +176,4 @@ long LinuxProcess_compare(const void* v1, const void* v2);
|
||||||
|
|
||||||
bool Process_isThread(Process* this);
|
bool Process_isThread(Process* this);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -761,6 +761,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
|
||||||
DIR* dir;
|
DIR* dir;
|
||||||
struct dirent* entry;
|
struct dirent* entry;
|
||||||
Settings* settings = pl->settings;
|
Settings* settings = pl->settings;
|
||||||
|
ScreenSettings* ss = settings->ss;
|
||||||
|
|
||||||
time_t curTime = tv.tv_sec;
|
time_t curTime = tv.tv_sec;
|
||||||
#ifdef HAVE_TASKSTATS
|
#ifdef HAVE_TASKSTATS
|
||||||
|
@ -806,7 +807,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
|
||||||
LinuxProcessList_recurseProcTree(this, subdirname, proc, period, tv);
|
LinuxProcessList_recurseProcTree(this, subdirname, proc, period, tv);
|
||||||
|
|
||||||
#ifdef HAVE_TASKSTATS
|
#ifdef HAVE_TASKSTATS
|
||||||
if (settings->flags & PROCESS_FLAG_IO)
|
if (ss->flags & PROCESS_FLAG_IO)
|
||||||
LinuxProcessList_readIoFile(lp, dirname, name, now);
|
LinuxProcessList_readIoFile(lp, dirname, name, now);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -825,7 +826,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
|
||||||
free(lp->ttyDevice);
|
free(lp->ttyDevice);
|
||||||
lp->ttyDevice = LinuxProcessList_updateTtyDevice(this->ttyDrivers, proc->tty_nr);
|
lp->ttyDevice = LinuxProcessList_updateTtyDevice(this->ttyDrivers, proc->tty_nr);
|
||||||
}
|
}
|
||||||
if (settings->flags & PROCESS_FLAG_LINUX_IOPRIO)
|
if (ss->flags & PROCESS_FLAG_LINUX_IOPRIO)
|
||||||
LinuxProcess_updateIOPriority(lp);
|
LinuxProcess_updateIOPriority(lp);
|
||||||
float percent_cpu = (lp->utime + lp->stime - lasttimes) / period * 100.0;
|
float percent_cpu = (lp->utime + lp->stime - lasttimes) / period * 100.0;
|
||||||
proc->percent_cpu = CLAMP(percent_cpu, 0.0, cpus * 100.0);
|
proc->percent_cpu = CLAMP(percent_cpu, 0.0, cpus * 100.0);
|
||||||
|
@ -840,13 +841,13 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
|
||||||
proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid);
|
proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid);
|
||||||
|
|
||||||
#ifdef HAVE_OPENVZ
|
#ifdef HAVE_OPENVZ
|
||||||
if (settings->flags & PROCESS_FLAG_LINUX_OPENVZ) {
|
if (ss->flags & PROCESS_FLAG_LINUX_OPENVZ) {
|
||||||
LinuxProcessList_readOpenVZData(lp, dirname, name);
|
LinuxProcessList_readOpenVZData(lp, dirname, name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_VSERVER
|
#ifdef HAVE_VSERVER
|
||||||
if (settings->flags & PROCESS_FLAG_LINUX_VSERVER) {
|
if (ss->flags & PROCESS_FLAG_LINUX_VSERVER) {
|
||||||
LinuxProcessList_readVServerData(lp, dirname, name);
|
LinuxProcessList_readVServerData(lp, dirname, name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -869,11 +870,11 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CGROUP
|
#ifdef HAVE_CGROUP
|
||||||
if (settings->flags & PROCESS_FLAG_LINUX_CGROUP)
|
if (ss->flags & PROCESS_FLAG_LINUX_CGROUP)
|
||||||
LinuxProcessList_readCGroupFile(lp, dirname, name);
|
LinuxProcessList_readCGroupFile(lp, dirname, name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (settings->flags & PROCESS_FLAG_LINUX_OOM)
|
if (ss->flags & PROCESS_FLAG_LINUX_OOM)
|
||||||
LinuxProcessList_readOomData(lp, dirname, name);
|
LinuxProcessList_readOomData(lp, dirname, name);
|
||||||
|
|
||||||
if (proc->state == 'Z' && (proc->basenameOffset == 0)) {
|
if (proc->state == 'Z' && (proc->basenameOffset == 0)) {
|
||||||
|
|
Loading…
Reference in New Issue