The description for hrSWRunPerfMem says that this is the amount
of Real Memory used by the process. This patch corrects this for
BSD systems

/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming
diff --git a/agent/mibgroup/host/data_access/swrun_kinfo.c 
b/agent/mibgroup/host/data_access/swrun_kinfo.c
index 4a7dde0..e30c689 100644
--- a/agent/mibgroup/host/data_access/swrun_kinfo.c
+++ b/agent/mibgroup/host/data_access/swrun_kinfo.c
@@ -285,7 +288,7 @@ netsnmp_arch_swrun_container_load( netsnmp_container 
*container, u_int flags)
         entry->hrSWRunPerfCPU += 
(proc_table[i].ki_rusage.ru_stime.tv_sec*1000000 + 
proc_table[i].ki_rusage.ru_stime.tv_usec) / 10000;
         entry->hrSWRunPerfCPU += 
(proc_table[i].ki_rusage_ch.ru_utime.tv_sec*1000000 + 
proc_table[i].ki_rusage_ch.ru_utime.tv_usec) / 10000;
         entry->hrSWRunPerfCPU += 
(proc_table[i].ki_rusage_ch.ru_stime.tv_sec*1000000 + 
proc_table[i].ki_rusage_ch.ru_stime.tv_usec) / 10000;
-        entry->hrSWRunPerfMem  = proc_table[i].ki_size * (getpagesize()/1024); 
 /* in kB */
+        entry->hrSWRunPerfMem  = proc_table[i].ki_rssize * 
(getpagesize()/1024);  /* in kB */
 #elif defined(HAVE_KVM_GETPROC2)
         /*
          * newer NetBSD, OpenBSD
@@ -293,9 +296,7 @@ netsnmp_arch_swrun_container_load( netsnmp_container 
*container, u_int flags)
         entry->hrSWRunPerfCPU  = proc_table[i].p_uticks;
         entry->hrSWRunPerfCPU += proc_table[i].p_sticks;
         entry->hrSWRunPerfCPU += proc_table[i].p_iticks;
-        entry->hrSWRunPerfMem  = proc_table[i].p_vm_tsize;
-        entry->hrSWRunPerfMem += proc_table[i].p_vm_ssize;
-        entry->hrSWRunPerfMem += proc_table[i].p_vm_dsize;
+        entry->hrSWRunPerfMem  = proc_table[i].p_vm_rssize;
         entry->hrSWRunPerfMem *= (getpagesize() / 1024);
 #elif defined(dragonfly) && __DragonFly_version >= 190000
        entry->hrSWRunPerfCPU  = proc_table[i].kp_lwp.kl_uticks;
@@ -315,9 +316,7 @@ netsnmp_arch_swrun_container_load( netsnmp_container 
*container, u_int flags)
         entry->hrSWRunPerfCPU  = proc_table[i].kp_proc.p_uticks;
         entry->hrSWRunPerfCPU += proc_table[i].kp_proc.p_sticks;
         entry->hrSWRunPerfCPU += proc_table[i].kp_proc.p_iticks;
-        entry->hrSWRunPerfMem  = proc_table[i].kp_eproc.e_vm.vm_tsize;
-        entry->hrSWRunPerfMem += proc_table[i].kp_eproc.e_vm.vm_ssize;
-        entry->hrSWRunPerfMem += proc_table[i].kp_eproc.e_vm.vm_dsize;
+        entry->hrSWRunPerfMem  = proc_table[i].kp_eproc.e_vm.vm_rssize;
         entry->hrSWRunPerfMem *= (getpagesize() / 1024);
 #endif
     }
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to