Received: by 10.223.164.221 with SMTP id h29csp2181826wrb; Thu, 2 Nov 2017 07:07:05 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Ro+GX8qyGXFjzxGaPo7GIwylqc7Zx6MYCb8W6rb2SnOeiyGdRBO3+WVcClmo5WwXgj2UhJ X-Received: by 10.99.4.133 with SMTP id 127mr3683315pge.72.1509631625869; Thu, 02 Nov 2017 07:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509631625; cv=none; d=google.com; s=arc-20160816; b=xkCvsNxEwcb3vytEJ+9Rp/cDG/nMBUofIYMl92v9vNpUIQ4w2k72zVascJ5bmQs8X6 XR1+vhphqwLqPH/UJ7LFzi7rWxpJsIGpkOfQ0LrCPaPlTui7Lw79dMf44F5DFKjn2KJh CokFit0JhH8j0RMiP9V/VCJ0FOsF4mPZBfiCEiXSgdSfZTt9qJOqI7uYSPL/ndDvbxDF s7VOzrnShsTirpPpVt6wbKLHPx/J6fep4bc0MBT/StPtfyZx5rCpjmeNbo10b4JE0VFt /yUJi2Gs9pV1FYADiBd11rbAnluIISYgO3NEG5LpUQ2xhL1NyxJQ6t7cY8VrQV0BvEJm /x9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=oLbGlbsuWlqljm8D86lAu1pHtTo9UNT6RA/lzSbgv5Y=; b=Qz0O8xApI4xiV2IHd+yD7Rd70d0++xGlRXGPC85HuKxDUfCbcvXPeF+dEAJu744gmD svDqZuxiVXUCpP1dlSpw9UY3OOB2A8nFbBN0rubY6vW5CdvM74rPPRqiz3DdGPUhbhNA yWsBy3rMV44qqbKaBB2k3renesgqMNqpShaioCldyoYVN6R5dq5B/jD2c10kx/h+v92e Xix2IOwRKriPmIWPzEmW+znr3+jWTENnSh9LbvkwRFmVeFQG7VI0DdijkF6/RiqW2huG gcoApGG37cZu7qDv3D29kzC2qTmzV/hqfRWGQXtfd9g3sJcWRv5LjYoIYyJtBetaY9Ek 902g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a91si2318539pla.788.2017.11.02.07.06.52; Thu, 02 Nov 2017 07:07:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933124AbdKBOGO convert rfc822-to-8bit (ORCPT + 96 others); Thu, 2 Nov 2017 10:06:14 -0400 Received: from mga04.intel.com ([192.55.52.120]:27586 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbdKBOGN (ORCPT ); Thu, 2 Nov 2017 10:06:13 -0400 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2017 07:06:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,334,1505804400"; d="scan'208";a="170506550" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 02 Nov 2017 07:06:12 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 2 Nov 2017 07:06:12 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 2 Nov 2017 07:06:11 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Thu, 2 Nov 2017 22:06:10 +0800 From: "Liang, Kan" To: Thomas Gleixner CC: "peterz@infradead.org" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "eranian@google.com" , "ak@linux.intel.com" Subject: RE: [PATCH V3 1/5] perf/x86/intel/uncore: customized pmu event read for client IMC uncore Thread-Topic: [PATCH V3 1/5] perf/x86/intel/uncore: customized pmu event read for client IMC uncore Thread-Index: AQHTTPn8N2Thg1PlBU23gMJh7UBtUqMAoguAgACGaBD//3vBgIAAAViAgACGcoA= Date: Thu, 2 Nov 2017 14:06:10 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077537DCA32@SHSMSX103.ccr.corp.intel.com> References: <1508843124-4081-1-git-send-email-kan.liang@intel.com> <37D7C6CF3E00A74B8858931C1DB2F077537DCA04@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmQxOTE1OGItY2EyZC00YjVkLWIwYTUtY2ZmMDU2MDFlNGY1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlwvWmtEWEtlVEJyajRkK1V0YXAzeDU1VXB5eHVBSTZ2cEhFd29GYXlQaVJnPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Thu, 2 Nov 2017, Thomas Gleixner wrote: > > On Thu, 2 Nov 2017, Liang, Kan wrote: > > > > On Tue, 24 Oct 2017, kan.liang@intel.com wrote: > > > > > - if (event->hw.idx >= UNCORE_PMC_IDX_FIXED) > > > > > + if (event->hw.idx == UNCORE_PMC_IDX_FIXED) > > > > > shift = 64 - uncore_fixed_ctr_bits(box); > > > > > else > > > > > shift = 64 - uncore_perf_ctr_bits(box); diff --git > > > > > a/arch/x86/events/intel/uncore_snb.c > > > > > b/arch/x86/events/intel/uncore_snb.c > > > > > index db1127c..9d5cd3f 100644 > > > > > --- a/arch/x86/events/intel/uncore_snb.c > > > > > +++ b/arch/x86/events/intel/uncore_snb.c > > > > > @@ -498,6 +498,30 @@ static void snb_uncore_imc_event_del(struct > > > > perf_event *event, int flags) > > > > > snb_uncore_imc_event_stop(event, PERF_EF_UPDATE); } > > > > > > > > > > +static void snb_uncore_imc_event_read(struct perf_event *event) { > > > > > + struct intel_uncore_box *box = uncore_event_to_box(event); > > > > > + u64 prev_count, new_count, delta; > > > > > + int shift; > > > > > + > > > > > + if (event->hw.idx >= UNCORE_PMC_IDX_FIXED) > > > > > > > > And this needs to be >= because? > > > > > > Patch 5/5 will clean up the client IMC uncore. > > > Before that, we still need it to make client IMC uncore work. > > > > > > This patch isolates the >= case for client IMC uncore. > > > > Fair enough. A comment to that effect (even when removed later) would > > have avoided that question. > > Thinking more about it. The current code only supports the fixed one, right? > So why would it deal with anything > FIXED? > There are two free running counters in IMC. To support the second one, the previous code implicitly do UNCORE_PMC_IDX_FIXED + 1. So it has to deal with > FIXED case. case SNB_UNCORE_PCI_IMC_DATA_READS: base = SNB_UNCORE_PCI_IMC_DATA_READS_BASE; idx = UNCORE_PMC_IDX_FIXED; break; case SNB_UNCORE_PCI_IMC_DATA_WRITES: base = SNB_UNCORE_PCI_IMC_DATA_WRITES_BASE; idx = UNCORE_PMC_IDX_FIXED + 1; break; default: return -EINVAL; Thanks, Kan From 1582963099515986972@xxx Thu Nov 02 14:00:51 +0000 2017 X-GM-THRID: 1582166476632080836 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread