Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2347447rdh; Tue, 26 Sep 2023 22:53:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGp6G0vPaecAaUjPIBK7dinNftCUIJtrESI/JXcHBdf4MvuFd4GtToCkwQJfT1/D9uDy2R X-Received: by 2002:a05:6a20:4411:b0:14c:d494:77c5 with SMTP id ce17-20020a056a20441100b0014cd49477c5mr1510190pzb.13.1695794023110; Tue, 26 Sep 2023 22:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695794023; cv=none; d=google.com; s=arc-20160816; b=XKaEdjWWi4Emm3fjJeZex+z8gmiZifQ1a70uwz4WkEyfc0GEecglkGPthqs6T0k919 mff6K9wxXdU1L2jj3FBcgEd9XVITvs2Ri6ag+4ENmjbRK7Dji2n3jsE0DJ8xVWBLNlAA aqWvxh073joaV0SCmlVvCrSdtbj1hCrEPdxqcpocHzKmQlS5rW+WcJ9U1bQ0WN37ua59 4fZkCafY7iK2orwiTn0rQFhTKNeP0XVKAU4UNmOiTKklv1MLUKUxxvwbDRbysQtZhwkn 3EibOn8157VdOf45Dwc1MSfIWpBj06hedNTF9bHHrz5olGjtMVOuPCR1mowyeP46e7nq bYtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=JdSCO3TDhI6LFYZAcS2AaJv+N48YaeE5OJoMpuDhHrA=; fh=1/QGFprUb3XUK4v8nfswIoL4c98++W+yTzTXsohz+3c=; b=R2kvVsn4lC1wJZps4Q7KgosPKseoZ33Bwy7IcajhaErJkirRwv4EsDWXx6+uk38pMQ 8hs3atK7Tb457Dc/kVRrTPuJ1XMIWv7paa8TJNHPlEc5uT5YC+k+YzBnDPBaJlafzFYc zTyNP2Rt90ww/E9hWtm9dbknB1mowQ1Bie4wsyyiDE79epWS+ua3PmViiqdRMll8ewA1 bPecCtSCH3Wp/YLU2oabJSXAcOafDeQO+lKmYjksRwNCX9jf2CMrtrOR/jOy1AT8uQmK gRHfcb71rMKEmE6IoXWnv3isMbE6buK8nV8c6LWGS+jKmp3D/L9KbukDCHEmIV5vTlL0 D33A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n9-20020a17090a928900b002749971d84dsi16322408pjo.15.2023.09.26.22.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 22:53:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4DD1480CE7C9; Tue, 26 Sep 2023 22:41:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjI0FlF convert rfc822-to-8bit (ORCPT + 99 others); Wed, 27 Sep 2023 01:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbjI0Fk0 (ORCPT ); Wed, 27 Sep 2023 01:40:26 -0400 Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2433C1FFC; Tue, 26 Sep 2023 21:39:24 -0700 (PDT) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-79fa891b645so283373939f.0; Tue, 26 Sep 2023 21:39:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695789563; x=1696394363; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=45TovMKJ+2sZ/qf9Tf9B5Lm13NVNzRdDeG0tap29jvY=; b=b1kPI8ib0kqNQUNsS+v/08wbeeuQsdzrscg9u0QdL0SWNyheTzlAEfqeJh3pXcXW6S w67oOio8RwzkyuqLRIgKGfnRNGg5L00FKEfu2hI8Mczi22hzJIorCTMa2UWc2969bd7s 0xujBc0vLRTx2a3nBmMiN/+K6Ch/VpbIO2xyxByEJE9XC9T2HC9/xMmgadHwwid8x07v 0XSUOS17oF5v9Qcptkqm5Lt9mtTk/cPlexBo502vf8u4W+2O6BoM5ibh6Q+Vxd7I8c+S c7vB+q6dv6Fg+pWxyGRs79bbbU3U5u+P/+XSnaJyAMKDpTPSm+0PZXcQrYZWPFQEi1f7 OV6Q== X-Gm-Message-State: AOJu0Yxn9nvbrLp8Cz64IlRqJf9R0UBjrHV5H+64++d4l52f5KAOty/P Q+Xs3M3nOOzAmKxpW1r8DpwSMCw8wmmvLx83LLu7eScP X-Received: by 2002:a05:6602:39a:b0:791:1b1c:b758 with SMTP id f26-20020a056602039a00b007911b1cb758mr1142220iov.19.1695789563357; Tue, 26 Sep 2023 21:39:23 -0700 (PDT) MIME-Version: 1.0 References: <20230920122349.418673-1-wyes.karny@amd.com> In-Reply-To: From: Namhyung Kim Date: Tue, 26 Sep 2023 21:39:11 -0700 Message-ID: Subject: Re: [PATCH] perf pmu: Fix perf stat output with correct scale and unit To: Ian Rogers Cc: Wyes Karny , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, adrian.hunter@intel.com, kan.liang@linux.intel.com, james.clark@arm.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, sandipan.das@amd.com, ravi.bangoria@amd.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 22:41:10 -0700 (PDT) Hi Ian, On Tue, Sep 26, 2023 at 9:07 PM Ian Rogers wrote: > > On Tue, Sep 26, 2023 at 3:51 PM Namhyung Kim wrote: > > > > On Wed, Sep 20, 2023 at 9:02 AM Ian Rogers wrote: > > > > > > On Wed, Sep 20, 2023 at 5:24 AM Wyes Karny wrote: > > > > > > > > The perf_pmu__parse_* functions for the sysfs files of pmu event’s > > > > scale, unit, per-pkg and snapshot were updated in commit 7b723dbb96e8 > > > > ("perf pmu: Be lazy about loading event info files from sysfs"). > > > > However, the paths for these sysfs files were incorrect. This resulted > > > > in perf stat reporting values with wrong scaling and missing units. This > > > > is fixed by correcting the paths for these sysfs files. > > > > > > > > Before this fix: > > > > > > > > $sudo perf stat -e power/energy-pkg/ -- sleep 2 > > > > > > > > Performance counter stats for 'system wide': > > > > > > > > 351,217,188,864 power/energy-pkg/ > > > > > > > > 2.004127961 seconds time elapsed > > > > > > > > After this fix: > > > > > > > > $sudo perf stat -e power/energy-pkg/ -- sleep 2 > > > > > > > > Performance counter stats for 'system wide': > > > > > > > > 80.58 Joules power/energy-pkg/ > > > > > > > > 2.004009749 seconds time elapsed > > > > > > > > Fixes: 7b723dbb96e8 ("perf pmu: Be lazy about loading event info files from sysfs") > > > > Signed-off-by: Wyes Karny > > > > > > Reviewed-by: Ian Rogers > > > > Applied to perf-tools-next, thanks! > > Thanks Namhyung, I think this should be a candidate for perf-tools so > that 6.6 doesn't regress for sysfs events. I see, I overlooked that it's for the current cycle. I'll move it to perf-tools. Thanks, Namhyung