Skip to content

Commit 758f181

Browse files
committed
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: 9dabf40 ("perf python: Switch module to linking libraries from building source") Reviewed-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/lkml/ZxllAtpmEw5fg9oy@x1 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 06a130e commit 758f181

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/perf/util/python.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "util/bpf-filter.h"
2020
#include "util/env.h"
2121
#include "util/kvm-stat.h"
22+
#include "util/stat.h"
2223
#include "util/kwork.h"
2324
#include "util/sample.h"
2425
#include "util/lock-contention.h"
@@ -1355,6 +1356,7 @@ PyMODINIT_FUNC PyInit_perf(void)
13551356

13561357
unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH;
13571358

1359+
#ifdef HAVE_KVM_STAT_SUPPORT
13581360
bool kvm_entry_event(struct evsel *evsel __maybe_unused)
13591361
{
13601362
return false;
@@ -1384,6 +1386,7 @@ void exit_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused,
13841386
char *decode __maybe_unused)
13851387
{
13861388
}
1389+
#endif // HAVE_KVM_STAT_SUPPORT
13871390

13881391
int find_scripts(char **scripts_array __maybe_unused, char **scripts_path_array __maybe_unused,
13891392
int num __maybe_unused, int pathlen __maybe_unused)

0 commit comments

Comments
 (0)