ia64/xen-unstable

changeset 9917:42c73f3d7ac1

This patch changes to format in which EIP is printed to be consistent on 64-bit regardless of whether the addresses
leading bits are set or clear. It additionally changes the formatting so that trailing spaces are avoided, and it
suppresses the printing of empty records. It also prevents combining records with identical EIP but from different
domains.

It further changes the type of some variables from plain int to unsigned int, as that is yielding more efficient code
on x86-64 (signed 32-bit array indices require explicit sign extension, whereas in most cases an extra copy can be
avoided when the index type is unsigned, since all 32-bit operations already zero-extend their results).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue May 02 15:36:07 2006 +0100 (2006-05-02)
parents 028f80cf0c99
children 8f0f24dae963
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Tue May 02 15:33:47 2006 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Tue May 02 15:36:07 2006 +0100
     1.3 @@ -2917,7 +2917,7 @@ static inline unsigned int ptwr_eip_stat
     1.4  
     1.5  static void ptwr_eip_stat_inc(u32 *n)
     1.6  {
     1.7 -    int i, j;
     1.8 +    unsigned int i, j;
     1.9  
    1.10      if ( ++(*n) != 0 )
    1.11          return;
    1.12 @@ -2925,14 +2925,14 @@ static void ptwr_eip_stat_inc(u32 *n)
    1.13      *n = ~0;
    1.14  
    1.15      /* Re-scale all buckets. */
    1.16 -    for ( i = 0; i <ptwr_eip_buckets; i++ )
    1.17 +    for ( i = 0; i < ptwr_eip_buckets; i++ )
    1.18          for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ )
    1.19              ptwr_eip_stats[i].val[j] >>= 1;
    1.20  }
    1.21  
    1.22  static void ptwr_eip_stat_update(unsigned long eip, domid_t id, int modified)
    1.23  {
    1.24 -    int i, j, b;
    1.25 +    unsigned int i, j, b;
    1.26  
    1.27      i = b = ptwr_eip_stat_hash(eip, id);
    1.28  
    1.29 @@ -2946,7 +2946,7 @@ static void ptwr_eip_stat_update(unsigne
    1.30              memset(ptwr_eip_stats[i].val,0, sizeof(ptwr_eip_stats[i].val));
    1.31          }
    1.32  
    1.33 -        if ( ptwr_eip_stats[i].eip == eip )
    1.34 +        if ( ptwr_eip_stats[i].eip == eip && ptwr_eip_stats[i].id == id)
    1.35          {
    1.36              for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ )
    1.37                  if ( modified <= ptwr_eip_stat_threshold[j] )
    1.38 @@ -2975,7 +2975,7 @@ void ptwr_eip_stat_print(void)
    1.39  {
    1.40      struct domain *e;
    1.41      domid_t d;
    1.42 -    int i, j;
    1.43 +    unsigned int i, j;
    1.44  
    1.45      for_each_domain( e )
    1.46      {
    1.47 @@ -2983,11 +2983,11 @@ void ptwr_eip_stat_print(void)
    1.48  
    1.49          for ( i = 0; i < ptwr_eip_buckets; i++ )
    1.50          {
    1.51 -            if ( ptwr_eip_stats[i].eip && ptwr_eip_stats[i].id != d )
    1.52 +            if ( !ptwr_eip_stats[i].eip || ptwr_eip_stats[i].id != d )
    1.53                  continue;
    1.54  
    1.55 -            printk("D %d  eip %08lx ",
    1.56 -                   ptwr_eip_stats[i].id, ptwr_eip_stats[i].eip);
    1.57 +            printk("D %5d  eip %p ",
    1.58 +                   ptwr_eip_stats[i].id, (void *)ptwr_eip_stats[i].eip);
    1.59  
    1.60              for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ )
    1.61                  printk("<=%u %4u \t",