Linux Perf Users
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org,
	imx@lists.linux.dev
Subject: Re: [PATCH] perf kvm: move HAVE_KVM_STAT_SUPPORT down
Date: Fri, 16 Aug 2024 10:31:39 -0700	[thread overview]
Message-ID: <Zr-M-9mJyJ9G51sA@google.com> (raw)
In-Reply-To: <20240809115335.540947-1-xu.yang_2@nxp.com>

On Fri, Aug 09, 2024 at 07:53:35PM +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 "sort.h" for util/python.c.

But it's not intuitive.  I think you can include "util/sample.h" in the
util/python.c.

Thanks,
Namhyung

> 
> This will try to move HAVE_KVM_STAT_SUPPORT down, so normal header files
> can be exported to source files on other arch too.
> 
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> ---
>  tools/perf/util/kvm-stat.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h
> index 3e9ac754c3d1..92f1191cd462 100644
> --- a/tools/perf/util/kvm-stat.h
> +++ b/tools/perf/util/kvm-stat.h
> @@ -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	40
>  
>  struct evsel;
> -- 
> 2.34.1
> 

  reply	other threads:[~2024-08-16 17:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 11:53 [PATCH] perf kvm: move HAVE_KVM_STAT_SUPPORT down Xu Yang
2024-08-16 17:31 ` Namhyung Kim [this message]
2024-08-19  2:14   ` Xu Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zr-M-9mJyJ9G51sA@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=imx@lists.linux.dev \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=xu.yang_2@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox