Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2355676rdh; Tue, 26 Sep 2023 23:11:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8ni+1JgrwExlz8X7yYW1GhPOgq04nzjdrQe6iC0ItbbGWzh7gyUywnZrzNSnKTAXy5vlU X-Received: by 2002:a17:90b:3d0:b0:262:d6cb:3567 with SMTP id go16-20020a17090b03d000b00262d6cb3567mr956566pjb.26.1695795092477; Tue, 26 Sep 2023 23:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695795092; cv=none; d=google.com; s=arc-20160816; b=gipUICtLBiW6MStLnseK+svDZREyfEVK7e1jllL6j2wXFY0mEmyjGguvk26Dn1HmOt czhKUrrRTtO9RIraV+o9VlDkvfKFObTsgbL8RuJhwN4XPIvRt9nmttmHbdcH05K9w/NB GrazIhISa2DdJ020+Iqk6bv6aCaYqyFaXRK0nCTPxXVX7fdLJhyIWFMGCV56yXyFQjTr GHASWQOPRlysssPb4vzxNC5m1NsZeOKnoDnBrgafLPaYPWcVLR4rjnJSXHPb1rx0bH69 TW792KOLvmGLDQuTFfboX/5B+crraKlQwFGmS9rNU0yyaUl5dmr2nb3Lm7gIzgRx2kWl XzGA== 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 :dkim-signature; bh=O0nMoCs35unZfclTu3DKp3uZsoT22xTXBwaLiGdkdWQ=; fh=lQjk6wFDvgdIZTtG/oF3wV3xrMSFjh6K3js3H208Ax0=; b=LxEyPVJK2creyehZY5CoubJ9efvamHM0n3oU96jcebKiEc6BV/3WrzAKsFN7ouz643 nglvLZ+Oz9CiU+qhMV7QsSUamkDb2euwYAXa10vLb0iFWS21ybvV3Alz23+m/23YlHuo qVWYtG/ZOMuxb2z3SoeEBaKEkwASG3CkPZrL8k7ZEFmGS4uY7454ls980jPhpxtGbN5V dzT1v8kmNROgl6JH6GlBY6yCA1aenxYVaOb5rvw5nQ9l7ZleqSnXl03A9rsf/VK930il XP6Sn783JxfyNGG2Vomx/Ec0cys38Q2xSXf43VGJWINMjf1BkwgLL3aVEVTJAEA3D7lk 9/jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GmrGZwQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id om6-20020a17090b3a8600b002745c4e215fsi1709956pjb.175.2023.09.26.23.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:11:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GmrGZwQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5B1AA8075DFF; Tue, 26 Sep 2023 21:46:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229831AbjI0EqP (ORCPT + 99 others); Wed, 27 Sep 2023 00:46:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbjI0EpR (ORCPT ); Wed, 27 Sep 2023 00:45:17 -0400 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 350E21BB84 for ; Tue, 26 Sep 2023 21:07:09 -0700 (PDT) Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-41958410e5cso227951cf.0 for ; Tue, 26 Sep 2023 21:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695787628; x=1696392428; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=O0nMoCs35unZfclTu3DKp3uZsoT22xTXBwaLiGdkdWQ=; b=GmrGZwQOhEVqm+OG9/SbQUKxe/HC3FGo0BMMHGQDUJUicFFi6E7LLg49haja2g7jR0 GH7AIzWgxZgaKiCgEqcbMpiIuteR2fXKdx5V7a6vl7u5V7wRkBoD81BQhUdAI1SBSHFW E9BvHRjDotaAohAfYpaDEj0a1BAdFP3qNyy8msx5pdwMBUw0t+zy/NiRCh0NQCXFVuND Ff4R6Eee2C3F+EGpBjkSBgLYHFeoKrT0pXeLO8eVUFrZ2JsblxTpiF0jvBSG1LLw3RWN ldmY3324yh5Zfbn+h6AU39p3QYDWBn1VmVY5ByHmmZ8sHWcdE/6DR2fkCnGjRh1Dip3C bHyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695787628; x=1696392428; 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=O0nMoCs35unZfclTu3DKp3uZsoT22xTXBwaLiGdkdWQ=; b=f1JsYBhcUqn2dz1qWDQxVlLEauXMc+xu9gtoWx3ZFBAMOm2pU4plnWb2KM9EgiSbFJ Q2jH76V9pyFKTobUhOHYMJ/cVlj2Mr+mzHBbWxwZXkIk8E/FZV3E5mopPsELN8KPsxGp axheFZywy6cRc0xjfyczO9ZDYEQKNszNY2bVwKNvpue9oI0S86V7/JuhoefTWr3nv3Tn 3YVOyQtb3ixsaN6zvK3q0wCg3fqWUkFe7kddP3WqPEwUgGiHLdQuMD68Orc+gSmNx5IY 4Hm9UCsvosY05Ke98OVAyzkUeSQ5LrhrffUyONxnJQPyYP21AyolQb+uuENOAUGGSBpE b8nw== X-Gm-Message-State: AOJu0YzoYsHe0FAUMKAlS7C4G5t9MbCy0MPlN9TSRc8B0UdGSzupbz/s QGShJUF/uCFBjyZX6nleOAXblgNw6OW2LdnuIJvRGw== X-Received: by 2002:a05:622a:188c:b0:410:9855:acd with SMTP id v12-20020a05622a188c00b0041098550acdmr483377qtc.14.1695787627958; Tue, 26 Sep 2023 21:07:07 -0700 (PDT) MIME-Version: 1.0 References: <20230920122349.418673-1-wyes.karny@amd.com> In-Reply-To: From: Ian Rogers Date: Tue, 26 Sep 2023 21:06:56 -0700 Message-ID: Subject: Re: [PATCH] perf pmu: Fix perf stat output with correct scale and unit To: Namhyung Kim 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: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Tue, 26 Sep 2023 21:46:21 -0700 (PDT) On Tue, Sep 26, 2023 at 3:51=E2=80=AFPM Namhyung Kim = wrote: > > On Wed, Sep 20, 2023 at 9:02=E2=80=AFAM Ian Rogers w= rote: > > > > On Wed, Sep 20, 2023 at 5:24=E2=80=AFAM Wyes Karny = wrote: > > > > > > The perf_pmu__parse_* functions for the sysfs files of pmu event=E2= =80=99s > > > 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 resulte= d > > > in perf stat reporting values with wrong scaling and missing units. T= his > > > 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 file= s 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. Ian