"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bsd/kernel.cc" between
xosview-1.21.tar.gz and xosview-1.22.tar.gz

About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).

kernel.cc  (xosview-1.21):kernel.cc  (xosview-1.22)
skipping to change at line 96 skipping to change at line 96
#include <string.h> #include <string.h>
#include <sys/malloc.h> #include <sys/malloc.h>
#include <sys/device.h> #include <sys/device.h>
#include <uvm/uvm_extern.h> #include <uvm/uvm_extern.h>
#ifdef VM_UVMEXP2 #ifdef VM_UVMEXP2
static int mib_uvm[2] = { CTL_VM, VM_UVMEXP2 }; static int mib_uvm[2] = { CTL_VM, VM_UVMEXP2 };
#else #else
static int mib_uvm[2] = { CTL_VM, VM_UVMEXP }; static int mib_uvm[2] = { CTL_VM, VM_UVMEXP };
#endif #endif
#else #else
#if defined(XOSVIEW_FREEBSD)
#define _WANT_VMMETER
#endif
#include <sys/vmmeter.h> #include <sys/vmmeter.h>
#endif #endif
#if defined(HAVE_SWAPCTL) #if defined(HAVE_SWAPCTL)
#include <sys/swap.h> #include <sys/swap.h>
#endif #endif
// ------------------------ local variables ---------------------------------- // ------------------------ local variables ----------------------------------
// This single kvm_t is shared by all of the kvm routines. // This single kvm_t is shared by all of the kvm routines.
skipping to change at line 339 skipping to change at line 342
u_int v_swappgsin; u_int v_swappgsin;
u_int v_swappgsout; u_int v_swappgsout;
} vm; } vm;
#if defined(XOSVIEW_FREEBSD) #if defined(XOSVIEW_FREEBSD)
size_t size = sizeof(unsigned int); size_t size = sizeof(unsigned int);
#define GET_VM_STATS(name) \ #define GET_VM_STATS(name) \
sysctlbyname("vm.stats.vm." #name, &vm.name, &size, NULL, 0) sysctlbyname("vm.stats.vm." #name, &vm.name, &size, NULL, 0)
GET_VM_STATS(v_active_count); GET_VM_STATS(v_active_count);
GET_VM_STATS(v_inactive_count); GET_VM_STATS(v_inactive_count);
GET_VM_STATS(v_wire_count); GET_VM_STATS(v_wire_count);
#if __FreeBSD_version < 1200017
GET_VM_STATS(v_cache_count); GET_VM_STATS(v_cache_count);
#endif
GET_VM_STATS(v_free_count); GET_VM_STATS(v_free_count);
GET_VM_STATS(v_page_size); GET_VM_STATS(v_page_size);
GET_VM_STATS(v_vnodepgsin); GET_VM_STATS(v_vnodepgsin);
GET_VM_STATS(v_vnodepgsout); GET_VM_STATS(v_vnodepgsout);
GET_VM_STATS(v_swappgsin); GET_VM_STATS(v_swappgsin);
GET_VM_STATS(v_swappgsout); GET_VM_STATS(v_swappgsout);
#undef GET_VM_STATS #undef GET_VM_STATS
#else /* XOSVIEW_DFBSD */ #else /* XOSVIEW_DFBSD */
struct vmstats vms; struct vmstats vms;
size_t size = sizeof(vms); size_t size = sizeof(vms);
skipping to change at line 361 skipping to change at line 366
err(EX_OSERR, "sysctl vm.vmstats failed"); err(EX_OSERR, "sysctl vm.vmstats failed");
size = sizeof(vm); size = sizeof(vm);
if ( sysctlbyname("vm.vmmeter", &vm, &size, NULL, 0) < 0 ) if ( sysctlbyname("vm.vmmeter", &vm, &size, NULL, 0) < 0 )
err(EX_OSERR, "sysctl vm.vmmeter failed"); err(EX_OSERR, "sysctl vm.vmmeter failed");
#endif #endif
if (meminfo) { if (meminfo) {
#if defined(XOSVIEW_FREEBSD) #if defined(XOSVIEW_FREEBSD)
meminfo[0] = (uint64_t)vm.v_active_count * vm.v_page_size; meminfo[0] = (uint64_t)vm.v_active_count * vm.v_page_size;
meminfo[1] = (uint64_t)vm.v_inactive_count * vm.v_page_size; meminfo[1] = (uint64_t)vm.v_inactive_count * vm.v_page_size;
meminfo[2] = (uint64_t)vm.v_wire_count * vm.v_page_size; meminfo[2] = (uint64_t)vm.v_wire_count * vm.v_page_size;
#if __FreeBSD_version < 1200017
meminfo[3] = (uint64_t)vm.v_cache_count * vm.v_page_size; meminfo[3] = (uint64_t)vm.v_cache_count * vm.v_page_size;
#endif
meminfo[4] = (uint64_t)vm.v_free_count * vm.v_page_size; meminfo[4] = (uint64_t)vm.v_free_count * vm.v_page_size;
#else /* XOSVIEW_DFBSD */ #else /* XOSVIEW_DFBSD */
meminfo[0] = (uint64_t)vms.v_active_count * vms.v_page_size; meminfo[0] = (uint64_t)vms.v_active_count * vms.v_page_size;
meminfo[1] = (uint64_t)vms.v_inactive_count * vms.v_page_size; meminfo[1] = (uint64_t)vms.v_inactive_count * vms.v_page_size;
meminfo[2] = (uint64_t)vms.v_wire_count * vms.v_page_size; meminfo[2] = (uint64_t)vms.v_wire_count * vms.v_page_size;
meminfo[3] = (uint64_t)vms.v_cache_count * vms.v_page_size; meminfo[3] = (uint64_t)vms.v_cache_count * vms.v_page_size;
meminfo[4] = (uint64_t)vms.v_free_count * vms.v_page_size; meminfo[4] = (uint64_t)vms.v_free_count * vms.v_page_size;
#endif #endif
} }
if (pageinfo) { if (pageinfo) {
 End of changes. 5 change blocks. 
0 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)