# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 42c73f3d7ac1a8c831496e16c36529080d1a9fba
# Parent 028f80cf0c996854494d9a0ac15ad3cc38f7dc25
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@xxxxxxxxxx>
diff -r 028f80cf0c99 -r 42c73f3d7ac1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue May 02 15:33:47 2006 +0100
+++ b/xen/arch/x86/mm.c Tue May 02 15:36:07 2006 +0100
@@ -2917,7 +2917,7 @@ static inline unsigned int ptwr_eip_stat
static void ptwr_eip_stat_inc(u32 *n)
{
- int i, j;
+ unsigned int i, j;
if ( ++(*n) != 0 )
return;
@@ -2925,14 +2925,14 @@ static void ptwr_eip_stat_inc(u32 *n)
*n = ~0;
/* Re-scale all buckets. */
- for ( i = 0; i <ptwr_eip_buckets; i++ )
+ for ( i = 0; i < ptwr_eip_buckets; i++ )
for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ )
ptwr_eip_stats[i].val[j] >>= 1;
}
static void ptwr_eip_stat_update(unsigned long eip, domid_t id, int modified)
{
- int i, j, b;
+ unsigned int i, j, b;
i = b = ptwr_eip_stat_hash(eip, id);
@@ -2946,7 +2946,7 @@ static void ptwr_eip_stat_update(unsigne
memset(ptwr_eip_stats[i].val,0, sizeof(ptwr_eip_stats[i].val));
}
- if ( ptwr_eip_stats[i].eip == eip )
+ if ( ptwr_eip_stats[i].eip == eip && ptwr_eip_stats[i].id == id)
{
for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ )
if ( modified <= ptwr_eip_stat_threshold[j] )
@@ -2975,7 +2975,7 @@ void ptwr_eip_stat_print(void)
{
struct domain *e;
domid_t d;
- int i, j;
+ unsigned int i, j;
for_each_domain( e )
{
@@ -2983,11 +2983,11 @@ void ptwr_eip_stat_print(void)
for ( i = 0; i < ptwr_eip_buckets; i++ )
{
- if ( ptwr_eip_stats[i].eip && ptwr_eip_stats[i].id != d )
+ if ( !ptwr_eip_stats[i].eip || ptwr_eip_stats[i].id != d )
continue;
- printk("D %d eip %08lx ",
- ptwr_eip_stats[i].id, ptwr_eip_stats[i].eip);
+ printk("D %5d eip %p ",
+ ptwr_eip_stats[i].id, (void *)ptwr_eip_stats[i].eip);
for ( j = 0; j < ptwr_eip_stat_thresholdN; j++ )
printk("<=%u %4u \t",
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|