ia64/xen-unstable

changeset 6864:aecdccb1a350

Add additional stats to track VHPT saturation
author djm@kirby.fc.hp.com
date Fri Sep 16 16:54:53 2005 -0600 (2005-09-16)
parents b52a48644770
children 0e548ff36960
files xen/arch/ia64/xen/privop.c xen/arch/ia64/xen/vhpt.c
line diff
     1.1 --- a/xen/arch/ia64/xen/privop.c	Fri Sep 16 16:53:30 2005 -0600
     1.2 +++ b/xen/arch/ia64/xen/privop.c	Fri Sep 16 16:54:53 2005 -0600
     1.3 @@ -1107,6 +1107,7 @@ int dump_privop_counts_to_user(char __us
     1.4  #ifdef PRIVOP_ADDR_COUNT
     1.5  	n += dump_privop_addrs(buf + n);
     1.6  #endif
     1.7 +	n += dump_vhpt_stats(buf + n);
     1.8  	n += dump_misc_stats(buf + n);
     1.9  	if (len < TMPBUFLEN) return -1;
    1.10  	if (__copy_to_user(ubuf,buf,n)) return -1;
    1.11 @@ -1122,6 +1123,7 @@ int zero_privop_counts_to_user(char __us
    1.12  #ifdef PRIVOP_ADDR_COUNT
    1.13  	zero_privop_addrs();
    1.14  #endif
    1.15 +	zero_vhpt_stats();
    1.16  	zero_misc_stats();
    1.17  	zero_reflect_counts();
    1.18  	if (len < TMPBUFLEN) return -1;
     2.1 --- a/xen/arch/ia64/xen/vhpt.c	Fri Sep 16 16:53:30 2005 -0600
     2.2 +++ b/xen/arch/ia64/xen/vhpt.c	Fri Sep 16 16:54:53 2005 -0600
     2.3 @@ -149,3 +149,24 @@ void vhpt_init(void)
     2.4  	vhpt_flush();
     2.5  }
     2.6  
     2.7 +
     2.8 +void zero_vhpt_stats(void)
     2.9 +{
    2.10 +	return;
    2.11 +}
    2.12 +
    2.13 +int dump_vhpt_stats(char *buf)
    2.14 +{
    2.15 +	int i;
    2.16 +	char *s = buf;
    2.17 +	struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
    2.18 +	unsigned long vhpt_valid = 0, vhpt_chains = 0;
    2.19 +
    2.20 +	for (i = 0; i < VHPT_NUM_ENTRIES; i++, v++) {
    2.21 +		if (!(v->ti_tag & INVALID_TI_TAG)) vhpt_valid++;
    2.22 +		if (v->CChain) vhpt_chains++;
    2.23 +	}
    2.24 +	s += sprintf(s,"VHPT usage: %ld/%ld (%ld collision chains)\n",
    2.25 +		vhpt_valid,VHPT_NUM_ENTRIES,vhpt_chains);
    2.26 +	return s - buf;
    2.27 +}