[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251106071241.141234-3-irogers@google.com>
Date: Wed, 5 Nov 2025 23:12:33 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
"Dr. David Alan Gilbert" <linux@...blig.org>, Yang Li <yang.lee@...ux.alibaba.com>,
James Clark <james.clark@...aro.org>, Thomas Falcon <thomas.falcon@...el.com>,
Thomas Richter <tmricht@...ux.ibm.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
Dapeng Mi <dapeng1.mi@...ux.intel.com>
Subject: [PATCH v3 2/9] perf pmu: perf_cpu_map__new_int to avoid parsing a string
Prefer perf_cpu_map__new_int(0) to perf_cpu_map__new("0") as it avoids
strings parsing.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/util/drm_pmu.c | 2 +-
tools/perf/util/hwmon_pmu.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/drm_pmu.c b/tools/perf/util/drm_pmu.c
index 98d4d2b556d4..fc864bde4cb2 100644
--- a/tools/perf/util/drm_pmu.c
+++ b/tools/perf/util/drm_pmu.c
@@ -119,7 +119,7 @@ static struct drm_pmu *add_drm_pmu(struct list_head *pmus, char *line, size_t li
return NULL;
}
- drm->pmu.cpus = perf_cpu_map__new("0");
+ drm->pmu.cpus = perf_cpu_map__new_int(0);
if (!drm->pmu.cpus) {
perf_pmu__delete(&drm->pmu);
return NULL;
diff --git a/tools/perf/util/hwmon_pmu.c b/tools/perf/util/hwmon_pmu.c
index 5c27256a220a..279d6b1a47f0 100644
--- a/tools/perf/util/hwmon_pmu.c
+++ b/tools/perf/util/hwmon_pmu.c
@@ -376,7 +376,7 @@ struct perf_pmu *hwmon_pmu__new(struct list_head *pmus, const char *hwmon_dir,
perf_pmu__delete(&hwm->pmu);
return NULL;
}
- hwm->pmu.cpus = perf_cpu_map__new("0");
+ hwm->pmu.cpus = perf_cpu_map__new_int(0);
if (!hwm->pmu.cpus) {
perf_pmu__delete(&hwm->pmu);
return NULL;
--
2.51.2.1041.gc1ab5b90ca-goog
Powered by blists - more mailing lists