Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2210623rdh; Tue, 26 Sep 2023 16:41:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF78htO6XQ5o18+rJFrRG6B1DfPuR/OWTDCy2TuI/Gzp+WzoZRsKjUGK7+Uej4CuSuMmnq2 X-Received: by 2002:a05:6358:98a2:b0:13a:6748:9312 with SMTP id q34-20020a05635898a200b0013a67489312mr559680rwa.19.1695771677696; Tue, 26 Sep 2023 16:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695771677; cv=none; d=google.com; s=arc-20160816; b=F71gToYaIRe9mqbecUMLpWSf+4mwXNu8gyjYdXk2x571CfUtUx6s8j+9jkjlBkyCCm Yg8/wPGNrBYF+W4XYXII+nei+XsjZw/uGHxXfxsaUNts5Y4blV+8RJ4sxf8XpmOYPFN/ 5puBuakgDUTc972q1ZvVr87dGFvi7GvIfzQxm/PcB+Dzioz7Vd3QilhzV4fhvl7HNCpO L+NQNr8/6r8IIAinthz98Irzxd7XcoxL9/2Ul4EVl/eFbWd1hXdRtTvIABydO1qxa5Kp nbtoZZPhpwpkWkpBYZq0+4tpx6paRnYaEXfw51tAKfS+/YnUHzTnbmxBeKZVlRp8NZ1w YkCQ== 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=0ExKF5wG2Mm6ewCSSa0VRT5kTxp/84EY9tMPnstpf40=; fh=1/QGFprUb3XUK4v8nfswIoL4c98++W+yTzTXsohz+3c=; b=FVsV3zVUvDOgCOGhlR/bmW5zN220liepfcDViNH6xVQIbpooJb4l+EyQLs12g6IVnu 3IDY/omclFmCrmzgyQ5lFwtkQTOfmV1WqRrQ3AN0YbXNY7N24nPAw7NV3JW97Vk3YHEt BR2srcGFz8MAcqV7u9gzznjJUMPU35oPtiUwqReHYjXz0J4CP+ctTlvpjx70TMOhfuFZ wkYwJ3f+heCO8EzK8XwjvoFgrzHKO+tB4KhU0zz28WamHi+tKGJDCbd5Bin8V6pkcQK0 kufG72ctCXxLFQMX4GgN0GSKbZA+elONnfswZB1rCewNfOPb8zMsQRyEfGHQoz2NhuRg pVrw== 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:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m6-20020a633f06000000b00584a9290bd5si3181803pga.442.2023.09.26.16.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 16:41:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id D6C188260F69; Tue, 26 Sep 2023 16:40:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbjIZXkE convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Sep 2023 19:40:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232239AbjIZXiD (ORCPT ); Tue, 26 Sep 2023 19:38:03 -0400 Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A3130F4; Tue, 26 Sep 2023 15:51:01 -0700 (PDT) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-79f909071c3so338416739f.0; Tue, 26 Sep 2023 15:51:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695768661; x=1696373461; 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=QMSNODbnTzc8NG4Obsca/eh0AcJKSmcVBO5ZoBkDCVs=; b=vxkNqdG4zjfFAwoujHV/uzzu3fx2PHx4fFYcl9Ui1KYmw4mQZn1QcW8dKRrgOUiTm/ a4Dvn3nYnuCzDpB8CgPsd5WW5HsOGl844QEC6vxGvWU6llYoYo7jHBtgsVkGZze7oi/0 ly1nxR34n6T+/8M1rKQKUKnLWnfVTgtac5VU8qIdDDZzv+uR+dq49l2PS0H7QAEYXHEA v4DzlJdW4IVu0TRCfw2YuQQoNm7yt6/jEpObEQ4wLN+Bmx6Hcp9SJS2zMDXYqTDA5kR7 g3LK4603p/gjDIGa91SoNf56r6Yg3K/EWnJ+vZsJWRC7qp2dEy9TvdaoxE0oboSuKlUC irJA== X-Gm-Message-State: AOJu0Yzog/4epxMhQbDjVTPEvlty+uIAWCnMNARz/GVZzJxGOTBK4Adf bsX9ibf9h78o4qBdX4DCtV16D4VQ1YBXjhXEL54= X-Received: by 2002:a6b:d002:0:b0:792:9ace:f7ba with SMTP id x2-20020a6bd002000000b007929acef7bamr172374ioa.11.1695768660792; Tue, 26 Sep 2023 15:51:00 -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 15:50:49 -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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 26 Sep 2023 16:40:13 -0700 (PDT) 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!