WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] This patch conditionalizes some output from perfc_printa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch conditionalizes some output from perfc_printall(), thus making relevant information more compact and easier
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 May 2006 17:22:08 +0000
Delivery-date: Tue, 02 May 2006 10:23:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 028f80cf0c996854494d9a0ac15ad3cc38f7dc25
# Parent  7af8039b3c571af038277ab6d7d288d1f2a7acf6
This patch conditionalizes some output from perfc_printall(), thus making 
relevant information more compact and easier
legible. It additionally changes the formatting so that trailing spaces are 
avoided.

Also changing 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 7af8039b3c57 -r 028f80cf0c99 xen/common/perfc.c
--- a/xen/common/perfc.c        Tue May 02 15:21:19 2006 +0100
+++ b/xen/common/perfc.c        Tue May 02 15:33:47 2006 +0100
@@ -37,7 +37,7 @@ struct perfcounter perfcounters;
 
 void perfc_printall(unsigned char key)
 {
-    int i, j, sum;
+    unsigned int i, j, sum;
     s_time_t now = NOW();
     atomic_t *counters = (atomic_t *)&perfcounters;
 
@@ -59,22 +59,28 @@ void perfc_printall(unsigned char key)
             sum = 0;
             for_each_online_cpu ( j )
                 sum += atomic_read(&counters[j]);
-            printk("TOTAL[%10d]  ", sum);
-            for_each_online_cpu ( j )
-                printk("CPU%02d[%10d]  ", j, atomic_read(&counters[j]));
+            printk("TOTAL[%10u]", sum);
+            if (sum)
+            {
+                for_each_online_cpu ( j )
+                    printk("  CPU%02d[%10d]", j, atomic_read(&counters[j]));
+            }
             counters += NR_CPUS;
             break;
         case TYPE_ARRAY:
         case TYPE_S_ARRAY:
             for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
                 sum += atomic_read(&counters[j]);
-            printk("TOTAL[%10d]  ", sum);
-#ifdef PERF_ARRAYS
-            for ( j = 0; j < perfc_info[i].nr_elements; j++ )
-            {
-                if ( (j != 0) && ((j % 4) == 0) )
-                    printk("\n                   ");
-                printk("ARR%02d[%10d]  ", j, atomic_read(&counters[j]));
+            printk("TOTAL[%10u]", sum);
+#ifdef PERF_ARRAYS
+            if (sum)
+            {
+                for ( j = 0; j < perfc_info[i].nr_elements; j++ )
+                {
+                    if ( (j % 4) == 0 )
+                        printk("\n                 ");
+                    printk("  ARR%02d[%10d]", j, atomic_read(&counters[j]));
+                }
             }
 #endif
             counters += j;
@@ -90,7 +96,7 @@ void perfc_printall(unsigned char key)
 
 void perfc_reset(unsigned char key)
 {
-    int i, j;
+    unsigned int i, j;
     s_time_t now = NOW();
     atomic_t *counters = (atomic_t *)&perfcounters;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch conditionalizes some output from perfc_printall(), thus making relevant information more compact and easier, Xen patchbot -unstable <=