From dd33444f7eace81115308eadb568020470c48b2b Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 31 Oct 2019 11:39:12 -0500 Subject: Clean up existing whitespace --- solaris/Platform.c | 14 +++++++------- solaris/Platform.h | 2 +- solaris/SolarisProcessList.c | 22 +++++++++++----------- solaris/SolarisProcessList.h | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'solaris') diff --git a/solaris/Platform.c b/solaris/Platform.c index a29fcb47..396b502c 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -48,7 +48,7 @@ typedef struct var kvar_t; typedef struct envAccum_ { size_t capacity; size_t size; - size_t bytes; + size_t bytes; char *env; } envAccum; @@ -136,7 +136,7 @@ extern char Process_pidFormat[20]; int Platform_getUptime() { int boot_time = 0; - int curr_time = time(NULL); + int curr_time = time(NULL); struct utmpx * ent; while (( ent = getutxent() )) { @@ -170,7 +170,7 @@ int Platform_getMaxPid() { vproc = ksvar->v_proc; } if (kc != NULL) { kstat_close(kc); } - return vproc; + return vproc; } double Platform_setCPUValues(Meter* this, int cpu) { @@ -223,7 +223,7 @@ void Platform_setSwapValues(Meter* this) { static int Platform_buildenv(void *accum, struct ps_prochandle *Phandle, uintptr_t addr, const char *str) { envAccum *accump = accum; (void) Phandle; - (void) addr; + (void) addr; size_t thissz = strlen(str); if ((thissz + 2) > (accump->capacity - accump->size)) accump->env = xRealloc(accump->env, accump->capacity *= 2); @@ -232,7 +232,7 @@ static int Platform_buildenv(void *accum, struct ps_prochandle *Phandle, uintptr strlcpy( accump->env + accump->size, str, (accump->capacity - accump->size)); strncpy( accump->env + accump->size + thissz + 1, "\n", 1); accump->size = accump->size + thissz + 1; - return 0; + return 0; } char* Platform_getProcessEnv(pid_t pid) { @@ -240,7 +240,7 @@ char* Platform_getProcessEnv(pid_t pid) { pid_t realpid = pid / 1024; int graberr; struct ps_prochandle *Phandle; - + if ((Phandle = Pgrab(realpid,PGRAB_RDONLY,&graberr)) == NULL) return "Unable to read process environment."; @@ -248,7 +248,7 @@ char* Platform_getProcessEnv(pid_t pid) { envBuilder.size = 0; envBuilder.env = xMalloc(envBuilder.capacity); - (void) Penv_iter(Phandle,Platform_buildenv,&envBuilder); + (void) Penv_iter(Phandle,Platform_buildenv,&envBuilder); Prelease(Phandle, 0); diff --git a/solaris/Platform.h b/solaris/Platform.h index f961b913..ffec60c9 100644 --- a/solaris/Platform.h +++ b/solaris/Platform.h @@ -27,7 +27,7 @@ typedef struct var kvar_t; typedef struct envAccum_ { size_t capacity; size_t size; - size_t bytes; + size_t bytes; char *env; } envAccum; diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c index 2c681852..f452fe79 100644 --- a/solaris/SolarisProcessList.c +++ b/solaris/SolarisProcessList.c @@ -153,7 +153,7 @@ static inline void SolarisProcessList_scanCPUTime(ProcessList* pl) { idlebuf += cpuData->idlePercent; } } - + if (cpus > 1) { CPUData* cpuData = &(spl->cpus[0]); cpuData->userPercent = userbuf / cpus; @@ -177,7 +177,7 @@ static inline void SolarisProcessList_scanMemoryInfo(ProcessList* pl) { uint64_t totalswap = 0; uint64_t totalfree = 0; int nswap = 0; - char *spath = NULL; + char *spath = NULL; char *spathbase = NULL; // Part 1 - physical memory @@ -191,7 +191,7 @@ static inline void SolarisProcessList_scanMemoryInfo(ProcessList* pl) { pl->totalMem = totalmem_pgs->value.ui64 * PAGE_SIZE_KB; pl->usedMem = lockedmem_pgs->value.ui64 * PAGE_SIZE_KB; // Not sure how to implement this on Solaris - suggestions welcome! - pl->cachedMem = 0; + pl->cachedMem = 0; // Not really "buffers" but the best Solaris analogue that I can find to // "memory in use but not by programs or the kernel itself" pl->buffersMem = (totalmem_pgs->value.ui64 - pages->value.ui64) * PAGE_SIZE_KB; @@ -202,12 +202,12 @@ static inline void SolarisProcessList_scanMemoryInfo(ProcessList* pl) { pl->cachedMem = 0; pl->usedMem = pl->totalMem - (sysconf(_SC_AVPHYS_PAGES) * PAGE_SIZE); } - + // Part 2 - swap nswap = swapctl(SC_GETNSWP, NULL); if (nswap > 0) { sl = xMalloc((nswap * sizeof(swapent_t)) + sizeof(int)); } if (sl != NULL) { spathbase = xMalloc( nswap * MAXPATHLEN ); } - if (spathbase != NULL) { + if (spathbase != NULL) { spath = spathbase; swapdev = sl->swt_ent; for (int i = 0; i < nswap; i++, swapdev++) { @@ -217,7 +217,7 @@ static inline void SolarisProcessList_scanMemoryInfo(ProcessList* pl) { sl->swt_n = nswap; } nswap = swapctl(SC_LIST, sl); - if (nswap > 0) { + if (nswap > 0) { swapdev = sl->swt_ent; for (int i = 0; i < nswap; i++, swapdev++) { totalswap += swapdev->ste_pages; @@ -227,7 +227,7 @@ static inline void SolarisProcessList_scanMemoryInfo(ProcessList* pl) { free(spathbase); free(sl); pl->totalSwap = totalswap * PAGE_SIZE_KB; - pl->usedSwap = pl->totalSwap - (totalfree * PAGE_SIZE_KB); + pl->usedSwap = pl->totalSwap - (totalfree * PAGE_SIZE_KB); } void ProcessList_delete(ProcessList* pl) { @@ -242,7 +242,7 @@ void ProcessList_delete(ProcessList* pl) { * and MUST conform to the appropriate definition in order * to work. See libproc(3LIB) on a Solaris or Illumos * system for more info. - */ + */ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void *listptr) { struct timeval tv; @@ -262,7 +262,7 @@ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void * getpid = _psinfo->pr_pid * 1024; } else { getpid = lwpid; - } + } Process *proc = ProcessList_getProcess(pl, getpid, &preExisting, (Process_New) SolarisProcess_new); SolarisProcess *sproc = (SolarisProcess*) proc; @@ -293,7 +293,7 @@ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void * sproc->realpid = _psinfo->pr_pid; sproc->lwpid = lwpid_real; sproc->zoneid = _psinfo->pr_zoneid; - sproc->zname = SolarisProcessList_readZoneName(spl->kd,sproc); + sproc->zname = SolarisProcessList_readZoneName(spl->kd,sproc); proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid); proc->comm = xStrdup(_psinfo->pr_fname); proc->commLen = strnlen(_psinfo->pr_fname,PRFNSZ); @@ -332,7 +332,7 @@ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void * proc->percent_cpu = ((uint16_t)_lwpsinfo->pr_pctcpu/(double)32768)*(double)100.0; proc->time = _lwpsinfo->pr_time.tv_sec; if (!preExisting) { // Tasks done only for NEW LWPs - sproc->is_lwp = true; + sproc->is_lwp = true; proc->basenameOffset = -1; proc->ppid = _psinfo->pr_pid * 1024; proc->tgid = _psinfo->pr_pid * 1024; diff --git a/solaris/SolarisProcessList.h b/solaris/SolarisProcessList.h index a5f2fbc2..9d2309cc 100644 --- a/solaris/SolarisProcessList.h +++ b/solaris/SolarisProcessList.h @@ -54,7 +54,7 @@ void ProcessList_delete(ProcessList* pl); * and MUST conform to the appropriate definition in order * to work. See libproc(3LIB) on a Solaris or Illumos * system for more info. - */ + */ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void *listptr); -- cgit v1.2.3