Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4705439rdb; Tue, 12 Dec 2023 07:13:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAKILCqBniwnX4fenNd3LrnW83QzVPLhCZgaJOPKH6/TpXirJ/RULNIo338v/gl4bU9uBr X-Received: by 2002:a05:6a20:3c8d:b0:18c:19ab:d2e5 with SMTP id b13-20020a056a203c8d00b0018c19abd2e5mr3484935pzj.33.1702394011767; Tue, 12 Dec 2023 07:13:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702394011; cv=none; d=google.com; s=arc-20160816; b=bYE3S62uj10DZRIodIdxKP9VX2+7Ua2qk8dg+nGUaUrX3ogI0dcX1P+GOM2qpk2+se B6hrdbJp8x/jfQDMXryJvffQ7IQZA+pD/xnUWcqGdP5A/bkQHiPJUoDdaJEN/lEe9o60 u5ZdRx64JvHSojpUNACcixT+dkl7cS46zwNT95pZlul4dqvVHF6l8x2Blgf0JBlZZnb0 Vx70o0WIDdBrm2OAlLavjpZuobWU5lGOBdO5YIkr0z16kIZuMOJ96GZ1KzhKLUQcGE+F Hse3iG40yvJpbCY7vAm9P88H59EEcr0l6Hjyx9hxEdcp6n5pkQy2pkaJx/BnjTkCNEZj fuhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=uKp2AMAZQ0hX4SiBgStKCxFBU5vYWTpsGt1B6xk0uiY=; fh=5EP3x1uDWWBI9dywppNETb2J5CyUqdqYJErdwPGhe68=; b=U3QNYQdviEuWbZpLQ0BaxvG8EYInfZ4oKPuV7jmLF9sWelDLCfvj5Erfg0SKkL/Gf2 K7RtIqBMroaRxhvKypgg7tTmFyYu6FL8RGi5GTfkFvPQMu03HFhbus+QPSa9TAnqk6Z0 BYBNFNbbJS4amPqh6VYfDDcczAflF3EkYLyfipX2jM01AeSRds57Psoz0FDktTlZU64O X9ZdjfO6zeXcJcoOCvSAHr80GXrHRzNX+vkhq36pVexDRz7ksKSkrueEeDvHv9Nk5K4F x5g9KTNqTBgpck2EJqNyIHD35TITQeGK9npJX23hNgmPkGpkDxuUNQ8iunlE+Xcn2MgO qV4Q== 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:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 6-20020a630d46000000b005c662419214si7902175pgn.229.2023.12.12.07.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 07:13:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7BAFE804E458; Tue, 12 Dec 2023 07:13:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376469AbjLLPNU (ORCPT + 99 others); Tue, 12 Dec 2023 10:13:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232844AbjLLPNT (ORCPT ); Tue, 12 Dec 2023 10:13:19 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C200D3; Tue, 12 Dec 2023 07:13:25 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B68BE143D; Tue, 12 Dec 2023 07:14:11 -0800 (PST) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8BE933F738; Tue, 12 Dec 2023 07:13:20 -0800 (PST) Message-ID: <5e2e56cf-9177-cb83-f88b-bd6592260a05@arm.com> Date: Tue, 12 Dec 2023 15:13:20 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v1 11/14] perf arm64 header: Remove unnecessary CPU map get and put Content-Language: en-US To: Ian Rogers References: <20231129060211.1890454-1-irogers@google.com> <20231129060211.1890454-12-irogers@google.com> Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , Thomas Gleixner , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=c3=a9_Almeida?= , Kan Liang , K Prateek Nayak , Sean Christopherson , Paolo Bonzini , Kajol Jain , Athira Rajeev , Andrew Jones , Alexandre Ghiti , Atish Patra , "Steinar H. Gunderson" , Yang Jihong , Yang Li , Changbin Du , Sandipan Das , Ravi Bangoria , Paran Lee , Nick Desaulniers , Huacai Chen , Yanteng Si , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org From: James Clark In-Reply-To: <20231129060211.1890454-12-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 07:13:30 -0800 (PST) On 29/11/2023 06:02, Ian Rogers wrote: > In both cases the CPU map is known owned by either the caller or a > PMU. > > Signed-off-by: Ian Rogers Reviewed-by: James Clark > --- > tools/perf/arch/arm64/util/header.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/tools/perf/arch/arm64/util/header.c b/tools/perf/arch/arm64/util/header.c > index 97037499152e..a9de0b5187dd 100644 > --- a/tools/perf/arch/arm64/util/header.c > +++ b/tools/perf/arch/arm64/util/header.c > @@ -25,8 +25,6 @@ static int _get_cpuid(char *buf, size_t sz, struct perf_cpu_map *cpus) > if (!sysfs || sz < MIDR_SIZE) > return EINVAL; > > - cpus = perf_cpu_map__get(cpus); > - > for (cpu = 0; cpu < perf_cpu_map__nr(cpus); cpu++) { > char path[PATH_MAX]; > FILE *file; > @@ -51,7 +49,6 @@ static int _get_cpuid(char *buf, size_t sz, struct perf_cpu_map *cpus) > break; > } > > - perf_cpu_map__put(cpus); > return ret; > } >