From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Donald D Dugger <donald.d.dugger@intel.com>,
Jun Nakajima <jun.nakajima@intel.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 3/3] xenpm: use new Cx statistics interface
Date: Wed, 05 Mar 2014 10:47:49 -0500 [thread overview]
Message-ID: <53174725.4010500@oracle.com> (raw)
In-Reply-To: <53170C8A020000780012121A@nat28.tlf.novell.com>
On 03/05/2014 05:37 AM, Jan Beulich wrote:
> @@ -331,7 +346,7 @@ void pxstat_func(int argc, char *argv[])
> }
>
> static uint64_t usec_start, usec_end;
> -static struct xc_cx_stat *cxstat, *cxstat_start, *cxstat_end;
> +static struct xc_cx_stat_v2 *cxstat, *cxstat_start, *cxstat_end;
> static struct xc_px_stat *pxstat, *pxstat_start, *pxstat_end;
> static int *avgfreq;
> static uint64_t *sum, *sum_cx, *sum_px;
> @@ -482,25 +497,26 @@ static void signal_int_handler(int signo
> /* print out CC? and PC? */
> for ( i = 0; i < socket_nr; i++ )
> {
> + unsigned int n;
> uint64_t res;
> +
> for ( j = 0; j <= info.max_cpu_index; j++ )
> {
> if ( cpu_to_socket[j] == socket_ids[i] )
> break;
> }
> printf("\nSocket %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]);
> - res = cxstat_end[j].pc6 - cxstat_start[j].pc6;
> - printf("\tPC6\t%"PRIu64" ms\t%.2f%%\n", res / 1000000UL,
> - 100UL * res / (double)sum_cx[j]);
> - res = cxstat_end[j].pc7 - cxstat_start[j].pc7;
> - printf("\tPC7\t%"PRIu64" ms\t%.2f%%\n", res / 1000000UL,
> - 100UL * res / (double)sum_cx[j]);
> + for ( n = 0; n < MAX_PKG_RESIDENCIES; ++n )
> + {
> + if ( n >= cxstat_end[j].nr_pc )
> + continue;
> + res = cxstat_end[j].pc[n];
> + if ( n < cxstat_start[j].nr_pc )
> + res -= cxstat_start[j].pc[n];
Is it possible to have cxstat_end[j].nr_pc != cxstat_start[j].nr_pc ?
-boris
> + printf("\tPC%u\t%"PRIu64" ms\t%.2f%%\n",
> + n + 1, res / 1000000UL,
> + 100UL * res / (double)sum_cx[j]);
> + }
> for ( k = 0; k < core_nr; k++ )
> {
> for ( j = 0; j <= info.max_cpu_index; j++ )
> @@ -510,15 +526,17 @@ static void signal_int_handler(int signo
> break;
> }
> printf("\t Core %d CPU %d\n", core_ids[k], j);
> - res = cxstat_end[j].cc3 - cxstat_start[j].cc3;
> - printf("\t\tCC3\t%"PRIu64" ms\t%.2f%%\n", res / 1000000UL,
> - 100UL * res / (double)sum_cx[j]);
> - 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]);
> + for ( n = 0; n < MAX_CORE_RESIDENCIES; ++n )
> + {
> + if ( n >= cxstat_end[j].nr_cc )
> + continue;
> + res = cxstat_end[j].cc[n];
> + if ( n < cxstat_start[j].nr_cc )
> + res -= cxstat_start[j].cc[n];
> + printf("\t\tCC%u\t%"PRIu64" ms\t%.2f%%\n",
> + n + 1, res / 1000000UL,
> + 100UL * res / (double)sum_cx[j]);
> + }
> }
> }
> }
> @@ -529,6 +547,8 @@ static void signal_int_handler(int signo
> {
> free(cxstat[i].triggers);
> free(cxstat[i].residencies);
> + free(cxstat[i].pc);
> + free(cxstat[i].cc);
> free(pxstat[i].trans_pt);
> free(pxstat[i].pt);
> }
next prev parent reply other threads:[~2014-03-05 15:45 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 10:34 [PATCH 0/3] x86: support further Intel CPU families Jan Beulich
2014-03-05 10:36 ` [PATCH 1/3] " Jan Beulich
2014-03-18 2:44 ` Tian, Kevin
2014-03-05 10:37 ` [PATCH 2/3] x86/idle: update to include further package/core residency MSRs Jan Beulich
2014-03-05 10:42 ` Jan Beulich
2014-03-18 2:44 ` Tian, Kevin
2014-03-05 15:07 ` Boris Ostrovsky
2014-03-05 15:15 ` Jan Beulich
2014-03-05 15:30 ` Boris Ostrovsky
2014-03-13 14:11 ` Ian Campbell
2014-03-13 14:27 ` Jan Beulich
2014-03-13 15:34 ` Ian Campbell
2014-03-13 15:48 ` Jan Beulich
2014-03-13 15:53 ` Ian Campbell
2014-03-18 16:18 ` Ian Jackson
2014-03-18 16:25 ` Jan Beulich
2014-03-13 14:28 ` Keir Fraser
2014-03-05 10:37 ` [PATCH 3/3] xenpm: use new Cx statistics interface Jan Beulich
2014-03-05 15:47 ` Boris Ostrovsky [this message]
2014-03-05 15:53 ` Jan Beulich
2014-03-05 17:05 ` Boris Ostrovsky
2014-03-06 9:37 ` Jan Beulich
2014-03-13 14:12 ` Ian Campbell
2014-03-18 2:45 ` Tian, Kevin
2014-03-12 9:38 ` Ping: [PATCH 0/3] x86: support further Intel CPU families Jan Beulich
2014-03-12 10:18 ` Ian Campbell
2014-03-17 13:28 ` [PATCH v2 0/2] " Jan Beulich
2014-03-17 13:38 ` [PATCH v2 1/2] x86: Intel CPU family update Jan Beulich
2014-03-17 13:39 ` [PATCH v2 2/2] x86/idle: update to include further package/core residency MSRs Jan Beulich
2014-03-17 13:43 ` Ian Campbell
2014-03-17 15:48 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53174725.4010500@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=donald.d.dugger@intel.com \
--cc=ian.campbell@citrix.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).