[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xenpm: clean up print messages
# HG changeset patch # User Kevin Tian <kevin.tian@xxxxxxxxx> # Date 1310110381 -3600 # Node ID b8a2443097803feff48a7a79f147cde5cb316d81 # Parent 2faba14bac13d967981f7602f40815f060754c4a xenpm: clean up print messages Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx> --- diff -r 2faba14bac13 -r b8a244309780 tools/misc/xenpm.c --- a/tools/misc/xenpm.c Fri Jul 08 08:32:37 2011 +0100 +++ b/tools/misc/xenpm.c Fri Jul 08 08:33:01 2011 +0100 @@ -115,6 +115,9 @@ 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 @@ 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 @@ 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 @@ 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"); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |