diff mbox series

[v1,11/14] perf arm64 header: Remove unnecessary CPU map get and put

Message ID 20231129060211.1890454-12-irogers@google.com (mailing list archive)
State New, archived
Headers show
Series Clean up libperf cpumap's empty function | expand

Commit Message

Ian Rogers Nov. 29, 2023, 6:02 a.m. UTC
In both cases the CPU map is known owned by either the caller or a
PMU.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/arch/arm64/util/header.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

James Clark Dec. 12, 2023, 3:13 p.m. UTC | #1
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 <irogers@google.com>

Reviewed-by: James Clark <james.clark@arm.com>

> ---
>  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;
>  }
>
diff mbox series

Patch

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;
 }