From f782f821f7f8081cb43bbad1c37f32830a260a81 Mon Sep 17 00:00:00 2001 From: Denis Lisov Date: Fri, 17 Dec 2021 14:29:01 +0300 Subject: LinuxProcessList: do not collect LRS per thread It's a memory map property, so it's process-wide and collecting it just once should be enough. --- linux/LinuxProcessList.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'linux/LinuxProcessList.c') diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index a055c13e..955aec99 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1473,8 +1473,9 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_ { bool prev = proc->usesDeletedLib; - if ((ss->flags & PROCESS_FLAG_LINUX_LRS_FIX) || - (settings->highlightDeletedExe && !proc->procExeDeleted && !proc->isKernelThread && !proc->isUserlandThread)) { + if (!proc->isKernelThread && !proc->isUserlandThread && + ((ss->flags & PROCESS_FLAG_LINUX_LRS_FIX) || (settings->highlightDeletedExe && !proc->procExeDeleted))) { + // Check if we really should recalculate the M_LRS value for this process uint64_t passedTimeInMs = pl->realtimeMs - lp->last_mlrs_calctime; @@ -1487,6 +1488,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_ } else { /* Copy from process structure in threads and reset if setting got disabled */ proc->usesDeletedLib = (proc->isUserlandThread && parent) ? parent->usesDeletedLib : false; + lp->m_lrs = (proc->isUserlandThread && parent) ? ((const LinuxProcess*)parent)->m_lrs : 0; } proc->mergedCommand.exeChanged |= prev ^ proc->usesDeletedLib; -- cgit v1.2.3