perf python: include "util/sample.h"
Subsystems (2)
PATCH v2 1/1 perf python: include "util/sample.h"
The 32-bit arm build system will complain:
tools/perf/util/python.c:75:28: error: field ‘sample’ has incomplete type
75 | struct perf_sample sample;
However, arm64 build system doesn't complain this.
The root cause is arm64 define "HAVE_KVM_STAT_SUPPORT := 1" in tools/perf/arch/arm64/Makefile, but arm arch doesn't define this. This will lead to kvm-stat.h include other header files on arm64 build system, especially "util/sample.h" for util/python.c.
This will try to directly include "util/sample.h" for "util/python.c" to avoid such build issue on arm platform.
---
Changes in v2:
- include "util/sample.h" in "util/python.c"
--- tools/perf/util/python.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/python.c +1 -0
@@ -20,6 +20,7 @@#include "util/env.h" #include "util/kvm-stat.h" #include "util/kwork.h" +#include "util/sample.h" #include "util/lock-contention.h" #include <internal/lib.h> #include "../builtin.h"
Signature · 1 line
2.34.1
Quoted 12 lines · Xu Yang
The 32-bit arm build system will complain:
tools/perf/util/python.c:75:28: error: field ‘sample’ has incomplete type
75 | structperf_samplesample;However, arm64 build system doesn't complain this.
The root cause is arm64 define "
HAVE_KVM_STAT_SUPPORT:= 1" intools/perf/arch/arm64/Makefile, but arm arch doesn't define this. This will lead tokvm-stat.hinclude other header files on arm64 build system, especially "util/sample.h" forutil/python.c.
Quoted 8 lines
This will try to directly include "
util/sample.h" for "util/python.c" to avoid such build issue on arm platform.Signed-off-by Xu Yang <[email protected]>---
Changes in v2:
- include "util/sample.h" in "util/python.c"
Thanks, applied to perf-tools-next,
- Arnaldo
Quoted 18 lines
--- tools/perf/util/python.c | 1 + 1 file changed, 1 insertion(+)tools/perf/util/python.c +1
-0@@ -20,6 +20,7 @@#include "util/env.h" #include "util/kvm-stat.h" #include "util/kwork.h" +#include "util/sample.h" #include "util/lock-contention.h" #include <internal/lib.h> #include "../builtin.h" Signature · 1 line
2.34.1
Quoted 16 lines · Arnaldo Carvalho de Melo
Quoted 15 lines · Xu Yang
The 32-bit arm build system will complain:
tools/perf/util/python.c:75:28: error: field ‘sample’ has incomplete type
75 | structperf_samplesample;However, arm64 build system doesn't complain this.
The root cause is arm64 define "
HAVE_KVM_STAT_SUPPORT:= 1" intools/perf/arch/arm64/Makefile, but arm arch doesn't define this. This will lead tokvm-stat.hinclude other header files on arm64 build system, especially "util/sample.h" forutil/python.c.This will try to directly include "
util/sample.h" for "util/python.c" to avoid such build issue on arm platform.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Xu Yang <[email protected]>---
Changes in v2:
- include "util/sample.h" in "util/python.c"Thanks, applied to perf-tools-next,
[...]
This is a regression in 6.11, so the fix should go into the current release cycle, not the next one.
Ben.
Signature · 3 lines
Ben Hutchings Any smoothly functioning technology is indistinguishable from a rigged demo.