- pse->num_proc = entry->num_proc;
- pse->num_lwp = entry->num_lwp;
- pse->vmem_size = entry->vmem_size;
- pse->vmem_rss = entry->vmem_rss;
- pse->vmem_data = entry->vmem_data;
- pse->vmem_code = entry->vmem_code;
- pse->stack_size = entry->stack_size;
- pse->io_rchar = entry->io_rchar;
- pse->io_wchar = entry->io_wchar;
- pse->io_syscr = entry->io_syscr;
- pse->io_syscw = entry->io_syscw;
- pse->cswitch_vol = entry->cswitch_vol;
- pse->cswitch_invol = entry->cswitch_invol;
-
- ps->num_proc += pse->num_proc;
- ps->num_lwp += pse->num_lwp;
- ps->vmem_size += pse->vmem_size;
- ps->vmem_rss += pse->vmem_rss;
- ps->vmem_data += pse->vmem_data;
- ps->vmem_code += pse->vmem_code;
- ps->stack_size += pse->stack_size;
-
- ps->io_rchar += ((pse->io_rchar == -1) ? 0 : pse->io_rchar);
- ps->io_wchar += ((pse->io_wchar == -1) ? 0 : pse->io_wchar);
- ps->io_syscr += ((pse->io_syscr == -1) ? 0 : pse->io_syscr);
- ps->io_syscw += ((pse->io_syscw == -1) ? 0 : pse->io_syscw);
-
- ps->cswitch_vol += ((pse->cswitch_vol == -1) ? 0 : pse->cswitch_vol);
- ps->cswitch_invol += ((pse->cswitch_invol == -1) ? 0 : pse->cswitch_invol);
+
+ ps->num_proc += entry->num_proc;
+ ps->num_lwp += entry->num_lwp;
+ ps->num_fd += entry->num_fd;
+ ps->num_maps += entry->num_maps;
+ ps->vmem_size += entry->vmem_size;
+ ps->vmem_rss += entry->vmem_rss;
+ ps->vmem_data += entry->vmem_data;
+ ps->vmem_code += entry->vmem_code;
+ ps->stack_size += entry->stack_size;
+
+ if ((entry->io_rchar != -1) && (entry->io_wchar != -1)) {
+ ps_update_counter(&ps->io_rchar, &pse->io_rchar, entry->io_rchar);
+ ps_update_counter(&ps->io_wchar, &pse->io_wchar, entry->io_wchar);
+ }
+
+ if ((entry->io_syscr != -1) && (entry->io_syscw != -1)) {
+ ps_update_counter(&ps->io_syscr, &pse->io_syscr, entry->io_syscr);
+ ps_update_counter(&ps->io_syscw, &pse->io_syscw, entry->io_syscw);
+ }
+
+ if ((entry->io_diskr != -1) && (entry->io_diskw != -1)) {
+ ps_update_counter(&ps->io_diskr, &pse->io_diskr, entry->io_diskr);
+ ps_update_counter(&ps->io_diskw, &pse->io_diskw, entry->io_diskw);
+ }
+
+ if ((entry->cswitch_vol != -1) && (entry->cswitch_vol != -1)) {
+ ps_update_counter(&ps->cswitch_vol, &pse->cswitch_vol,
+ entry->cswitch_vol);
+ ps_update_counter(&ps->cswitch_invol, &pse->cswitch_invol,
+ entry->cswitch_invol);
+ }