Lines Matching refs:procs
123 struct proc_info **procs;
178 procs = calloc(num_procs, sizeof(struct proc_info*));
179 if (procs == NULL) {
185 procs[i] = malloc(sizeof(struct proc_info));
186 if (procs[i] == NULL) {
190 procs[i]->pid = pids[i];
191 pm_memusage_zero(&procs[i]->usage);
200 error = pm_process_usage_flags(proc, &procs[i]->usage, flags_mask,
204 error = pm_process_workingset(proc, &procs[i]->usage, 0);
215 if (ws != WS_RESET && procs[i]->usage.swap) {
228 if (procs[i]->usage.vss) {
229 procs[j++] = procs[i];
231 free(procs[i]);
236 qsort(procs, num_procs, sizeof(procs[0]), compfn);
258 if (getprocname(procs[i]->pid, cmdline, (int)sizeof(cmdline)) < 0) {
263 free(procs[i]);
267 total_pss += procs[i]->usage.pss;
268 total_uss += procs[i]->usage.uss;
269 total_swap += procs[i]->usage.swap;
271 printf("%5d ", procs[i]->pid);
275 procs[i]->usage.rss / 1024,
276 procs[i]->usage.pss / 1024,
277 procs[i]->usage.uss / 1024
281 procs[i]->usage.vss / 1024,
282 procs[i]->usage.rss / 1024,
283 procs[i]->usage.pss / 1024,
284 procs[i]->usage.uss / 1024
289 printf("%6dK ", procs[i]->usage.swap / 1024);
294 free(procs[i]);
297 free(procs);