perf kvm: move HAVE_KVM_STAT_SUPPORT down
Subsystems (2)
PATCH 1/1 perf kvm: move HAVE_KVM_STAT_SUPPORT down
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 "sort.h" for util/python.c.
This will try to move HAVE_KVM_STAT_SUPPORT down, so normal header files can be exported to source files on other arch too.
--- tools/perf/util/kvm-stat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/kvm-stat.h +2 -2
@@ -2,8 +2,6 @@#ifndef __PERF_KVM_STAT_H#define __PERF_KVM_STAT_H -#ifdef HAVE_KVM_STAT_SUPPORT -#include "tool.h" #include "sort.h" #include "stat.h"
@@ -13,6 +11,8 @@#include <stdlib.h> #include <linux/zalloc.h> +#ifdef HAVE_KVM_STAT_SUPPORT +#define KVM_EVENT_NAME_LEN 40struct evsel ;
Signature · 1 line
2.34.1
Namhyung Kim
maintainerQuoted 11 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 "sort.h" forutil/python.c.
But it's not intuitive. I think you can include "util/sample.h" in the util/python.c.
Thanks,
Namhyung
Quoted 34 lines
This will try to move
HAVE_KVM_STAT_SUPPORTdown, so normal header files can be exported to source files on other arch too.Signed-off-by Xu Yang <[email protected]>--- tools/perf/util/kvm-stat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/util/kvm-stat.h +2
-2@@ -2,8 +2,6 @@#ifndef __PERF_KVM_STAT_H#define __PERF_KVM_STAT_H -#ifdef HAVE_KVM_STAT_SUPPORT -#include "tool.h" #include "sort.h" #include "stat.h" @@ -13,6 +11,8 @@#include <stdlib.h> #include <linux/zalloc.h> +#ifdef HAVE_KVM_STAT_SUPPORT +#define KVM_EVENT_NAME_LEN 40struct evsel ;Signature · 1 line
2.34.1
Quoted 8 lines · Namhyung Kim
Quoted 7 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.
Quoted 7 lines
Quoted 4 lines
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 "sort.h" forutil/python.c.But it's not intuitive. I think you can include "
util/sample.h" in theutil/python.c.
Sure. I'll send v2.
Thanks,
Xu Yang
Quoted 38 lines
Thanks,
NamhyungQuoted 34 lines
This will try to move
HAVE_KVM_STAT_SUPPORTdown, so normal header files can be exported to source files on other arch too.Signed-off-by Xu Yang <[email protected]>--- tools/perf/util/kvm-stat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/util/kvm-stat.h +2
-2@@ -2,8 +2,6 @@#ifndef __PERF_KVM_STAT_H#define __PERF_KVM_STAT_H -#ifdef HAVE_KVM_STAT_SUPPORT -#include "tool.h" #include "sort.h" #include "stat.h" @@ -13,6 +11,8 @@#include <stdlib.h> #include <linux/zalloc.h> +#ifdef HAVE_KVM_STAT_SUPPORT +#define KVM_EVENT_NAME_LEN 40struct evsel ;Signature · 1 line
2.34.1