linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] perf python: include "util/sample.h"
@ 2024-08-19  2:34 Xu Yang
  2024-08-19 17:44 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Xu Yang @ 2024-08-19  2:34 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang
  Cc: linux-perf-users, imx

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.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - include "util/sample.h" in "util/python.c"
---
 tools/perf/util/python.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 3be882b2e845..31a223eaf8e6 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -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"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] perf python: include "util/sample.h"
  2024-08-19  2:34 [PATCH v2] perf python: include "util/sample.h" Xu Yang
@ 2024-08-19 17:44 ` Arnaldo Carvalho de Melo
  2024-08-25 14:21   ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-19 17:44 UTC (permalink / raw)
  To: Xu Yang
  Cc: peterz, mingo, namhyung, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, kan.liang, linux-perf-users, imx

On Mon, Aug 19, 2024 at 10:34:03AM +0800, Xu Yang wrote:
> 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.
> 
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> 
> ---
> Changes in v2:
>  - include "util/sample.h" in "util/python.c"

Thanks, applied to perf-tools-next,

- Arnaldo
> ---
>  tools/perf/util/python.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
> index 3be882b2e845..31a223eaf8e6 100644
> --- a/tools/perf/util/python.c
> +++ b/tools/perf/util/python.c
> @@ -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"
> -- 
> 2.34.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] perf python: include "util/sample.h"
  2024-08-19 17:44 ` Arnaldo Carvalho de Melo
@ 2024-08-25 14:21   ` Ben Hutchings
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2024-08-25 14:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Xu Yang
  Cc: peterz, mingo, namhyung, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, kan.liang, linux-perf-users, imx

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

On Mon, 2024-08-19 at 14:44 -0300, Arnaldo Carvalho de Melo wrote:
> On Mon, Aug 19, 2024 at 10:34:03AM +0800, Xu Yang wrote:
> > 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.
> > 
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > 
> > ---
> > 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.

-- 
Ben Hutchings
Any smoothly functioning technology is indistinguishable
from a rigged demo.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-25 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19  2:34 [PATCH v2] perf python: include "util/sample.h" Xu Yang
2024-08-19 17:44 ` Arnaldo Carvalho de Melo
2024-08-25 14:21   ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).