Minor syntax tweaks:
- Remove some extra blank lines. - Remove comments that don't contribute to understanding. - Remove additional blank lines in output added to maximize compatibility with older vmstat output, but that is actually somewhat gratuitous. Submitted by: bde MFC with: other vmstat libmemstat(3) changes
This commit is contained in:
parent
73ca9658a6
commit
b9dc1340d2
@ -897,9 +897,6 @@ dointr(void)
|
|||||||
(long long)inttotal, (long long)(inttotal / uptime));
|
(long long)inttotal, (long long)(inttotal / uptime));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Query libmemstat(3) for information on malloc(9).
|
|
||||||
*/
|
|
||||||
static void
|
static void
|
||||||
domemstat_malloc(void)
|
domemstat_malloc(void)
|
||||||
{
|
{
|
||||||
@ -912,17 +909,13 @@ domemstat_malloc(void)
|
|||||||
warn("memstat_mtl_alloc");
|
warn("memstat_mtl_alloc");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memstat_sysctl_malloc(mtlp, 0) < 0) {
|
if (memstat_sysctl_malloc(mtlp, 0) < 0) {
|
||||||
warnx("memstat_sysctl_malloc: %s",
|
warnx("memstat_sysctl_malloc: %s",
|
||||||
memstat_strerror(memstat_mtl_geterror(mtlp)));
|
memstat_strerror(memstat_mtl_geterror(mtlp)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
printf("%13s %5s %6s %7s %8s Size(s)\n", "Type", "InUse", "MemUse",
|
printf("%13s %5s %6s %7s %8s Size(s)\n", "Type", "InUse", "MemUse",
|
||||||
"HighUse", "Requests");
|
"HighUse", "Requests");
|
||||||
|
|
||||||
for (mtp = memstat_mtl_first(mtlp); mtp != NULL;
|
for (mtp = memstat_mtl_first(mtlp); mtp != NULL;
|
||||||
mtp = memstat_mtl_next(mtp)) {
|
mtp = memstat_mtl_next(mtp)) {
|
||||||
if (memstat_get_numallocs(mtp) == 0 &&
|
if (memstat_get_numallocs(mtp) == 0 &&
|
||||||
@ -932,7 +925,6 @@ domemstat_malloc(void)
|
|||||||
memstat_get_name(mtp), memstat_get_count(mtp),
|
memstat_get_name(mtp), memstat_get_count(mtp),
|
||||||
((int64_t)memstat_get_bytes(mtp) + 1023) / 1024, "-",
|
((int64_t)memstat_get_bytes(mtp) + 1023) / 1024, "-",
|
||||||
memstat_get_numallocs(mtp));
|
memstat_get_numallocs(mtp));
|
||||||
|
|
||||||
first = 1;
|
first = 1;
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (memstat_get_sizemask(mtp) & (1 << i)) {
|
if (memstat_get_sizemask(mtp) & (1 << i)) {
|
||||||
@ -944,13 +936,9 @@ domemstat_malloc(void)
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
memstat_mtl_free(mtlp);
|
memstat_mtl_free(mtlp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Query libmemstat(3) for information on uma(9).
|
|
||||||
*/
|
|
||||||
static void
|
static void
|
||||||
domemstat_zone(void)
|
domemstat_zone(void)
|
||||||
{
|
{
|
||||||
@ -963,17 +951,13 @@ domemstat_zone(void)
|
|||||||
warn("memstat_mtl_alloc");
|
warn("memstat_mtl_alloc");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memstat_sysctl_uma(mtlp, 0) < 0) {
|
if (memstat_sysctl_uma(mtlp, 0) < 0) {
|
||||||
warnx("memstat_sysctl_uma: %s",
|
warnx("memstat_sysctl_uma: %s",
|
||||||
memstat_strerror(memstat_mtl_geterror(mtlp)));
|
memstat_strerror(memstat_mtl_geterror(mtlp)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
printf("%-15s %-8s %-9s %-7s %-5s %-8s\n\n", "ITEM", "SIZE", "LIMIT",
|
printf("%-15s %-8s %-9s %-7s %-5s %-8s\n\n", "ITEM", "SIZE", "LIMIT",
|
||||||
"USED", "FREE", "REQUESTS");
|
"USED", "FREE", "REQUESTS");
|
||||||
|
|
||||||
for (mtp = memstat_mtl_first(mtlp); mtp != NULL;
|
for (mtp = memstat_mtl_first(mtlp); mtp != NULL;
|
||||||
mtp = memstat_mtl_next(mtp)) {
|
mtp = memstat_mtl_next(mtp)) {
|
||||||
strlcpy(name, memstat_get_name(mtp), MEMTYPE_MAXNAME);
|
strlcpy(name, memstat_get_name(mtp), MEMTYPE_MAXNAME);
|
||||||
@ -983,7 +967,6 @@ domemstat_zone(void)
|
|||||||
memstat_get_count(mtp), memstat_get_free(mtp),
|
memstat_get_count(mtp), memstat_get_free(mtp),
|
||||||
memstat_get_numallocs(mtp));
|
memstat_get_numallocs(mtp));
|
||||||
}
|
}
|
||||||
|
|
||||||
memstat_mtl_free(mtlp);
|
memstat_mtl_free(mtlp);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user