version 1.33, 2014/06/13 07:31:18 |
version 1.34, 2014/07/02 00:12:34 |
|
|
|
|
int mclpool_count = 0; |
int mclpool_count = 0; |
int mbpool_index = -1; |
int mbpool_index = -1; |
struct pool mbpool; |
struct kinfo_pool mbpool; |
u_int mcllivelocks, mcllivelocks_cur, mcllivelocks_diff; |
u_int mcllivelocks, mcllivelocks_cur, mcllivelocks_diff; |
|
|
/* interfaces */ |
/* interfaces */ |
|
|
{ |
{ |
field_view *v; |
field_view *v; |
int i, mib[4], npools; |
int i, mib[4], npools; |
struct pool pool; |
struct kinfo_pool pool; |
char pname[32]; |
char pname[32]; |
size_t size; |
size_t size; |
|
|
|
|
} |
} |
|
|
mib[2] = KERN_POOL_POOL; |
mib[2] = KERN_POOL_POOL; |
size = sizeof(struct pool); |
size = sizeof(pool); |
|
|
if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) { |
if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) { |
err(1, "sysctl(KERN_POOL_POOL, %d)", i); |
err(1, "sysctl(KERN_POOL_POOL, %d)", i); |
|
|
int |
int |
read_mb(void) |
read_mb(void) |
{ |
{ |
struct pool pool; |
struct kinfo_pool pool; |
struct ifaddrs *ifap, *ifa; |
struct ifaddrs *ifap, *ifa; |
struct if_info *ifi; |
struct if_info *ifi; |
int mib[4]; |
int mib[4]; |
|
|
mib[1] = KERN_POOL; |
mib[1] = KERN_POOL; |
mib[2] = KERN_POOL_POOL; |
mib[2] = KERN_POOL_POOL; |
mib[3] = mbpool_index; |
mib[3] = mbpool_index; |
size = sizeof(struct pool); |
size = sizeof(mbpool); |
|
|
if (sysctl(mib, 4, &mbpool, &size, NULL, 0) < 0) { |
if (sysctl(mib, 4, &mbpool, &size, NULL, 0) < 0) { |
error("sysctl(KERN_POOL_POOL, %d)", mib[3]); |
error("sysctl(KERN_POOL_POOL, %d)", mib[3]); |
|
|
struct mclpool *mp = &interfaces[0].data.ifi_mclpool[i]; |
struct mclpool *mp = &interfaces[0].data.ifi_mclpool[i]; |
|
|
mib[3] = mclpools[i].pool_offset; |
mib[3] = mclpools[i].pool_offset; |
size = sizeof(struct pool); |
size = sizeof(pool); |
|
|
if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) { |
if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) { |
error("sysctl(KERN_POOL_POOL, %d)", mib[3]); |
error("sysctl(KERN_POOL_POOL, %d)", mib[3]); |