diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-27 21:26:28 +0100 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-10-28 19:57:10 +0100 |
commit | 61bae4c9d27f23b3ebda461a922ae76e63e0a9c2 (patch) | |
tree | b46ea5fcd2ccd034059853c45eefbd48605780b1 /dragonflybsd | |
parent | cf1a9ec18096029d0fa4635027622a63bcaa82df (diff) |
Unify function argument names
Name first argument of ProcessList_goThroughEntries consistently super
Name first argument of ProcessList_new consistently userTable
Diffstat (limited to 'dragonflybsd')
-rw-r--r-- | dragonflybsd/DragonFlyBSDProcessList.c | 26 | ||||
-rw-r--r-- | dragonflybsd/DragonFlyBSDProcessList.h | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/dragonflybsd/DragonFlyBSDProcessList.c b/dragonflybsd/DragonFlyBSDProcessList.c index 880df969..8c441de5 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.c +++ b/dragonflybsd/DragonFlyBSDProcessList.c @@ -360,14 +360,14 @@ char* DragonFlyBSDProcessList_readJailName(DragonFlyBSDProcessList* dfpl, int ja return jname; } -void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) { - DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) this; - const Settings* settings = this->settings; +void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { + DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) super; + const Settings* settings = super->settings; bool hideKernelThreads = settings->hideKernelThreads; bool hideUserlandThreads = settings->hideUserlandThreads; - DragonFlyBSDProcessList_scanMemoryInfo(this); - DragonFlyBSDProcessList_scanCPUTime(this); + DragonFlyBSDProcessList_scanMemoryInfo(super); + DragonFlyBSDProcessList_scanCPUTime(super); DragonFlyBSDProcessList_scanJails(dfpl); // in pause mode only gather global data for meters (CPU/memory/...) @@ -385,7 +385,7 @@ void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) { bool ATTR_UNUSED isIdleProcess = false; // note: dragonflybsd kernel processes all have the same pid, so we misuse the kernel thread address to give them a unique identifier - Process* proc = ProcessList_getProcess(this, kproc->kp_ktaddr ? (pid_t)kproc->kp_ktaddr : kproc->kp_pid, &preExisting, DragonFlyBSDProcess_new); + Process* proc = ProcessList_getProcess(super, kproc->kp_ktaddr ? (pid_t)kproc->kp_ktaddr : kproc->kp_pid, &preExisting, DragonFlyBSDProcess_new); DragonFlyBSDProcess* dfp = (DragonFlyBSDProcess*) proc; proc->show = ! ((hideKernelThreads && Process_isKernelThread(dfp)) || (hideUserlandThreads && Process_isUserlandThread(proc))); @@ -410,9 +410,9 @@ void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) { proc->st_uid = kproc->kp_uid; // user ID proc->processor = kproc->kp_lwp.kl_origcpu; proc->starttime_ctime = kproc->kp_start.tv_sec; - proc->user = UsersTable_getRef(this->usersTable, proc->st_uid); + proc->user = UsersTable_getRef(super->usersTable, proc->st_uid); - ProcessList_add((ProcessList*)this, proc); + ProcessList_add(super, proc); proc->comm = DragonFlyBSDProcessList_readProcessName(dfpl->kd, kproc, &proc->basenameOffset); dfp->jname = DragonFlyBSDProcessList_readJailName(dfpl, kproc->kp_jailid); } else { @@ -427,7 +427,7 @@ void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) { } if(proc->st_uid != kproc->kp_uid) { // some processes change users (eg. to lower privs) proc->st_uid = kproc->kp_uid; - proc->user = UsersTable_getRef(this->usersTable, proc->st_uid); + proc->user = UsersTable_getRef(super->usersTable, proc->st_uid); } if (settings->updateProcessNames) { free(proc->comm); @@ -441,7 +441,7 @@ void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) { proc->time = (kproc->kp_swtime + 5000) / 10000; proc->percent_cpu = 100.0 * ((double)kproc->kp_lwp.kl_pctcpu / (double)kernelFScale); - proc->percent_mem = 100.0 * (proc->m_resident * pageSizeKb) / (double)(this->totalMem); + proc->percent_mem = 100.0 * (proc->m_resident * pageSizeKb) / (double)(super->totalMem); if (proc->percent_cpu > 0.1) { // system idle process should own all CPU time left regardless of CPU count @@ -523,12 +523,12 @@ void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) { } if (Process_isKernelThread(dfp)) { - this->kernelThreads++; + super->kernelThreads++; } - this->totalTasks++; + super->totalTasks++; if (proc->state == 'R') - this->runningTasks++; + super->runningTasks++; proc->updated = true; } } diff --git a/dragonflybsd/DragonFlyBSDProcessList.h b/dragonflybsd/DragonFlyBSDProcessList.h index 0d0a128f..f3965fd3 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.h +++ b/dragonflybsd/DragonFlyBSDProcessList.h @@ -59,6 +59,6 @@ char* DragonFlyBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kpro char* DragonFlyBSDProcessList_readJailName(DragonFlyBSDProcessList* dfpl, int jailid); -void ProcessList_goThroughEntries(ProcessList* this, pauseProcessUpdate); +void ProcessList_goThroughEntries(ProcessList* super, pauseProcessUpdate); #endif |