Lines Matching refs:procs
125 struct proc_info **procs;
180 procs = calloc(num_procs, sizeof(struct proc_info*));
181 if (procs == NULL) {
187 procs[i] = malloc(sizeof(struct proc_info));
188 if (procs[i] == NULL) {
192 procs[i]->pid = pids[i];
193 pm_memusage_zero(&procs[i]->usage);
202 error = pm_process_usage_flags(proc, &procs[i]->usage, flags_mask,
206 error = pm_process_workingset(proc, &procs[i]->usage, 0);
217 if (ws != WS_RESET && procs[i]->usage.swap) {
230 if (procs[i]->usage.vss) {
231 procs[j++] = procs[i];
233 free(procs[i]);
238 qsort(procs, num_procs, sizeof(procs[0]), compfn);
260 if (getprocname(procs[i]->pid, cmdline, (int)sizeof(cmdline)) < 0) {
265 free(procs[i]);
269 total_pss += procs[i]->usage.pss;
270 total_uss += procs[i]->usage.uss;
271 total_swap += procs[i]->usage.swap;
273 printf("%5d ", procs[i]->pid);
277 procs[i]->usage.rss / 1024,
278 procs[i]->usage.pss / 1024,
279 procs[i]->usage.uss / 1024
283 procs[i]->usage.vss / 1024,
284 procs[i]->usage.rss / 1024,
285 procs[i]->usage.pss / 1024,
286 procs[i]->usage.uss / 1024
291 printf("%6zuK ", procs[i]->usage.swap / 1024);
296 free(procs[i]);
299 free(procs);