Received: by 10.223.176.46 with SMTP id f43csp4743169wra; Tue, 23 Jan 2018 14:03:17 -0800 (PST) X-Google-Smtp-Source: AH8x226rr9bD4pVXDykfrac6GG0qRiOoriGHOJkzZEeY26rgMJcirU8On0oefiOvt7BREmUJyoF5 X-Received: by 10.36.112.15 with SMTP id f15mr5868249itc.20.1516744996930; Tue, 23 Jan 2018 14:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516744996; cv=none; d=google.com; s=arc-20160816; b=IxBOQuuOwpSG31qjUweVsTPYQ9hMo0loaJ+2QbNtJA0wQXzl+989Fq+rs3MNwhjegR 9eyatgzF2k+3Ixtd2JojZ3x2joL4Rbj14Xok7vdOr86gX3Qc7/1Eiw36TGnyaxO/CFK9 cVrR1oZpA04VyeVRZhnOyDIJ7oXfBPfIpWJAYOLe0KKFIoVTSz7J1NJMErpwys+WHAXt /HSBL2dgAeHcTBKerx6SswxlL+USN8BCAntXknY33cth6BDlQgWEuHHtKYxkZuQ2brfo t2yR6G8Yb0hZTleuQWj8q2sItFQyo+wAOu7ms3sruoZ5IRY5Sh2ZzZy+tJDZeOlgRi7H qbZw== 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=GBws1d3wLh/Be/1RlkKVYFgGAOJT0dKOI+UcsVmGEiQ=; b=pJOQ7//S2jCrl0CekBwVvnSAZ7obwDas5uN6rqOv8Qx4kiNl0okqSqlwlp0nf82HRS bk8GHeILxahMcFR+3hGfeen0bKL4GWM2SWDgqHfABsq/HS4IO18WLVUGyJAGp0h6eVjG WbWjqYcWLKvhhh0Cqfn/HkMGeF+ZXRScF41ayBEN2+J7YPcr3HNJlpOur4O310Pj9uv9 yIgyyUism+TUCQ21i8dNkamsGAnc7C2zmMvix2BwxtqvcJqIxojDx7m/QfOTlt96yIqt 3FGvc97g5UKJpsR/gwhy/6MhpwpwA+ezbAgEepg+24jIc913GUI638N/bCEYsh/IQ+vC BXwA== 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 b37si16190501ioj.180.2018.01.23.14.02.31; Tue, 23 Jan 2018 14:03:16 -0800 (PST) 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 S932213AbeAWWBE convert rfc822-to-8bit (ORCPT + 99 others); Tue, 23 Jan 2018 17:01:04 -0500 Received: from mga11.intel.com ([192.55.52.93]:47838 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932071AbeAWWBC (ORCPT ); Tue, 23 Jan 2018 17:01:02 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 14:01:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,403,1511856000"; d="scan'208";a="168593919" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 23 Jan 2018 14:01:01 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 Jan 2018 14:01:01 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 Jan 2018 14:01:01 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Wed, 24 Jan 2018 06:00:59 +0800 From: "Liang, Kan" To: Peter Zijlstra , Andi Kleen CC: Stephane Eranian , "tglx@linutronix.de" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" Subject: RE: [PATCH V5 4/8] perf/x86/intel/uncore: add new data structures for free running counters Thread-Topic: [PATCH V5 4/8] perf/x86/intel/uncore: add new data structures for free running counters Thread-Index: AQHTjjLMO5E6Fi0JBEaHVwBOA31k86N5HycAgACap6CAAPCdgIAApDaA//+iMICAAI7aIP//eyCAgACGgND//6MogAACbqKAANlSuBA= Date: Tue, 23 Jan 2018 22:00:58 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F07753803C1E@SHSMSX103.ccr.corp.intel.com> References: <1516042629-387021-4-git-send-email-kan.liang@intel.com> <20180118133248.GC2249@hirez.programming.kicks-ass.net> <37D7C6CF3E00A74B8858931C1DB2F07753801FEF@SHSMSX103.ccr.corp.intel.com> <20180119130731.GQ2228@hirez.programming.kicks-ass.net> <37D7C6CF3E00A74B8858931C1DB2F077538025E7@SHSMSX103.ccr.corp.intel.com> <20180119171929.GZ2228@hirez.programming.kicks-ass.net> <37D7C6CF3E00A74B8858931C1DB2F077538026F3@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F07753802712@SHSMSX103.ccr.corp.intel.com> <20180119202417.GK7844@tassilo.jf.intel.com> <20180119213355.GE2269@hirez.programming.kicks-ass.net> In-Reply-To: <20180119213355.GE2269@hirez.programming.kicks-ass.net> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTc0MDFlMjItZWIyMS00Y2QzLWIyY2QtYTIwY2Y0MTlmZGJiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik4xZkdTd3dVNWhjZHhXSHA0bnIyM3lPSmZQV1FpU093Z1wvVlcyZHBnRzI0PSJ9 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 Fri, Jan 19, 2018 at 12:24:17PM -0800, Andi Kleen wrote: > > > Oh, think a bit more. > > > I think we cannot do the same thing as we did for CPU PMU's fixed > counters. > > > > > > The counters here are free running counters. They cannot be start/stop. > > > > Yes free running counter have completely different semantics. They > > need a separate event code. > > The only thing that matters is if they count the same thing or not. > Hi Peter, There is NO event available on the GPs, that is exactly the same as the free-running counters. For example, the BW free-running counters count the requests associated with writes and completions. The most similar events on the GPs are DATA_REQ_{OF,BY}_CPU.* events. Except that some of their sub-events count requests which not completions. There are also other minor differences. So we don't have alternative events for the free-running counters. I think we have to use 0xff. For details, please refer to the uncore PMU guide. https://www.intel.com/content/www/us/en/processors/xeon/scalable/xeon-scalable-uncore-performance-monitoring-manual.html Thanks, Kan > The not start/stop thing is not important. See arch/x86/events/msr.c on how > to deal with that. The short story is that you simply ignore stop and update > the prev_count on start. Then any next update will increment with the > correct delta. > > (if the counter is short you also need to run a timer to deal with wraps).