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] [xen-unstable] xenpm tool: add average C state residency

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpm tool: add average C state residency
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Feb 2009 04:10:14 -0800
Delivery-date: Wed, 18 Feb 2009 04:10:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1234868911 0
# Node ID 6e9daf1dc5b3ac94f2f01ca02c6f090aca70802c
# Parent  261ccf78bea65e2a2d8f1e33e21c90f85ad7faff
xenpm tool: add average C state residency

Signed-off-by: Yu Ke <ke.yu@xxxxxxxxx>
---
 tools/misc/xenpm.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff -r 261ccf78bea6 -r 6e9daf1dc5b3 tools/misc/xenpm.c
--- a/tools/misc/xenpm.c        Tue Feb 17 11:07:29 2009 +0000
+++ b/tools/misc/xenpm.c        Tue Feb 17 11:08:31 2009 +0000
@@ -303,35 +303,34 @@ static void signal_int_handler(int signo
     printf("Elapsed time (ms): %"PRIu64"\n", (usec_end - usec_start) / 1000UL);
     for ( i = 0; i < max_cpu_nr; i++ )
     {
-        uint64_t temp;
-        printf("CPU%d:\n\tresidency\tpercentage\n", i);
-        if ( cx_cap )
+        uint64_t res, triggers;
+        double avg_res;
+
+        printf("\nCPU%d:\tResidency(ms)\t\tAvg Res(ms)\n",i);
+        if ( cx_cap && sum_cx[i] > 0 )
         {
             for ( j = 0; j < cxstat_end[i].nr; j++ )
             {
-                if ( sum_cx[i] > 0 )
-                {
-                    temp = cxstat_end[i].residencies[j] -
-                           cxstat_start[i].residencies[j];
-                    printf("  C%d\t%"PRIu64" ms\t%.2f%%\n", j,
-                           temp / 1000000UL, 100UL * temp / (double)sum_cx[i]);
-                }
+                res = cxstat_end[i].residencies[j] -
+                    cxstat_start[i].residencies[j];
+                triggers = cxstat_end[i].triggers[j] -
+                    cxstat_start[i].triggers[j];
+                avg_res = (triggers==0) ? 0: (double)res/triggers/1000000.0;
+                printf("  C%d\t%"PRIu64"\t(%5.2f%%)\t%.2f\n", j, res/1000000UL,
+                        100 * res / (double)sum_cx[i], avg_res );
             }
+            printf("\n");
         }
-        if ( px_cap )
+        if ( px_cap && sum_px[i]>0 )
         {
             for ( j = 0; j < pxstat_end[i].total; j++ )
             {
-                if ( sum_px[i] > 0 )
-                {
-                    temp = pxstat_end[i].pt[j].residency -
-                           pxstat_start[i].pt[j].residency;
-                    printf("  P%d\t%"PRIu64" ms\t%.2f%%\n", j,
-                           temp / 1000000UL, 100UL * temp / (double)sum_px[i]);
-                }
+                res = pxstat_end[i].pt[j].residency -
+                    pxstat_start[i].pt[j].residency;
+                printf("  P%d\t%"PRIu64"\t(%5.2f%%)\n", j,
+                        res / 1000000UL, 100UL * res / (double)sum_px[i]);
             }
         }
-        printf("\n");
     }
 
     /* some clean up and then exits */
@@ -408,6 +407,7 @@ void start_gather_func(int argc, char *a
         free(cxstat);
         return ;
     }
+    printf("Start sampling, waiting for CTRL-C or SIGINT signal ...\n");
 
     pause();
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenpm tool: add average C state residency, Xen patchbot-unstable <=