Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4367422rdh; Tue, 28 Nov 2023 22:03:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGf1jCgH4TQ6U/+Kfa8QlnshT/I3/13UtLWpAJEPao9a/KM8Vgls2z6xB8SE/814iAurm9o X-Received: by 2002:a05:6e02:1582:b0:357:fa1b:48d with SMTP id m2-20020a056e02158200b00357fa1b048dmr14560003ilu.25.1701237834888; Tue, 28 Nov 2023 22:03:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701237834; cv=none; d=google.com; s=arc-20160816; b=LeKBwVO2zwMWsdSOYbff4jnEMcwziSUJfHbmtUwyqFtdVHOo2mGOOx9Pn57JO7LGJM edIgXm7X9jG7hL/7EIIlKoT9cy+8gzJdDGf1fklY6D8X2GHlC80MUvZ0RI/8strbPna1 jEK4METLQkEEM7EC2pDGSa+KiOGnMOZ9j7R1wlPRofsSQZVVpuYkQpXwm83gDZOJU4rx /EsAXemFXna07Iu4441/PbCp0oyV4lE8DLGqJ2iY485V7Z+QB/yptotbNkikhIP1ohJ1 cw6K0E9JvjPYspcQjmLsvJdiGN9h22IL7uUEc2Rs6pVRbWtl5hXRl+ixfYKVArPWaiE8 Sp4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=0DVMbIRV+NQmnATStJOD8jb70rfi854C2wLg/boNolQ=; fh=uYKNI4aCUAMYZ/8oQVBIse94GgoxWIIZr1zaTbrWG7c=; b=T2sZSBa0TBJkGZtZuSTfRvpzbkYYD3/cuaQvHDX0am/SCk/GVuxrXKsUX9Ld+bfk5K cXxf1T4vMuhGZvoTlLr0/b4mfjRB96fTDVrWUpGxw6FjVT8Tc/wC7gbIyvPROr4/fQim uuWSjAO3z+pUA+9IHhMwadlcdmDZTvDZyV7pW7dfWfsy15r+E0Yg6AmAXZecI3O8DykQ DOtoTLiD3EmK8ImpMPn9FhEMs3WjDXJRPztC7VCekAM9zTmNpCS7pfadUK1YwF5LSk/7 TFU4E4eEcZedPhGKP+okjM8RLMVGXuw2JclqbKKI+mkgJtDmTHI3JyPp6xyYWVzfD5yu yj9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="a4zY/nC+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id y13-20020aa79e0d000000b006b905fe37b7si13189545pfq.221.2023.11.28.22.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 22:03:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="a4zY/nC+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id AA64B80A64E2; Tue, 28 Nov 2023 22:03:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377093AbjK2GC7 (ORCPT + 99 others); Wed, 29 Nov 2023 01:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377035AbjK2GCg (ORCPT ); Wed, 29 Nov 2023 01:02:36 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0406E1BCC for ; Tue, 28 Nov 2023 22:02:42 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d9cb79eb417so6649487276.2 for ; Tue, 28 Nov 2023 22:02:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701237761; x=1701842561; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=0DVMbIRV+NQmnATStJOD8jb70rfi854C2wLg/boNolQ=; b=a4zY/nC+0QtkxYXQUOj8uwuD+fonU+1WoTol7K1a0yha0+XUCYnbvn4CPLXb5tK3aH vJt/cKfnVcxmP24DjxQnvxwPtO54xENEs+k/qZd9ROc2TF5IAIZsRGPE6rqvypeJEiG1 /HC/F5uEqO9iUVYIaSciOoD6+UV7MLN+sOphw68wcXtTHGYqLcijMEeWKxuAvNeaXwGN QBiCewTJkOcL76fD7sQPmI4XVSgN/ON246iDDGrjvUROdQvoI9W7COlfzGYRnikJSRDU iriSFPigvOQ04ojlxspTj8iOOcmdZHREqd64sZtPw1D/xJXdMW8dhTEOr8jdHR2n5+Nl YqOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701237761; x=1701842561; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0DVMbIRV+NQmnATStJOD8jb70rfi854C2wLg/boNolQ=; b=IzfmF9QyBZj03vqXwPfUDG1KtbVFqEHzYbS730USS1TCqmINx85h/lUsDNPZ4xrLon /zEpNsEI2zDcXfWQ2wPLueZUcXuhqfNFk77HLGI6RQ54RHQ6S5rZEQrEV1kEPmD08+R8 np0hKzyUhOuKKSAzi0oC9ELPvSDC057vX74GEaQV0RrxeOYElvqlMBSQmkHVNxQOt4SH oohs5oKHJUki3NLu7fMMTumpRXashAYUgz+3kCGE6kSYE/6AFXpgUCVNDJQ4/YhN7qV9 5IMeLcK/ULoN15bVmakzpTh79cLCp+NIvUHyTV0q4IKHIcMLkif50Y9QB/XIgtSaJO4p UMFA== X-Gm-Message-State: AOJu0Yy+xC9xZvX621lRpHsq73s5JE14MUV3AREW1bedFYgk7yEaI/B0 sifCRwxoIO30LcSjiCwgdrR6oaGy50qt X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:763b:80fa:23ca:96f8]) (user=irogers job=sendgmr) by 2002:a25:e4c5:0:b0:d9c:801c:4230 with SMTP id b188-20020a25e4c5000000b00d9c801c4230mr494820ybh.5.1701237761085; Tue, 28 Nov 2023 22:02:41 -0800 (PST) Date: Tue, 28 Nov 2023 22:02:08 -0800 In-Reply-To: <20231129060211.1890454-1-irogers@google.com> Message-Id: <20231129060211.1890454-12-irogers@google.com> Mime-Version: 1.0 References: <20231129060211.1890454-1-irogers@google.com> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Subject: [PATCH v1 11/14] perf arm64 header: Remove unnecessary CPU map get and put From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , John Garry , Will Deacon , Thomas Gleixner , Darren Hart , Davidlohr Bueso , "=?UTF-8?q?Andr=C3=A9=20Almeida?=" , 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 Content-Type: text/plain; charset="UTF-8" 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,T_SCC_BODY_TEXT_LINE, 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 22:03:50 -0800 (PST) In both cases the CPU map is known owned by either the caller or a PMU. Signed-off-by: Ian Rogers --- 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; } -- 2.43.0.rc1.413.gea7ed67945-goog