Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/systat/zarc.c
Show All 27 Lines | |||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <inttypes.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include "systat.h" | #include "systat.h" | ||||
#include "extern.h" | #include "extern.h" | ||||
struct zfield{ | struct zfield{ | ||||
uint64_t arcstats; | uint64_t arcstats; | ||||
uint64_t arcstats_demand_data; | uint64_t arcstats_demand_data; | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | showzarc(void) | ||||
memset(&delta, 0, sizeof delta); | memset(&delta, 0, sizeof delta); | ||||
memset(&rate, 0, sizeof rate); | memset(&rate, 0, sizeof rate); | ||||
domode(&delta, &rate); | domode(&delta, &rate); | ||||
#define DO(stat, row, col, fmt) \ | #define DO(stat, row, col, fmt) \ | ||||
mvwprintw(wnd, row, col, fmt, stat) | mvwprintw(wnd, row, col, fmt, stat) | ||||
#define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3lu") | #define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3"PRIu64) | ||||
#define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7lu"); \ | #define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7"PRIu64); \ | ||||
DO(curstat.hits.stat, row, 31+1+5+8+8, "%12lu") | DO(curstat.hits.stat, row, 31+1+5+8+8, "%12"PRIu64) | ||||
#define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7lu"); \ | #define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7"PRIu64); \ | ||||
DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12lu") | DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12"PRIu64) | ||||
#define E(row, stat) R(row, stat); H(row, stat); M(row, stat); | #define E(row, stat) R(row, stat); H(row, stat); M(row, stat); | ||||
E(1, arcstats); | E(1, arcstats); | ||||
E(2, arcstats_demand_data); | E(2, arcstats_demand_data); | ||||
E(3, arcstats_demand_metadata); | E(3, arcstats_demand_metadata); | ||||
E(4, arcstats_prefetch_data); | E(4, arcstats_prefetch_data); | ||||
E(5, arcstats_prefetch_metadata); | E(5, arcstats_prefetch_metadata); | ||||
E(6, zfetchstats); | E(6, zfetchstats); | ||||
E(7, arcstats_l2); | E(7, arcstats_l2); | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |