mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Split process and thread counts in tasks meter
This commit is contained in:
@ -94,6 +94,8 @@ typedef struct ProcessList_ {
|
||||
|
||||
int cpuCount;
|
||||
int totalTasks;
|
||||
int userlandThreads;
|
||||
int kernelThreads;
|
||||
int runningTasks;
|
||||
|
||||
CPUData* cpus;
|
||||
@ -635,6 +637,11 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
|
||||
if (! ProcessList_readCmdlineFile(process, dirname, name))
|
||||
goto errorReadingProcess;
|
||||
}
|
||||
if (Process_isKernelThread(process)) {
|
||||
this->kernelThreads++;
|
||||
} else {
|
||||
this->userlandThreads++;
|
||||
}
|
||||
}
|
||||
|
||||
this->totalTasks++;
|
||||
@ -772,6 +779,8 @@ void ProcessList_scan(ProcessList* this) {
|
||||
}
|
||||
|
||||
this->totalTasks = 0;
|
||||
this->userlandThreads = 0;
|
||||
this->kernelThreads = 0;
|
||||
this->runningTasks = 0;
|
||||
|
||||
ProcessList_processEntries(this, PROCDIR, NULL, period);
|
||||
|
Reference in New Issue
Block a user