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

Configure Feed

Select the types of activity you want to include in your feed.

perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT

Noticed while building on a raspbian arm 32-bit system.

There was also this other case, fixed by adding a missing util/stat.h
with the prototypes:

/tmp/tmp.MbiSHoF3dj/perf-6.12.0-rc3/tools/perf/util/python.c:1396:6: error: no previous prototype for ‘perf_stat__set_no_csv_summary’ [-Werror=missing-prototypes]
1396 | void perf_stat__set_no_csv_summary(int set __maybe_unused)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/tmp.MbiSHoF3dj/perf-6.12.0-rc3/tools/perf/util/python.c:1400:6: error: no previous prototype for ‘perf_stat__set_big_num’ [-Werror=missing-prototypes]
1400 | void perf_stat__set_big_num(int set __maybe_unused)
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

In other architectures this must be building due to some lucky indirect
inclusion of that header.

Fixes: 9dabf4003423c8d3 ("perf python: Switch module to linking libraries from building source")
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZxllAtpmEw5fg9oy@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+3
+3
tools/perf/util/python.c
··· 19 19 #include "util/bpf-filter.h" 20 20 #include "util/env.h" 21 21 #include "util/kvm-stat.h" 22 + #include "util/stat.h" 22 23 #include "util/kwork.h" 23 24 #include "util/sample.h" 24 25 #include "util/lock-contention.h" ··· 1356 1355 1357 1356 unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH; 1358 1357 1358 + #ifdef HAVE_KVM_STAT_SUPPORT 1359 1359 bool kvm_entry_event(struct evsel *evsel __maybe_unused) 1360 1360 { 1361 1361 return false; ··· 1386 1384 char *decode __maybe_unused) 1387 1385 { 1388 1386 } 1387 + #endif // HAVE_KVM_STAT_SUPPORT 1389 1388 1390 1389 int find_scripts(char **scripts_array __maybe_unused, char **scripts_path_array __maybe_unused, 1391 1390 int num __maybe_unused, int pathlen __maybe_unused)