示例#1
0
/* Adjusts default_width for fields with potentially large numbers */
void adjust_field_widths(xenstat_domain *domain)
{
	unsigned int length;

	if (show_full_name) {
		length = strlen(xenstat_domain_name(domain));
		if (length > fields[FIELD_NAME-1].default_width)
			fields[FIELD_NAME-1].default_width = length;
	}

	length = INT_FIELD_WIDTH((tot_net_bytes(domain, FALSE)/1024) + 1);
	if (length > fields[FIELD_NET_TX-1].default_width)
		fields[FIELD_NET_TX-1].default_width = length;

	length = INT_FIELD_WIDTH((tot_net_bytes(domain, TRUE)/1024) + 1);
	if (length > fields[FIELD_NET_RX-1].default_width)
		fields[FIELD_NET_RX-1].default_width = length;

	length = INT_FIELD_WIDTH((tot_vbd_reqs(domain, FIELD_VBD_RD)) + 1);
	if (length > fields[FIELD_VBD_RD-1].default_width)
		fields[FIELD_VBD_RD-1].default_width = length;

	length = INT_FIELD_WIDTH((tot_vbd_reqs(domain, FIELD_VBD_WR)) + 1);
	if (length > fields[FIELD_VBD_WR-1].default_width)
		fields[FIELD_VBD_WR-1].default_width = length;

	length = INT_FIELD_WIDTH((tot_vbd_reqs(domain, FIELD_VBD_RSECT)) + 1);
	if (length > fields[FIELD_VBD_RSECT-1].default_width)
		fields[FIELD_VBD_RSECT-1].default_width = length;

	length = INT_FIELD_WIDTH((tot_vbd_reqs(domain, FIELD_VBD_WSECT)) + 1);
	if (length > fields[FIELD_VBD_WSECT-1].default_width)
		fields[FIELD_VBD_WSECT-1].default_width = length;
}
示例#2
0
文件: xentop.c 项目: Ultra-Seven/gxen
/* Prints number of total VBD WRITE sectors statistic */
static void print_vbd_wsect(xenstat_domain *domain)
{
	print("%10llu", tot_vbd_reqs(domain, FIELD_VBD_WSECT));
}
示例#3
0
文件: xentop.c 项目: Ultra-Seven/gxen
/* Compares number of total VBD WRITE sectors of two domains,
   returning -1,0,1 * for <,=,> */
static int compare_vbd_wsect(xenstat_domain *domain1, xenstat_domain *domain2)
{
	return -compare(tot_vbd_reqs(domain1, FIELD_VBD_WSECT),
			tot_vbd_reqs(domain2, FIELD_VBD_WSECT));
}
示例#4
0
文件: xentop.c 项目: Ultra-Seven/gxen
/* Prints number of total VBD WRITE requests statistic */
static void print_vbd_wr(xenstat_domain *domain)
{
	print("%8llu", tot_vbd_reqs(domain, FIELD_VBD_WR));
}
示例#5
0
文件: xentop.c 项目: Ultra-Seven/gxen
/* Compares number of total VBD READ requests of two domains,
   returning -1,0,1 * for <,=,> */
static int compare_vbd_rd(xenstat_domain *domain1, xenstat_domain *domain2)
{
	return -compare(tot_vbd_reqs(domain1, FIELD_VBD_RD),
			tot_vbd_reqs(domain2, FIELD_VBD_RD));
}
示例#6
0
/* Prints number of total VBD WRITE sectors statistic */
static void print_vbd_wsect(xenstat_domain *domain)
{
	print("%*llu", fields[FIELD_VBD_WSECT-1].default_width, tot_vbd_reqs(domain, FIELD_VBD_WSECT));
}
示例#7
0
/* Prints number of total VBD READ requests statistic */
static void print_vbd_rd(xenstat_domain *domain)
{
	print("%*llu", fields[FIELD_VBD_RD-1].default_width, tot_vbd_reqs(domain, FIELD_VBD_RD));
}