ia64/xen-unstable

changeset 6439:af7251014caf

Formatting fixes for xenstat and xentop.
Signed-off-by: Josh Triplett <josht@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri Aug 26 08:47:49 2005 +0000 (2005-08-26)
parents f850ac27a8d2
children 9404574350ce
files tools/xenstat/libxenstat/src/xen-interface.c tools/xenstat/libxenstat/src/xenstat.c tools/xenstat/libxenstat/src/xenstat.h tools/xenstat/xentop/xentop.c
line diff
     1.1 --- a/tools/xenstat/libxenstat/src/xen-interface.c	Fri Aug 26 08:46:28 2005 +0000
     1.2 +++ b/tools/xenstat/libxenstat/src/xen-interface.c	Fri Aug 26 08:47:49 2005 +0000
     1.3 @@ -59,14 +59,15 @@ void xi_uninit(xi_handle *handle)
     1.4  }
     1.5  
     1.6  /* Make simple xen version hypervisor calls */
     1.7 -static int xi_make_xen_version_hypercall(xi_handle *handle, long *vnum, xen_extraversion_t *ver)
     1.8 +static int xi_make_xen_version_hypercall(xi_handle *handle, long *vnum,
     1.9 +					 xen_extraversion_t *ver)
    1.10  {
    1.11  	privcmd_hypercall_t privcmd;
    1.12  	multicall_entry_t multicall[2];
    1.13  	int ret = 0;
    1.14  
    1.15  	/* set up for doing hypercall */
    1.16 -	privcmd.op = __HYPERVISOR_multicall; 
    1.17 +	privcmd.op = __HYPERVISOR_multicall;
    1.18  	privcmd.arg[0] = (unsigned long)multicall;
    1.19  	privcmd.arg[1] = 2;
    1.20  
    1.21 @@ -75,7 +76,7 @@ static int xi_make_xen_version_hypercall
    1.22  	multicall[0].args[0] = (unsigned long)XENVER_version;
    1.23  
    1.24  	/* second to get xen version flag */
    1.25 -	multicall[1].op = __HYPERVISOR_xen_version; 
    1.26 +	multicall[1].op = __HYPERVISOR_xen_version;
    1.27  	multicall[1].args[0] = (unsigned long)XENVER_extraversion;
    1.28  	multicall[1].args[1] = (unsigned long)ver;
    1.29  
    1.30 @@ -104,7 +105,8 @@ static int xi_make_xen_version_hypercall
    1.31  }
    1.32  
    1.33  /* Make Xen Dom0 op hypervisor call */
    1.34 -static int xi_make_dom0_op(xi_handle *handle, dom0_op_t *dom_op, int dom_opcode)
    1.35 +static int xi_make_dom0_op(xi_handle *handle, dom0_op_t *dom_op,
    1.36 +			   int dom_opcode)
    1.37  {
    1.38  	privcmd_hypercall_t privcmd;
    1.39  	int ret = 0;
    1.40 @@ -191,11 +193,10 @@ long long xi_get_vcpu_usage(xi_handle *h
    1.41  }
    1.42  
    1.43  /* gets xen version information from hypervisor */
    1.44 -int xi_get_xen_version(xi_handle *handle, long *vnum, xen_extraversion_t *ver) 
    1.45 +int xi_get_xen_version(xi_handle *handle, long *vnum, xen_extraversion_t *ver)
    1.46  {
    1.47 -
    1.48 -        /* gets the XENVER_version and XENVER_extraversion */
    1.49 -	if (xi_make_xen_version_hypercall( handle, vnum, ver) < 0) {; 
    1.50 +	/* gets the XENVER_version and XENVER_extraversion */
    1.51 +	if (xi_make_xen_version_hypercall( handle, vnum, ver) < 0) {
    1.52  		perror("XEN VERSION Hypercall failed");
    1.53  		return -1;
    1.54  	}
     2.1 --- a/tools/xenstat/libxenstat/src/xenstat.c	Fri Aug 26 08:46:28 2005 +0000
     2.2 +++ b/tools/xenstat/libxenstat/src/xenstat.c	Fri Aug 26 08:47:49 2005 +0000
     2.3 @@ -33,7 +33,7 @@ struct xenstat_handle {
     2.4  	FILE *procnetdev;
     2.5  };
     2.6  
     2.7 -#define SHORT_ASC_LEN 5 		/* length of 65535 */
     2.8 +#define SHORT_ASC_LEN 5                 /* length of 65535 */
     2.9  #define VERSION_SIZE (2 * SHORT_ASC_LEN + 1 + sizeof(xen_extraversion_t) + 1)
    2.10  
    2.11  struct xenstat_node {
    2.12 @@ -170,7 +170,7 @@ xenstat_node *xenstat_get_node(xenstat_h
    2.13  	xenstat_node *node;
    2.14  	dom0_physinfo_t physinfo;
    2.15  	xen_extraversion_t version;
    2.16 -	long vnum = 0; 
    2.17 +	long vnum = 0;
    2.18  	dom0_getdomaininfo_t domaininfo[DOMAIN_CHUNK_SIZE];
    2.19  	unsigned int num_domains, new_domains;
    2.20  	unsigned int i;
    2.21 @@ -188,11 +188,11 @@ xenstat_node *xenstat_get_node(xenstat_h
    2.22  
    2.23  	/* Get the xen version number and xen version tag */
    2.24  	if (xi_get_xen_version(handle->xihandle, &vnum, &version) < 0) {
    2.25 -		free(node); 
    2.26 +		free(node);
    2.27  		return NULL;
    2.28 -	} 
    2.29 -	snprintf(node->xen_version, VERSION_SIZE,
    2.30 -		"%ld.%ld%s\n", ((vnum >> 16) & 0xFFFF), vnum & 0xFFFF, (char *)version); 
    2.31 +	}
    2.32 +	snprintf(node->xen_version, VERSION_SIZE, "%ld.%ld%s\n",
    2.33 +		 ((vnum >> 16) & 0xFFFF), vnum & 0xFFFF, version);
    2.34  
    2.35  	node->cpu_hz = ((unsigned long long)physinfo.cpu_khz) * 1000ULL;
    2.36  	node->num_cpus =
     3.1 --- a/tools/xenstat/libxenstat/src/xenstat.h	Fri Aug 26 08:46:28 2005 +0000
     3.2 +++ b/tools/xenstat/libxenstat/src/xenstat.h	Fri Aug 26 08:47:49 2005 +0000
     3.3 @@ -51,6 +51,7 @@ xenstat_domain *xenstat_node_domain(xens
     3.4  /* Get the domain with the given index; used to loop over all domains. */
     3.5  xenstat_domain *xenstat_node_domain_by_index(xenstat_node * node,
     3.6  					     unsigned index);
     3.7 +
     3.8  /* Get xen version of the node */
     3.9  const char *xenstat_node_xen_ver(xenstat_node * node);
    3.10  
     4.1 --- a/tools/xenstat/xentop/xentop.c	Fri Aug 26 08:46:28 2005 +0000
     4.2 +++ b/tools/xenstat/xentop/xentop.c	Fri Aug 26 08:47:49 2005 +0000
     4.3 @@ -519,8 +519,8 @@ static void print_nets(xenstat_domain *d
     4.4  	print("%4u", xenstat_domain_num_networks(domain));
     4.5  }
     4.6  
     4.7 -/* Compares number of total network tx bytes of two domains, returning -1,0,1 for
     4.8 - * <,=,> */
     4.9 +/* Compares number of total network tx bytes of two domains, returning -1,0,1
    4.10 + * for <,=,> */
    4.11  static int compare_net_tx(xenstat_domain *domain1, xenstat_domain *domain2)
    4.12  {
    4.13  	return -compare(tot_net_bytes(domain1, FALSE),
    4.14 @@ -533,8 +533,8 @@ static void print_net_tx(xenstat_domain 
    4.15  	print("%8llu", tot_net_bytes(domain, FALSE)/1024);
    4.16  }
    4.17  
    4.18 -/* Compares number of total network rx bytes of two domains, returning -1,0,1 for
    4.19 - * <,=,> */
    4.20 +/* Compares number of total network rx bytes of two domains, returning -1,0,1
    4.21 + * for <,=,> */
    4.22  static int compare_net_rx(xenstat_domain *domain1, xenstat_domain *domain2)
    4.23  {
    4.24  	return -compare(tot_net_bytes(domain1, TRUE),
    4.25 @@ -555,7 +555,7 @@ static unsigned long long tot_net_bytes(
    4.26  	int i = 0;
    4.27  	xenstat_network *network;
    4.28  	unsigned num_networks = 0;
    4.29 -        unsigned long long total = 0;
    4.30 +	unsigned long long total = 0;
    4.31  
    4.32  	/* How many networks? */
    4.33  	num_networks = xenstat_domain_num_networks(domain);
    4.34 @@ -564,12 +564,13 @@ static unsigned long long tot_net_bytes(
    4.35  	for (i=0; i < num_networks; i++) {
    4.36  		/* Next get the network information */
    4.37  		network = xenstat_domain_network(domain,i);
    4.38 -                if (rx_flag) 
    4.39 +		if (rx_flag)
    4.40  			total += xenstat_network_rbytes(network);
    4.41 -                else 
    4.42 +		else
    4.43  			total += xenstat_network_tbytes(network);
    4.44  	}
    4.45 -        return (total);
    4.46 +
    4.47 +	return total;
    4.48  }
    4.49  
    4.50  /* Compares security id (ssid) of two domains, returning -1,0,1 for <,=,> */