Skip to content

Commit

Permalink
LinuxProcessList: do not collect LRS per thread
Browse files Browse the repository at this point in the history
It's a memory map property, so it's process-wide and collecting it just
once should be enough.
  • Loading branch information
tanriol authored and BenBE committed Dec 18, 2021
1 parent 5b78ad2 commit f782f82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions linux/LinuxProcessList.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit f782f82

Please sign in to comment.