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-devel

[Xen-devel] [PATCH 2/2] xenpm: clean up print messages

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2/2] xenpm: clean up print messages
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Tue, 5 Jul 2011 15:20:39 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "Carsten Schiers \(carsten@xxxxxxxxxx\)" <carsten@xxxxxxxxxx>
Delivery-date: Tue, 05 Jul 2011 00:23:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acw65Aq9hfG0Eg+HTiGHi9evIjFosA==
Thread-topic: [PATCH 2/2] xenpm: clean up print messages
xenpm: clean up print messages

Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>

diff -r 33717472f37e tools/misc/xenpm.c
--- a/tools/misc/xenpm.c        Tue Jun 28 18:15:44 2011 +0100
+++ b/tools/misc/xenpm.c        Tue Jul 05 14:37:52 2011 +0800
@@ -115,6 +115,9 @@ static int get_cxstat_by_cpuid(xc_interf
     if ( !cxstat )
         return -EINVAL;
 
+    if ( !max_cx_num )
+        return -ENODEV;
+
     cxstat->triggers = malloc(max_cx_num * sizeof(uint64_t));
     if ( !cxstat->triggers )
         return -ENOMEM;
@@ -147,7 +150,7 @@ static int show_max_cstate(xc_interface 
     if ( (ret = xc_get_cpuidle_max_cstate(xc_handle, &value)) )
         return ret;
 
-    printf("Max C-state: C%d\n\n", value);
+    printf("Max possible C-state: C%d\n\n", value);
     return 0;
 }
 
@@ -158,7 +161,11 @@ static int show_cxstat_by_cpuid(xc_inter
 
     ret = get_cxstat_by_cpuid(xc_handle, cpuid, &cxstatinfo);
     if ( ret )
+    {
+        if ( ret == -ENODEV )
+            printf("Either xen cpuidle is disabled or no valid information is 
registered!\n");
         return ret;
+    }
 
     print_cxstat(cpuid, &cxstatinfo);
 
@@ -1191,7 +1198,7 @@ int main(int argc, char *argv[])
 
     if ( nr_matches > 1 )
     {
-        fprintf(stderr, "Ambigious options: ");
+        fprintf(stderr, "Ambiguous options: ");
         for ( i = 0; i < nr_matches; i++ )
             fprintf(stderr, " %s", main_options[matches_main_options[i]].name);
         fprintf(stderr, "\n");

Attachment: 20110705_xenpm_cleanup.patch
Description: 20110705_xenpm_cleanup.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/2] xenpm: clean up print messages, Tian, Kevin <=