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

perf python: Remove PYTHON_PERF ifdefs

When perf code was compiled one way for the binary and another for the
python module, the PYTHON_PERF ifdef was used to remove some code from
the python module.

Since switching to building the perf code as a series of libraries, with
the same libraries being used for the python module, the ifdefs became
unused as PYTHON_PERF is never defined. As such remove the ifdefs.

Fixes: 9dabf4003423c8d3 ("perf python: Switch module to linking libraries from building source")
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240731230005.12295-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
7c5dd51b 0fe881f1

-6
-2
tools/perf/util/evsel_fprintf.c
··· 107 107 return ++printed; 108 108 } 109 109 110 - #ifndef PYTHON_PERF 111 110 int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, 112 111 unsigned int print_opts, struct callchain_cursor *cursor, 113 112 struct strlist *bt_stop_list, FILE *fp) ··· 247 248 248 249 return printed; 249 250 } 250 - #endif /* PYTHON_PERF */
-4
tools/perf/util/mmap.c
··· 230 230 { 231 231 bitmap_free(map->affinity_mask.bits); 232 232 233 - #ifndef PYTHON_PERF 234 233 zstd_fini(&map->zstd_data); 235 - #endif 236 234 237 235 perf_mmap__aio_munmap(map); 238 236 if (map->data != NULL) { ··· 293 295 294 296 map->core.flush = mp->flush; 295 297 296 - #ifndef PYTHON_PERF 297 298 if (zstd_init(&map->zstd_data, mp->comp_level)) { 298 299 pr_debug2("failed to init mmap compressor, error %d\n", errno); 299 300 return -1; 300 301 } 301 - #endif 302 302 303 303 if (mp->comp_level && !perf_mmap__aio_enabled(map)) { 304 304 map->data = mmap(NULL, mmap__mmap_len(map), PROT_READ|PROT_WRITE,