Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
f69d34e8 af9e8d12

+2 -2
+1 -1
tools/perf/util/drm_pmu.c
··· 120 120 return NULL; 121 121 } 122 122 123 - drm->pmu.cpus = perf_cpu_map__new("0"); 123 + drm->pmu.cpus = perf_cpu_map__new_int(0); 124 124 if (!drm->pmu.cpus) { 125 125 perf_pmu__delete(&drm->pmu); 126 126 return NULL;
+1 -1
tools/perf/util/hwmon_pmu.c
··· 376 376 perf_pmu__delete(&hwm->pmu); 377 377 return NULL; 378 378 } 379 - hwm->pmu.cpus = perf_cpu_map__new("0"); 379 + hwm->pmu.cpus = perf_cpu_map__new_int(0); 380 380 if (!hwm->pmu.cpus) { 381 381 perf_pmu__delete(&hwm->pmu); 382 382 return NULL;