Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2677131rwo; Sun, 23 Jul 2023 22:17:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/B7j+LAFQuvGMYkxlQRnw6VkxfUW0/3dPDHMIZGdyqNZrwOyrFdAXBykZNa2RmOI3u39+ X-Received: by 2002:a17:903:24f:b0:1b3:d4ae:7e21 with SMTP id j15-20020a170903024f00b001b3d4ae7e21mr8980621plh.63.1690175833493; Sun, 23 Jul 2023 22:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690175833; cv=none; d=google.com; s=arc-20160816; b=acwhAsw+HvJWJd41WiSoNQTdwutLKk5s4ejrWoqSQpSQ8Jfbe6A4o2PQOyb/Z4LTDA R4LHugjy2VpNBATAV6woP+2HVqcHPSG3PvfXpsJWg1CPY31jKGVNQNi5NLtt0FqRbd0D 3h85FcSEJL867wNmIO2RAURbPcpN/jLS67m41Jkuw8xjsXZ++RKihZOmvObMHFefnXp1 Jxy7xs48ndnO0SmFCaAIyb4/8tlr+KO0/gnIsfXhS2lhny18a09Zq9HgYmPnt0V7tasd GpTnzl2V7I6YX8cAkGqTHrR5amH3dOi4f98Iv4BMhpFXQ9JYGnKpv54R9aIxf/9DFCFr 0IRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=fElKCgiXJzYbjvpmv27EWVfF1XrgtXviBe37k+MTnA8=; fh=lSwsUJvoUo60pAgCTu/Sn3K6lqRA5N7EjXmx3WkDG7s=; b=q7LfWS3AMqbacilhEZ/c4+eU4UKWJ4+uG4vXiTYRG99+N4VUoamPstGJuEEs8NZMco dX0prOLfwl6VNptPdFZYWYJ3NEZucT3sOWWyy04ihw235h2U4N7CeeFEVleBpquxqOZn cXnq4GFZx6oRbzaye8i7OGZAo3TwDR76U0otdZaenrEB8RO0oGmaBEmF87l46O3Bs/5r v3WYk8epo7695pHdYz7ydzXTGk5v6lW82bRGwJw9jycMy4Fp1uLFaqdaEqeL8sU1P/uP GmtezrjVAJGSUynnqHfPGdqRWF+WVL/OAekl4I5BVNkq9WqwTeSbkLP7+0cwKGlmvtuC /cPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a170902e84500b001b9c7300823si9039498plg.221.2023.07.23.22.17.00; Sun, 23 Jul 2023 22:17:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbjGXFHF (ORCPT + 99 others); Mon, 24 Jul 2023 01:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjGXFHE (ORCPT ); Mon, 24 Jul 2023 01:07:04 -0400 Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B5CBE40; Sun, 23 Jul 2023 22:07:02 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R371e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=yuhaixin.yhx@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0Vo0jtO7_1690175215; Received: from B-Q60VQ05P-2326.local(mailfrom:yuhaixin.yhx@linux.alibaba.com fp:SMTPD_---0Vo0jtO7_1690175215) by smtp.aliyun-inc.com; Mon, 24 Jul 2023 13:06:58 +0800 Date: Mon, 24 Jul 2023 13:06:54 +0800 From: Haixin Yu To: John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf arm64: Fix read PMU cpu slots Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit f8ad6018ce3c ("perf pmu: Remove duplication around EVENT_SOURCE_DEVICE_PATH") uses sysfs__read_ull to read a full sysfs path, which will never success. Fix it by read file directly. Signed-off-by: Haixin Yu --- tools/perf/arch/arm64/util/pmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/arch/arm64/util/pmu.c b/tools/perf/arch/arm64/util/pmu.c index 561de0cb6b95..512a8f13c4de 100644 --- a/tools/perf/arch/arm64/util/pmu.c +++ b/tools/perf/arch/arm64/util/pmu.c @@ -54,10 +54,11 @@ double perf_pmu__cpu_slots_per_cycle(void) perf_pmu__pathname_scnprintf(path, sizeof(path), pmu->name, "caps/slots"); /* - * The value of slots is not greater than 32 bits, but sysfs__read_int - * can't read value with 0x prefix, so use sysfs__read_ull instead. + * The value of slots is not greater than 32 bits, but + * filename__read_int can't read value with 0x prefix, + * so use filename__read_ull instead. */ - sysfs__read_ull(path, &slots); + filename__read_ull(path, &slots); } return slots ? (double)slots : NAN; -- 2.34.1