Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2606692pxb; Tue, 24 Aug 2021 03:20:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQMF06mV8LVwEULbnexJCbUTxXRjdjAc1wNqri0ZqiDbOaRRDOk8ookKfSw0x7ROpI9vAI X-Received: by 2002:aa7:c9d8:: with SMTP id i24mr42515947edt.79.1629800442030; Tue, 24 Aug 2021 03:20:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629800442; cv=pass; d=google.com; s=arc-20160816; b=HQW7J/ZM2TZ5IX0L/Gv6znGyKKa6/gZ3npmFZ5OIeKgPPMTciMy0banhazJzEN0g6c s6rchh0CveQJHwMddmhEhAC1Gk1GjyfQSwt9K4FZNWf4CmbcAi8stlY44DMB7395OYd9 2l5obJNVBTk06qOP0CGKyjuV6xUZVHR8Mhl+/WsDihKvF3XqR0JwxzZ4+z5g9iektDEb H4JWcBs4zxLSj/b1LOuFRE3bk7ABhbxJiTuBBHGgsVIKtFrs0UCezNSla0yMwrC3qLdv pWPoM2OD1T1Cr5q0epbbbAxoBlFjJpzVHSoxc2t/y/Dk2NjpoxNLv9prGmrp3pFXH9T1 Cv7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=E6i0UZ6+gvahniZGUQ2d1Vbpc3VDd9JplBy58EPr65w=; b=rFh7t0OVBwikmO4F6FPR9ZuvDlHRt4bHnIG2KX66awNNlySw8O4/dWjBTQzhNXj+ae 8KPigRCYgA127CsScTsy3FTNJwBh/37N2tk/ZLVphjR7BeCNUsdORmbWceToKdd/6w87 9v0UAo15A7LIUO/hTshtmaR7A3mHPheeBAFSlwu24qsru08kRjR0VE7ol0WxPz8Nr7y0 LOfbTroKun/8NvJDx9kI4Purv4Osk/sidiHgWv5D+nvU463hK6XgdBl4P7/CCynb+HOx eSIiuEhc01LPqNjkEPHL8UHl9h0bAAoX2EaagkoMM7wEuHOU+F8RQGhBOlaiHf+3j8og V2Iw== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@fujitsu.com header.s=fj1 header.b=ea687Lni; dkim=pass header.i=@fujitsu.onmicrosoft.com header.s=selector2-fujitsu-onmicrosoft-com header.b=MRZctDOF; arc=pass (i=1 spf=pass spfdomain=fujitsu.com dkim=pass dkdomain=fujitsu.com dmarc=pass fromdomain=fujitsu.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si964301ejl.296.2021.08.24.03.20.18; Tue, 24 Aug 2021 03:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@fujitsu.com header.s=fj1 header.b=ea687Lni; dkim=pass header.i=@fujitsu.onmicrosoft.com header.s=selector2-fujitsu-onmicrosoft-com header.b=MRZctDOF; arc=pass (i=1 spf=pass spfdomain=fujitsu.com dkim=pass dkdomain=fujitsu.com dmarc=pass fromdomain=fujitsu.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236059AbhHXKTf (ORCPT + 99 others); Tue, 24 Aug 2021 06:19:35 -0400 Received: from esa10.fujitsucc.c3s2.iphmx.com ([68.232.159.247]:63752 "EHLO esa10.fujitsucc.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236023AbhHXKTd (ORCPT ); Tue, 24 Aug 2021 06:19:33 -0400 X-Greylist: delayed 434 seconds by postgrey-1.27 at vger.kernel.org; Tue, 24 Aug 2021 06:19:32 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1629800329; x=1661336329; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=E6i0UZ6+gvahniZGUQ2d1Vbpc3VDd9JplBy58EPr65w=; b=ea687LnibRnERHcaFi+8ClpLdQr7PlP0uFY3XL7NsdQsU7jJ0JDL8nLK NKF0oqeNMcN++Fm/NibbtBEIMS4wCkQCcCbixh/1p07p5a9aXQM0MaaT3 +CrZ+2y+75gNlTdnV9D44qcSoMRfDZj1W3g1+jH9WwzOhoeZdVkx9M3CP D7HyTQjB9hLOTf2AurH4AjOA3UvSDDpM0u4UBc0JtR+7w6iGjkYJYmbPh anoF4CUcWE4tE1eIyOx25Qu4b9v8XlUm70tCOi+mB3tsd2SnrlsvpYWVT ZTc9Fq3qEzXsa1gvArZCMUhFbCcF+sNjf8+1sgt0IuLwMzroJ9HbyONcO w==; X-IronPort-AV: E=McAfee;i="6200,9189,10085"; a="37629787" X-IronPort-AV: E=Sophos;i="5.84,346,1620658800"; d="scan'208";a="37629787" Received: from mail-ty1jpn01lp2058.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([104.47.93.58]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2021 19:11:31 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UzVQkVm4/ylbK9FNq0nn+fsT4JHuhUCGl9evC9IAq6oE8kFZhKUeLV17N+L2xYxRD7g8uClCak7ryYo/dZ1eZcWpNsNnnuEnMYN4kNiHTy3MW1PPqkv0FOWa1k43OmUKOGv1Hxmcccf+/X1c4j6K0ZKkSWRJOfk2LLwDTFB5r9l09rP+41uLHkwfhfiVW2BA389yATaDR+x4iMaE7togBP18RMiCJwmRobCwFrPCM0bvkOWUZDXBkfO1oCdtGZkS/Qpnvo5RuwPClT5hhdkNMCGpslpsuZJR6YY81RVBH/ohdzrDfL0NCLIpdCdgkk5ZkDzB8HLda4ZlL1Vqeld6Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E6i0UZ6+gvahniZGUQ2d1Vbpc3VDd9JplBy58EPr65w=; b=A1WGNw2I5ZsLI3lTVlo5uXKUgrsZhTl/UI6jFfDC419J2BZlQTqIr04DyR5nh5OFD39ZDfs9w4x/5/GEsvrWd+saDyfjVme9iWeYhLOmMUDHvwdCVh7MMk4VAzlBr3k1OWuTa45QRCfjyZQqwakNUvQg7HTREdaHHk6vKG8R59VnOshRM5HzpO71o8ZbDEjt3AtXeD5rSk92kFU3Wr8X3wF/jbDEwlwpLvnuHHwZ4dcMwHbGefsT+oNGfJnEngho2Mudu2SadMLLHYUdj0kdtdZQBv3ZdXeB4Bc4rzHzgPtYN5Sr3+RDd0xTBTp3hb1HfHYylQQBgyvNi8fuuLCDrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fujitsu.com; dmarc=pass action=none header.from=fujitsu.com; dkim=pass header.d=fujitsu.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.onmicrosoft.com; s=selector2-fujitsu-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E6i0UZ6+gvahniZGUQ2d1Vbpc3VDd9JplBy58EPr65w=; b=MRZctDOF14h9PFV3WL+rDaE3PYzR4nQIP26uKUAQWPgW5lcOIBqoj2bLaRlQa8IsUHDatKr60Jx0Z1CDnqZ2emczIDMZuywpWxSaccu6opwLSM5WtVQrEsnrxfQcv/uxQTgGWOuVw7barCG7pF9WrVl5VUApqL3/EIP1/1qr+Vk= Received: from OSBPR01MB4600.jpnprd01.prod.outlook.com (2603:1096:604:7e::12) by OSAPR01MB2737.jpnprd01.prod.outlook.com (2603:1096:603:38::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 10:11:28 +0000 Received: from OSBPR01MB4600.jpnprd01.prod.outlook.com ([fe80::44e1:366f:8654:b23e]) by OSBPR01MB4600.jpnprd01.prod.outlook.com ([fe80::44e1:366f:8654:b23e%7]) with mapi id 15.20.4436.024; Tue, 24 Aug 2021 10:11:28 +0000 From: "nakamura.shun@fujitsu.com" To: Rob Herring CC: "peterz@infradead.org" , "mingo@redhat.com" , "acme@kernel.org" , "mark.rutland@arm.com" , "alexander.shishkin@linux.intel.com" , "jolsa@redhat.com" , "namhyung@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" Subject: Re: [PATCH 1/3] libperf: Add processing to scale the counters obtained during the read() system call when multiplexing Thread-Topic: [PATCH 1/3] libperf: Add processing to scale the counters obtained during the read() system call when multiplexing Thread-Index: AQHXmFsxBFGvQYUD8Uu1pPLYL2hYdauCbgJw Date: Tue, 24 Aug 2021 10:11:28 +0000 Message-ID: References: <20210820093908.734503-1-nakamura.shun@fujitsu.com> <20210820093908.734503-2-nakamura.shun@fujitsu.com> In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_Enabled=True;MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_SiteId=a19f121d-81e1-4858-a9d8-736e267fd4c7;MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_SetDate=2021-08-24T10:11:27.838Z;MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_Name=FUJITSU-RESTRICTED;MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_ContentBits=0;MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_Method=Standard; authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=fujitsu.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: db581252-1958-4e87-edda-08d966e789ae x-ms-traffictypediagnostic: OSAPR01MB2737: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ymTtgcsk3ndtZ9Vs5gRBg8m7+qADECxf/kq6wmxRv8QKDsBYGkIacYat0m2Q+6FCPnyc+JpSUqmTiUneU6rOZp5hPG7i2dvlwru3Pd4Vkd17b6pQv6dc+sCvFPO2/4S+fRnMKxLq6xf4I4uMU2nzyaRh1H4rLZB1iDg97TIaK6J3lP2zfZ5LiHPnaNrqnlDmS7x4lGPdZlSnLi6g7XtSpavSzdcF22R2BOqwjdKi0AI9qHBTgMJqA5gwtxZEi6nzOssy8AuIwvGXMAQBEiP3VMw82c3FrKyxPcKT+WdzF4q/0Mh0KdGBAoOKvMojh9cTPm9fYyCuTEyHAQvOamqZdduxg8WfmxNeEhxMqL3tVHo2MZfQS8Rp5lUDCO1JcPZDXFomd5RI6W+rYEMVm0DjknHYrNr/8ANyrRwgbx8Vto+UPL7YK1rWt4rXzi+3e0oCtUHi1wTex9P36qhUn6XzVNb3zLS68GqsN1cUHtl4+gVGTP800VJK3L5uwT59nG0XXxHVYFqbLs76whTsqHmlmtnNiu/afevcTgCLqCtc/tXWkcim61oiyAtT/fhSmkXOOeSaoG2kwG7D6f/RuMjKRs05j7f1nLmrmwX1+BitmlZjqTzLN2IOHZIeFeUKwLhRcOmU1nR53uihm/uAuIrRzHkoYc6Hj0YyfX7tMKA2JrG2baYpcdarT/+gtnHINLdy6dK5rdV0wvEg9pthqzSZkw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OSBPR01MB4600.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(346002)(396003)(376002)(136003)(366004)(54906003)(7696005)(4326008)(55016002)(8936002)(5660300002)(316002)(9686003)(85182001)(478600001)(52536014)(71200400001)(86362001)(64756008)(66476007)(66446008)(38100700002)(66556008)(6506007)(8676002)(76116006)(66946007)(26005)(186003)(122000001)(2906002)(7416002)(33656002)(38070700005)(6916009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?dHJXTkVpTk5YbER6eS8vK0RMZ0JxQmZtWWpkZjFUVWZpbUZjY2FlWG82?= =?iso-2022-jp?B?cjgyQWdubWVhMWNnZDFTYWY3K05xUzlCZjFyakNXajlVRElPRkR2YVZ6?= =?iso-2022-jp?B?YmxuMWxpYi81T2lUZHlwQzU4NUg4SnVobXZWdUpsd1R2TlFEZ092R0RI?= =?iso-2022-jp?B?emRrWGNNVlNMVWpRTTJ5TUxWNjJjWjZib1YwaXB4WTVjeTdRQkRDZDkx?= =?iso-2022-jp?B?MGNGc2NTS2Y0N1N1eS9RMDViTjRPdzZ5dEpxeHN0bjFWUC9YRmQxaDRP?= =?iso-2022-jp?B?MWZCTjJNL0dvd1ZaRW9wL2NSSDdlZXgxSDlCbFY3a2U1azNIb29VUlQr?= =?iso-2022-jp?B?NEpOQWxrVndMVloxN1JNNFVZci9KaUJmR0NQbkk2VXNHcDR0eUIvdDdR?= =?iso-2022-jp?B?RDQyRVdiZUNOSjZKV1hjcUxEcE5xRFBTYTc0MjUzM0QzdTZwWWRGVVhX?= =?iso-2022-jp?B?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5rTzhWc2hY?= =?iso-2022-jp?B?Z2pTdlZ0TU8xcWU1Q1g0aUwyWEZVUDdvbFVFOG9nUkhXd2MyelZ3S0ph?= =?iso-2022-jp?B?MXFmSTJVWTlQbDhkRjZjRVR1MjE3SHpDL3p2SDl6MDBick5NTk1LWWl2?= =?iso-2022-jp?B?WWg4dHhGa29MOCsyQk5OajF4bHZhUGFKQkNNM2EwMjczM0VFalZDa2cz?= =?iso-2022-jp?B?N1NYdXFwaUhhSFZRUlY3MjhMNkJuZGlRMWdyRXEzSndVMldVakRVOUc3?= =?iso-2022-jp?B?aWtrRFhqc0dqcFU3cU43T1RLYkVpYmt1cFNpTkhZWHZhVEphN2gycUk3?= =?iso-2022-jp?B?dDhZU2NzRmNGVFJBTlRVMjNkbHMrU2F2U24wVmowS0dYSHAwd0prV2Zo?= =?iso-2022-jp?B?ZE16YStwejlodXFlVWZ6ZU1BTnhQaUpJZzhyaDlWa0l1UGRYdHhZbTVQ?= =?iso-2022-jp?B?QkErSXNiZDMyNnpHZWZ2M0kydFJsNWczTTVoRUU0eDNOM0dQdlVBcjJh?= =?iso-2022-jp?B?UjEzQmZRSmVDOTBKUldQRFJnTnBBPQ==?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: fujitsu.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OSBPR01MB4600.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: db581252-1958-4e87-edda-08d966e789ae X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Aug 2021 10:11:28.2217 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a19f121d-81e1-4858-a9d8-736e267fd4c7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jCeGUNBr5ckdI3V2zyWwxN5hqvVjXQjidEomeu8gWzmX7MG4xBn6Fnh++7+cpkHQwMIOUwqJG/X4gku1CKoOz+vuMNDn6Om70iVgY+qVrAE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSAPR01MB2737 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Rob=0A= =0A= > On Fri, Aug 20, 2021 at 06:39:06PM +0900, Shunsuke Nakamura wrote:=0A= > > perf_evsel__read() scales counters obtained by RDPMC during multiplexin= g, but=0A= > > does not scale counters obtained by read() system call.=0A= > > =0A= > > Add processing to perf_evsel__read() to scale the counters obtained dur= ing the=0A= > > read() system call when multiplexing.=0A= > =0A= > Which one is right though? Changing what read() returns could break =0A= > users, right? Or are you implying that the RDPMC path is correct and =0A= > read() was not. More likely the former case since I wrote the latter.=0A= =0A= perf_evsel__read() returns both the count obtained by RDPMC and the count o= btained=0A= by the read() system call when multiplexed with RDPMC enabled.=0A= =0A= That is, there is a mix of scaled and unscaled values.=0A= =0A= As Rob says, when this patch is applied, rescaling the count obtained from= =0A= perf_evsel__read() during multiplexing will break the count.=0A= =0A= I think the easiest solution is to change the value you get from RDPMC to n= ot scale =0A= and let the user scale it, but I thought it would be a little inconvenient.= =0A= =0A= Best Regards=0A= Shunsuke=