예제 #1
0
static int  vcmp(const void *, const void *);

/* Compute offset in common structures. */
#define	KOFF(x)	offsetof(struct kinfo_proc, x)
#define	ROFF(x)	offsetof(struct rusage, x)

#define	LWPFMT	"d"
#define	NLWPFMT	"d"
#define	UIDFMT	"u"
#define	PIDFMT	"d"

/* PLEASE KEEP THE TABLE BELOW SORTED ALPHABETICALLY!!! */
static VAR var[] = {
	{"%cpu", "%CPU", NULL, 0, pcpu, 0, CHAR, NULL, 0},
	{"%mem", "%MEM", NULL, 0, pmem, 0, CHAR, NULL, 0},
	{"acflag", "ACFLG", NULL, 0, kvar, KOFF(ki_acflag), USHORT, "x", 0},
	{"acflg", "", "acflag", 0, NULL, 0, CHAR, NULL, 0},
	{"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, 0,
		CHAR, NULL, 0},
	{"blocked", "", "sigmask", 0, NULL, 0, CHAR, NULL, 0},
	{"caught", "", "sigcatch", 0, NULL, 0, CHAR, NULL, 0},
	{"class", "CLASS", NULL, LJUST, loginclass, 0, CHAR, NULL, 0},
	{"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0},
	{"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0,
		CHAR, NULL, 0},
	{"cow", "COW", NULL, 0, kvar, KOFF(ki_cow), UINT, "u", 0},
	{"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0},
	{"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0},
	{"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0},
	{"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0},
	{"emul", "EMUL", NULL, LJUST, emulname, 0, CHAR, NULL, 0},
예제 #2
0
파일: btblock.c 프로젝트: Fleurer/xfsprogs
	{ "uuid", FLDT_UUID, OI(OFF(u.l.bb_uuid)), C1, 0, TYP_NONE },
	{ "owner", FLDT_INO, OI(OFF(u.l.bb_owner)), C1, 0, TYP_NONE },
	{ "crc", FLDT_CRC, OI(OFF(u.l.bb_crc)), C1, 0, TYP_NONE },
	{ "recs", FLDT_BMAPBTDREC, btblock_rec_offset, btblock_rec_count,
	  FLD_ARRAY|FLD_ABASE1|FLD_COUNT|FLD_OFFSET, TYP_NONE },
	{ "keys", FLDT_BMAPBTDKEY, btblock_key_offset, btblock_key_count,
	  FLD_ARRAY|FLD_ABASE1|FLD_COUNT|FLD_OFFSET, TYP_NONE },
	{ "ptrs", FLDT_BMAPBTDPTR, btblock_ptr_offset, btblock_key_count,
	  FLD_ARRAY|FLD_ABASE1|FLD_COUNT|FLD_OFFSET, TYP_BMAPBTD },
	{ NULL }
};
#undef OFF

#define	KOFF(f)	bitize(offsetof(xfs_bmbt_key_t, br_ ## f))
const field_t	bmapbta_key_flds[] = {
	{ "startoff", FLDT_DFILOFFA, OI(KOFF(startoff)), C1, 0, TYP_ATTR },
	{ NULL }
};
const field_t	bmapbtd_key_flds[] = {
	{ "startoff", FLDT_DFILOFFD, OI(KOFF(startoff)), C1, 0, TYP_INODATA },
	{ NULL }
};
#undef KOFF

#define BMBT_EXNTFLAG_BITOFF	0
#define BMBT_STARTOFF_BITOFF	(BMBT_EXNTFLAG_BITOFF + BMBT_EXNTFLAG_BITLEN)
#define BMBT_STARTBLOCK_BITOFF	(BMBT_STARTOFF_BITOFF + BMBT_STARTOFF_BITLEN)
#define BMBT_BLOCKCOUNT_BITOFF	\
	(BMBT_STARTBLOCK_BITOFF + BMBT_STARTBLOCK_BITLEN)

const field_t	bmapbta_rec_flds[] = {
예제 #3
0
파일: bnobt.c 프로젝트: crossmeta/sgi
	{ "level", FLDT_UINT16D, OI(OFF(level)), C1, 0, TYP_NONE },
	{ "numrecs", FLDT_UINT16D, OI(OFF(numrecs)), C1, 0, TYP_NONE },
	{ "leftsib", FLDT_AGBLOCK, OI(OFF(leftsib)), C1, 0, TYP_BNOBT },
	{ "rightsib", FLDT_AGBLOCK, OI(OFF(rightsib)), C1, 0, TYP_BNOBT },
	{ "recs", FLDT_BNOBTREC, bnobt_rec_offset, bnobt_rec_count,
	  FLD_ARRAY|FLD_ABASE1|FLD_COUNT|FLD_OFFSET, TYP_NONE },
	{ "keys", FLDT_BNOBTKEY, bnobt_key_offset, bnobt_key_count,
	  FLD_ARRAY|FLD_ABASE1|FLD_COUNT|FLD_OFFSET, TYP_NONE },
	{ "ptrs", FLDT_BNOBTPTR, bnobt_ptr_offset, bnobt_ptr_count,
	  FLD_ARRAY|FLD_ABASE1|FLD_COUNT|FLD_OFFSET, TYP_BNOBT },
	{ NULL }
};

#define	KOFF(f)	bitize(offsetof(xfs_alloc_key_t, ar_ ## f))
const field_t	bnobt_key_flds[] = {
	{ "startblock", FLDT_AGBLOCK, OI(KOFF(startblock)), C1, 0, TYP_DATA },
	{ "blockcount", FLDT_EXTLEN, OI(KOFF(blockcount)), C1, 0, TYP_NONE },
	{ NULL }
};

#define	ROFF(f)	bitize(offsetof(xfs_alloc_rec_t, ar_ ## f))
const field_t	bnobt_rec_flds[] = {
	{ "startblock", FLDT_AGBLOCK, OI(ROFF(startblock)), C1, 0, TYP_DATA },
	{ "blockcount", FLDT_EXTLEN, OI(ROFF(blockcount)), C1, 0, TYP_NONE },
	{ NULL }
};

static int
bnobt_key_count(
	void			*obj,
	int			startoff)
예제 #4
0
static int  vcmp(const void *, const void *);

/* Compute offset in common structures. */
#define	KOFF(x)	offsetof(struct kinfo_proc, x)
#define	ROFF(x)	offsetof(struct rusage, x)

#define	LWPFMT	"d"
#define	NLWPFMT	"d"
#define	UIDFMT	"u"
#define	PIDFMT	"d"

/* PLEASE KEEP THE TABLE BELOW SORTED ALPHABETICALLY!!! */
static VAR var[] = {
	{"%cpu", "%CPU", NULL, "percent-cpu", 0, pcpu, 0, CHAR, NULL, 0},
	{"%mem", "%MEM", NULL, "percent-memory", 0, pmem, 0, CHAR, NULL, 0},
	{"acflag", "ACFLG", NULL, "accounting-flag", 0, kvar, KOFF(ki_acflag),
	    USHORT, "x", 0},
	{"acflg", "", "acflag", NULL, 0, NULL, 0, CHAR, NULL, 0},
	{"args", "COMMAND", NULL, "arguments", COMM|LJUST|USER, arguments, 0,
	    CHAR, NULL, 0},
	{"blocked", "", "sigmask", NULL, 0, NULL, 0, CHAR, NULL, 0},
	{"caught", "", "sigcatch", NULL, 0, NULL, 0, CHAR, NULL, 0},
	{"class", "CLASS", NULL, "login-class", LJUST, loginclass, 0, CHAR,
	    NULL, 0},
	{"comm", "COMMAND", NULL, "command", LJUST, ucomm, 0, CHAR, NULL, 0},
	{"command", "COMMAND", NULL, "command", COMM|LJUST|USER, command, 0,
	    CHAR, NULL, 0},
	{"cow", "COW", NULL, "copy-on-write-faults", 0, kvar, KOFF(ki_cow),
	    UINT, "u", 0},
	{"cpu", "CPU", NULL, "cpu-usage", 0, kvar, KOFF(ki_estcpu), UINT, "d",
	    0},