]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf python: Remove PYTHON_PERF ifdefs
authorIan Rogers <irogers@google.com>
Wed, 31 Jul 2024 23:00:05 +0000 (16:00 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Aug 2024 21:55:55 +0000 (18:55 -0300)
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>
tools/perf/util/evsel_fprintf.c
tools/perf/util/mmap.c

index 8719b3cb5646614dc90b34b3a345e4f6591a2105..c2c0500d5da99db9db620ef6c75e8915528d451d 100644 (file)
@@ -107,7 +107,6 @@ out:
        return ++printed;
 }
 
-#ifndef PYTHON_PERF
 int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
                              unsigned int print_opts, struct callchain_cursor *cursor,
                              struct strlist *bt_stop_list, FILE *fp)
@@ -248,4 +247,3 @@ int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
 
        return printed;
 }
-#endif /* PYTHON_PERF */
index 122ee198a86e9961d5b6c63dffc4c0d1e1636127..43b02293f1d2daf9786e5eb31714f1d19e93dd16 100644 (file)
@@ -230,9 +230,7 @@ void mmap__munmap(struct mmap *map)
 {
        bitmap_free(map->affinity_mask.bits);
 
-#ifndef PYTHON_PERF
        zstd_fini(&map->zstd_data);
-#endif
 
        perf_mmap__aio_munmap(map);
        if (map->data != NULL) {
@@ -295,12 +293,10 @@ int mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, struct perf_cpu
 
        map->core.flush = mp->flush;
 
-#ifndef PYTHON_PERF
        if (zstd_init(&map->zstd_data, mp->comp_level)) {
                pr_debug2("failed to init mmap compressor, error %d\n", errno);
                return -1;
        }
-#endif
 
        if (mp->comp_level && !perf_mmap__aio_enabled(map)) {
                map->data = mmap(NULL, mmap__mmap_len(map), PROT_READ|PROT_WRITE,