From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v4 3/4] tools: add tools support for Intel CDP Date: Thu, 24 Sep 2015 12:07:27 +0100 Message-ID: <1443092847.10338.283.camel@citrix.com> References: <1442482536-12024-1-git-send-email-he.chen@linux.intel.com> <1442482536-12024-4-git-send-email-he.chen@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zf4NB-0002V5-5v for xen-devel@lists.xenproject.org; Thu, 24 Sep 2015 11:07:33 +0000 In-Reply-To: <1442482536-12024-4-git-send-email-he.chen@linux.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: He Chen , xen-devel@lists.xenproject.org Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com, chao.p.peng@linux.intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-09-17 at 17:35 +0800, He Chen wrote: > @@ -8410,20 +8415,29 @@ static void psr_cat_print_one_domain_cbm(uint32_t > domid, uint32_t socketid) > printf("%5d%25s", domid, domain_name); > free(domain_name); > > - if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CBM, > - socketid, &cbm)) > - printf("%#16"PRIx64, cbm); > - > + if (!cdp_enabled) { > + if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CBM, > + socketid, &cbm)) > + printf("%#16"PRIx64, cbm); > + } else { > + if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CODE, > + socketid, &cbm)) > + printf("%10s%#8"PRIx64, "code:", cbm); > + if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_DATA, > + socketid, &cbm)) > + printf("%10s%#8"PRIx64, "data:", cbm); > + } Does cdp being enabled mean that the original L3_CBM functionality is no longer available then? Please could you give an example of the new output format for this command in the commit message. > static int psr_cat_show(uint32_t domid) > @@ -8489,6 +8503,8 @@ int main_psr_cat_cbm_set(int argc, char **argv) > libxl_psr_cbm_type type = LIBXL_PSR_CBM_TYPE_L3_CBM; > uint64_t cbm; > int ret, opt = 0; > + int opt_data = 0; > + int opt_code = 0; > libxl_bitmap target_map; > char *value; > libxl_string_list socket_list; > > [...] > @@ -8517,8 +8535,19 @@ int main_psr_cat_cbm_set(int argc, char **argv) > libxl_string_list_dispose(&socket_list); > free(value); > break; > + case 'd': > + type = LIBXL_PSR_CBM_TYPE_L3_DATA; > + opt_data = 1; > + break; > + case 'c': > + type = LIBXL_PSR_CBM_TYPE_L3_CODE; > + opt_code = 1; > + break; > } > > + if (opt_data && opt_code) Do you not mean !opt_data && !opt_code? But also, isn't this assignment unnecessary since type is initialised to the same value when it is declared? In fact, because of that initialisation, aren't opt_data and opt_code unnecessary, since you set type appropriately elsewhere. Are -d and -c mutually exclusive, or is it expected that both can be given?