From 56d1d85a0c580aa20ca7d4b15f19ace899bb5b36 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Tue, 25 Oct 2011 16:46:47 +0100 Subject: x86 pm: provide CC7/PC2 residency Sandy bridge introduces new MSR to get cc7/pc2 residency (core C-state 7/package C-state 2). Print the cc7/pc2 residency when on sandy bridge platform. Signed-off-by: Yang Zhang Committed-by: Keir Fraser --- tools/misc/xenpm.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'tools/misc') diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c index d8192fe3ae..82784c552a 100644 --- a/tools/misc/xenpm.c +++ b/tools/misc/xenpm.c @@ -92,13 +92,17 @@ static void print_cxstat(int cpuid, struct xc_cx_stat *cxstat) printf(" residency [%020"PRIu64" ms]\n", cxstat->residencies[i]/1000000UL); } - printf("pc3 : [%020"PRIu64" ms]\n" + printf("pc2 : [%020"PRIu64" ms]\n" + "pc3 : [%020"PRIu64" ms]\n" "pc6 : [%020"PRIu64" ms]\n" "pc7 : [%020"PRIu64" ms]\n", - cxstat->pc3/1000000UL, cxstat->pc6/1000000UL, cxstat->pc7/1000000UL); + cxstat->pc2/1000000UL, cxstat->pc3/1000000UL, + cxstat->pc6/1000000UL, cxstat->pc7/1000000UL); printf("cc3 : [%020"PRIu64" ms]\n" - "cc6 : [%020"PRIu64" ms]\n", - cxstat->cc3/1000000UL, cxstat->cc6/1000000UL); + "cc6 : [%020"PRIu64" ms]\n" + "cc7 : [%020"PRIu64" ms]\n", + cxstat->cc3/1000000UL, cxstat->cc6/1000000UL, + cxstat->cc7/1000000UL); printf("\n"); } @@ -458,6 +462,9 @@ static void signal_int_handler(int signo) break; } printf("Socket %d\n", socket_ids[i]); + res = cxstat_end[j].pc2 - cxstat_start[j].pc2; + printf("\tPC2\t%"PRIu64" ms\t%.2f%%\n", res / 1000000UL, + 100UL * res / (double)sum_cx[j]); res = cxstat_end[j].pc3 - cxstat_start[j].pc3; printf("\tPC3\t%"PRIu64" ms\t%.2f%%\n", res / 1000000UL, 100UL * res / (double)sum_cx[j]); @@ -482,6 +489,9 @@ static void signal_int_handler(int signo) res = cxstat_end[j].cc6 - cxstat_start[j].cc6; printf("\t\tCC6\t%"PRIu64" ms\t%.2f%%\n", res / 1000000UL, 100UL * res / (double)sum_cx[j]); + res = cxstat_end[j].cc7 - cxstat_start[j].cc7; + printf("\t\tCC7\t%"PRIu64" ms\t%.2f%%\n", res / 1000000UL, + 100UL * res / (double)sum_cx[j]); printf("\n"); } -- cgit v1.2.3