From patchwork Wed Nov 29 06:02:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13472231 X-Patchwork-Delegate: bpf@iogearbox.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="a4zY/nC+" 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 01D061BC3 for ; Tue, 28 Nov 2023 22:02:42 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-db49a6b9be5so4171606276.1 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=fnbkCk9lTEPscOMAdnVFqaMyo5f1/9GaGwHREMPWr12jeIPY+bShQd5sg0pEwuEyu9 DKPnxnIq+Y4BgCFEPQypflq+/XAWF75AzE6Zso1zayIMCopu8pZO3NIZ80/F0lIjykfR jG/Wpgmttt/NBpsAgHHpLZgNFQqoYmkM++xkx5oRItYZZLpFSHgdJ4tHN0PJhS/NJpsx B/NTpDEgroJQdeXdgebqe1o/OGKIddWkD1q8sKTuapX/sE/CFIi9XJPJ3htLbJ54kJB6 lffkgmbkEZbqgqVehbKs6m462z/t+rp4j1ZH8ZVZLOEdkAJxVgMLLdZpSjlRhrrN5aYc zz2Q== X-Gm-Message-State: AOJu0YzBdps4GltYWogHCPESJxANUw6fWF3Fvew/5nqk5yq2RKTYcj+3 3zngt2sHgCBQ+YD5rMvcCpScwAR5GIzU X-Google-Smtp-Source: AGHT+IHJMRqYtdqiq8wS3BvtGG3WjhuhilD2hoypqMhKE4FVBpXobXp8Db6UyUfeaAWJBMxnRYUQrmZznlQj 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> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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_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 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; }