From 6c2849ec816a9f717ec629ad0478bcb465cc8ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 23 Nov 2020 14:44:31 +0100 Subject: [PATCH] Linux: fix display of new thread for one cycle when hidden --- linux/LinuxProcessList.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index b31edb2d..b40b77de 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1047,8 +1047,6 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char* continue; } - proc->show = true; - #ifdef HAVE_TASKSTATS if (settings->flags & PROCESS_FLAG_IO) LinuxProcessList_readIoFile(lp, dirname, name, now); @@ -1167,6 +1165,9 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char* } } + /* Set at the end when we know if a new entry is a thread */ + proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); + pl->totalTasks++; if (proc->state == 'R') pl->runningTasks++;