linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 perf-tools] perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT
@ 2024-10-23 21:05 Arnaldo Carvalho de Melo
  2024-10-23 21:40 ` Ian Rogers
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-10-23 21:05 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Adrian Hunter, Linux Kernel Mailing List, linux-perf-users,
	Jiri Olsa, Kan Liang, Namhyung Kim

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: 9dabf4003423c8d3 ("perf python: Switch module to linking libraries from building source")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/python.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 31a223eaf8e65fa3..ee3d43a7ba4570f0 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -19,6 +19,7 @@
 #include "util/bpf-filter.h"
 #include "util/env.h"
 #include "util/kvm-stat.h"
+#include "util/stat.h"
 #include "util/kwork.h"
 #include "util/sample.h"
 #include "util/lock-contention.h"
@@ -1355,6 +1356,7 @@ PyMODINIT_FUNC PyInit_perf(void)
 
 unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH;
 
+#ifdef HAVE_KVM_STAT_SUPPORT
 bool kvm_entry_event(struct evsel *evsel __maybe_unused)
 {
 	return false;
@@ -1384,6 +1386,7 @@ void exit_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused,
 			   char *decode __maybe_unused)
 {
 }
+#endif // HAVE_KVM_STAT_SUPPORT
 
 int find_scripts(char **scripts_array  __maybe_unused, char **scripts_path_array  __maybe_unused,
 		int num  __maybe_unused, int pathlen __maybe_unused)
-- 
2.46.0


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

* Re: [PATCH 1/1 perf-tools] perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT
  2024-10-23 21:05 [PATCH 1/1 perf-tools] perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT Arnaldo Carvalho de Melo
@ 2024-10-23 21:40 ` Ian Rogers
  2024-10-23 21:46   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Rogers @ 2024-10-23 21:40 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, Linux Kernel Mailing List, linux-perf-users,
	Jiri Olsa, Kan Liang, Namhyung Kim

On Wed, Oct 23, 2024 at 2:05 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> 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: 9dabf4003423c8d3 ("perf python: Switch module to linking libraries from building source")
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

So this will at least conflict with:
https://lore.kernel.org/lkml/20241022173015.437550-6-irogers@google.com/
where the #ifdef-ed out functions are removed. Does that series fix
the ARM32 issue? Could we land that?

Thanks,
Ian

> ---
>  tools/perf/util/python.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
> index 31a223eaf8e65fa3..ee3d43a7ba4570f0 100644
> --- a/tools/perf/util/python.c
> +++ b/tools/perf/util/python.c
> @@ -19,6 +19,7 @@
>  #include "util/bpf-filter.h"
>  #include "util/env.h"
>  #include "util/kvm-stat.h"
> +#include "util/stat.h"
>  #include "util/kwork.h"
>  #include "util/sample.h"
>  #include "util/lock-contention.h"
> @@ -1355,6 +1356,7 @@ PyMODINIT_FUNC PyInit_perf(void)
>
>  unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH;
>
> +#ifdef HAVE_KVM_STAT_SUPPORT
>  bool kvm_entry_event(struct evsel *evsel __maybe_unused)
>  {
>         return false;
> @@ -1384,6 +1386,7 @@ void exit_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused,
>                            char *decode __maybe_unused)
>  {
>  }
> +#endif // HAVE_KVM_STAT_SUPPORT
>
>  int find_scripts(char **scripts_array  __maybe_unused, char **scripts_path_array  __maybe_unused,
>                 int num  __maybe_unused, int pathlen __maybe_unused)
> --
> 2.46.0
>

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

* Re: [PATCH 1/1 perf-tools] perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT
  2024-10-23 21:40 ` Ian Rogers
@ 2024-10-23 21:46   ` Arnaldo Carvalho de Melo
  2024-10-23 21:48     ` Ian Rogers
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-10-23 21:46 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Adrian Hunter, Linux Kernel Mailing List, linux-perf-users,
	Jiri Olsa, Kan Liang, Namhyung Kim

On Wed, Oct 23, 2024 at 02:40:45PM -0700, Ian Rogers wrote:
> On Wed, Oct 23, 2024 at 2:05 PM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> >
> > 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: 9dabf4003423c8d3 ("perf python: Switch module to linking libraries from building source")
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Kan Liang <kan.liang@linux.intel.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> So this will at least conflict with:
> https://lore.kernel.org/lkml/20241022173015.437550-6-irogers@google.com/
> where the #ifdef-ed out functions are removed. Does that series fix
> the ARM32 issue? Could we land that?

I'd prefer to have what I posted for perf-tools, as it is smaller, and
to land the patch removing those functions on perf-tools-next.

I'll try to switch testing to a librecomputer board, the rpi3 is super
slow :-)

Thanks,

- Arnaldo

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

* Re: [PATCH 1/1 perf-tools] perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT
  2024-10-23 21:46   ` Arnaldo Carvalho de Melo
@ 2024-10-23 21:48     ` Ian Rogers
  2024-10-23 22:29       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Rogers @ 2024-10-23 21:48 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, Linux Kernel Mailing List, linux-perf-users,
	Jiri Olsa, Kan Liang, Namhyung Kim

On Wed, Oct 23, 2024 at 2:46 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Wed, Oct 23, 2024 at 02:40:45PM -0700, Ian Rogers wrote:
> > On Wed, Oct 23, 2024 at 2:05 PM Arnaldo Carvalho de Melo
> > <acme@kernel.org> wrote:
> > >
> > > 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: 9dabf4003423c8d3 ("perf python: Switch module to linking libraries from building source")
> > > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > > Cc: Ian Rogers <irogers@google.com>
> > > Cc: Jiri Olsa <jolsa@kernel.org>
> > > Cc: Kan Liang <kan.liang@linux.intel.com>
> > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> >
> > So this will at least conflict with:
> > https://lore.kernel.org/lkml/20241022173015.437550-6-irogers@google.com/
> > where the #ifdef-ed out functions are removed. Does that series fix
> > the ARM32 issue? Could we land that?
>
> I'd prefer to have what I posted for perf-tools, as it is smaller, and
> to land the patch removing those functions on perf-tools-next.

Makes sense to me. Have a
Reviewed-by: Ian Rogers <irogers@google.com>
should you need it.

> I'll try to switch testing to a librecomputer board, the rpi3 is super
> slow :-)

Thanks,
Ian

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

* Re: [PATCH 1/1 perf-tools] perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT
  2024-10-23 21:48     ` Ian Rogers
@ 2024-10-23 22:29       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-10-23 22:29 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Adrian Hunter, Linux Kernel Mailing List, linux-perf-users,
	Jiri Olsa, Kan Liang, Namhyung Kim

On Wed, Oct 23, 2024 at 02:48:04PM -0700, Ian Rogers wrote:
> On Wed, Oct 23, 2024 at 2:46 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > On Wed, Oct 23, 2024 at 02:40:45PM -0700, Ian Rogers wrote:
> > > On Wed, Oct 23, 2024 at 2:05 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > > > Noticed while building on a raspbian arm 32-bit system.
<SNIP>
> > > > Fixes: 9dabf4003423c8d3 ("perf python: Switch module to linking libraries from building source")
> > > > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > > > Cc: Ian Rogers <irogers@google.com>
> > > > Cc: Jiri Olsa <jolsa@kernel.org>
> > > > Cc: Kan Liang <kan.liang@linux.intel.com>
> > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

> > > So this will at least conflict with:
> > > https://lore.kernel.org/lkml/20241022173015.437550-6-irogers@google.com/
> > > where the #ifdef-ed out functions are removed. Does that series fix
> > > the ARM32 issue? Could we land that?

> > I'd prefer to have what I posted for perf-tools, as it is smaller, and
> > to land the patch removing those functions on perf-tools-next.
 
> Makes sense to me. Have a
> Reviewed-by: Ian Rogers <irogers@google.com>
> should you need it.

Always appreciated, thanks, applying it to the patch,

- Arnaldo
 
> > I'll try to switch testing to a librecomputer board, the rpi3 is super
> > slow :-)

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

end of thread, other threads:[~2024-10-23 22:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 21:05 [PATCH 1/1 perf-tools] perf python: Fix up the build on architectures without HAVE_KVM_STAT_SUPPORT Arnaldo Carvalho de Melo
2024-10-23 21:40 ` Ian Rogers
2024-10-23 21:46   ` Arnaldo Carvalho de Melo
2024-10-23 21:48     ` Ian Rogers
2024-10-23 22:29       ` Arnaldo Carvalho de Melo

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).