Auto-size (normalized) CPU usage columns

This commit is contained in:
Benny Baumann
2022-02-27 20:29:40 +01:00
committed by BenBE
parent b6c0667eae
commit edf319e53d
19 changed files with 60 additions and 25 deletions

View File

@ -463,8 +463,11 @@ static int SolarisProcessList_walkproc(psinfo_t* _psinfo, lwpsinfo_t* _lwpsinfo,
proc->tgid = (_psinfo->pr_ppid * 1024);
sproc->realppid = _psinfo->pr_ppid;
sproc->realtgid = _psinfo->pr_ppid;
// See note above (in common section) about this BINARY FRACTION
proc->percent_cpu = ((uint16_t)_psinfo->pr_pctcpu / (double)32768) * (double)100.0;
Process_updateCPUFieldWidths(proc->percent_cpu);
proc->time = _psinfo->pr_time.tv_sec;
if (!preExisting) { // Tasks done only for NEW processes
proc->isUserlandThread = false;
@ -492,6 +495,8 @@ static int SolarisProcessList_walkproc(psinfo_t* _psinfo, lwpsinfo_t* _lwpsinfo,
proc->show = !(pl->settings->hideKernelThreads && proc->isKernelThread);
} else { // We are not in the master LWP, so jump to the LWP handling code
proc->percent_cpu = ((uint16_t)_lwpsinfo->pr_pctcpu / (double)32768) * (double)100.0;
Process_updateCPUFieldWidths(proc->percent_cpu);
proc->time = _lwpsinfo->pr_time.tv_sec;
if (!preExisting) { // Tasks done only for NEW LWPs
proc->isUserlandThread = true;