Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/vmstat/vmstat.c
Show First 20 Lines • Show All 1,477 Lines • ▼ Show 20 Lines | if (memstat_kvm_uma(mtlp, kd) < 0) { | ||||
xo_warnx("memstat_kvm_uma: %s", | xo_warnx("memstat_kvm_uma: %s", | ||||
kvm_geterr(kd)); | kvm_geterr(kd)); | ||||
else | else | ||||
xo_warnx("memstat_kvm_uma: %s", | xo_warnx("memstat_kvm_uma: %s", | ||||
memstat_strerror(error)); | memstat_strerror(error)); | ||||
} | } | ||||
} | } | ||||
xo_open_container("memory-zone-statistics"); | xo_open_container("memory-zone-statistics"); | ||||
xo_emit("{T:/%-20s} {T:/%6s} {T:/%6s} {T:/%8s} {T:/%8s} {T:/%8s} " | xo_emit("{T:/%-20s} {T:/%6s} {T:/%6s} {T:/%8s} {T:/%8s} {T:/%8s} {T:/%8s}" | ||||
"{T:/%4s} {T:/%4s}\n\n", "ITEM", "SIZE", | "{T:/%4s} {T:/%4s}\n\n", "ITEM", "SIZE", | ||||
"LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP"); | "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP", "XDOMAIN"); | ||||
xo_open_list("zone"); | xo_open_list("zone"); | ||||
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); | ||||
strcat(name, ":"); | strcat(name, ":"); | ||||
xo_open_instance("zone"); | xo_open_instance("zone"); | ||||
xo_emit("{d:name/%-20s}{ke:name/%s} {:size/%6ju}, " | xo_emit("{d:name/%-20s}{ke:name/%s} {:size/%6ju}, " | ||||
"{:limit/%6ju},{:used/%8ju}," | "{:limit/%6ju},{:used/%8ju}," | ||||
"{:free/%8ju},{:requests/%8ju}," | "{:free/%8ju},{:requests/%8ju}," | ||||
"{:fail/%4ju},{:sleep/%4ju}\n", name, | "{:fail/%4ju},{:sleep/%4ju},{:xdomain/%4ju}\n", name, | ||||
memstat_get_name(mtp), | memstat_get_name(mtp), | ||||
(uintmax_t)memstat_get_size(mtp), | (uintmax_t)memstat_get_size(mtp), | ||||
(uintmax_t)memstat_get_countlimit(mtp), | (uintmax_t)memstat_get_countlimit(mtp), | ||||
(uintmax_t)memstat_get_count(mtp), | (uintmax_t)memstat_get_count(mtp), | ||||
(uintmax_t)memstat_get_free(mtp), | (uintmax_t)memstat_get_free(mtp), | ||||
(uintmax_t)memstat_get_numallocs(mtp), | (uintmax_t)memstat_get_numallocs(mtp), | ||||
(uintmax_t)memstat_get_failures(mtp), | (uintmax_t)memstat_get_failures(mtp), | ||||
(uintmax_t)memstat_get_sleeps(mtp)); | (uintmax_t)memstat_get_sleeps(mtp), | ||||
(uintmax_t)memstat_get_xdomain(mtp)); | |||||
xo_close_instance("zone"); | xo_close_instance("zone"); | ||||
} | } | ||||
memstat_mtl_free(mtlp); | memstat_mtl_free(mtlp); | ||||
xo_close_list("zone"); | xo_close_list("zone"); | ||||
xo_close_container("memory-zone-statistics"); | xo_close_container("memory-zone-statistics"); | ||||
xo_emit("\n"); | xo_emit("\n"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |