Drop taskstats conditional

taskstats is only checked on runtime if the column RCHAR, WCHAR, SYSCR,
SYSCW, RBYTES, WBYTES, CNCLWB, IO_READ_RATE, IO_WRITE_RATE or IO_RATE is
selected.

taskstats is currently enabled by default.

Drop the taskstats configuration switch, to reduce the maintenance cost.
This commit is contained in:
Christian Göttsche
2020-09-21 12:40:45 +02:00
committed by cgzones
parent c88c80e3bd
commit 9b31ee5b63
6 changed files with 11 additions and 38 deletions

View File

@ -410,8 +410,6 @@ static bool LinuxProcessList_statProcessDir(Process* process, const char* dirnam
return true;
}
#ifdef HAVE_TASKSTATS
static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirname, const char* name, unsigned long long now) {
char filename[MAX_NAME + 1];
filename[MAX_NAME] = '\0';
@ -481,10 +479,6 @@ static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirna
}
}
#endif
static bool LinuxProcessList_readStatmFile(LinuxProcess* process, const char* dirname, const char* name) {
char filename[MAX_NAME + 1];
xSnprintf(filename, sizeof(filename), "%s/%s/statm", dirname, name);
@ -1130,14 +1124,11 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
const struct dirent* entry;
const Settings* settings = pl->settings;
#ifdef HAVE_TASKSTATS
unsigned long long now = tv.tv_sec * 1000LL + tv.tv_usec / 1000LL;
#endif
dir = opendir(dirname);
if (!dir)
return false;
unsigned long long now = tv.tv_sec * 1000ULL + tv.tv_usec / 1000ULL;
int cpus = pl->cpuCount;
bool hideKernelThreads = settings->hideKernelThreads;
bool hideUserlandThreads = settings->hideUserlandThreads;
@ -1200,10 +1191,8 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
continue;
}
#ifdef HAVE_TASKSTATS
if (settings->flags & PROCESS_FLAG_IO)
LinuxProcessList_readIoFile(lp, dirname, name, now);
#endif
if (! LinuxProcessList_readStatmFile(lp, dirname, name))
goto errorReadingProcess;