direct-io.hg

changeset 10605:0e5635d68de3

[IA64] per cpu vhpt stats

dump_vhpt_stats: disp usage per cpu.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Wed Jun 21 11:17:08 2006 -0600 (2006-06-21)
parents 811c02dbe595
children bf396988059e
files xen/arch/ia64/xen/vhpt.c
line diff
     1.1 --- a/xen/arch/ia64/xen/vhpt.c	Wed Jun 21 11:15:08 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/vhpt.c	Wed Jun 21 11:17:08 2006 -0600
     1.3 @@ -266,16 +266,21 @@ void zero_vhpt_stats(void)
     1.4  
     1.5  int dump_vhpt_stats(char *buf)
     1.6  {
     1.7 -	int i;
     1.8 +	int i, cpu;
     1.9  	char *s = buf;
    1.10 -	struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
    1.11 -	unsigned long vhpt_valid = 0, vhpt_chains = 0;
    1.12 +
    1.13 +	s += sprintf(s,"VHPT usage (%ld entries):\n",
    1.14 +		     (unsigned long) VHPT_NUM_ENTRIES);
    1.15  
    1.16 -	for (i = 0; i < VHPT_NUM_ENTRIES; i++, v++) {
    1.17 -		if (!(v->ti_tag & INVALID_TI_TAG)) vhpt_valid++;
    1.18 -		if (v->CChain) vhpt_chains++;
    1.19 +	for_each_present_cpu (cpu) {
    1.20 +		struct vhpt_lf_entry *v = __va(per_cpu(vhpt_paddr, cpu));
    1.21 +		unsigned long vhpt_valid = 0;
    1.22 +
    1.23 +		for (i = 0; i < VHPT_NUM_ENTRIES; i++, v++)
    1.24 +			if (!(v->ti_tag & INVALID_TI_TAG))
    1.25 +				vhpt_valid++;
    1.26 +		s += sprintf(s,"  cpu %d: %ld\n", cpu, vhpt_valid);
    1.27  	}
    1.28 -	s += sprintf(s,"VHPT usage: %ld/%ld (%ld collision chains)\n",
    1.29 -		vhpt_valid, (unsigned long) VHPT_NUM_ENTRIES, vhpt_chains);
    1.30 +
    1.31  	return s - buf;
    1.32  }