* [PATCH] tools/perf: Fix perf tool build error in util/pfm.c
@ 2023-02-07 14:04 Thomas Richter
2023-02-07 15:02 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 9+ messages in thread
From: Thomas Richter @ 2023-02-07 14:04 UTC (permalink / raw)
To: linux-kernel-next, linux-perf-users, acme, irogers, hca, egorenar,
gor
Cc: svens, sumanthk, Thomas Richter
I have downloaded linux-next and build the perf tool using
# make LIBPFM4=1
to have libpfm4 support built into perf. The build fails:
# make LIBPFM4=1
....
INSTALL libbpf_headers
CC util/pfm.o
util/pfm.c: In function ‘print_libpfm_event’:
util/pfm.c:189:9: error: too many arguments to function ‘print_cb->print_event’
189 | print_cb->print_event(print_state,
| ^~~~~~~~
util/pfm.c:220:25: error: too many arguments to function ‘print_cb->print_event’
220 | print_cb->print_event(print_state,
The build error is caused by
commit d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables")
which changes the function prototype of
struct print_callbacks {
...
void (*print_event)(...); --> last two parameters removed.
};
but does not adjust the usage of this function prototype in util/pfm.c.
In file util/pfm.c function print_event() is still invoked with 13 parameters
instead of 11. The compile fails.
When I adjust the file util/pfm.c as in this patch, the build works file.
Please check this patch for correctness, I have just fixed the compile
issue.
Fixes d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables")
Cc: irogers@google.com
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
tools/perf/util/pfm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
index ac3227ba769c..b59ba825ddc9 100644
--- a/tools/perf/util/pfm.c
+++ b/tools/perf/util/pfm.c
@@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
/*scale_unit=*/NULL,
/*deprecated=*/NULL, "PFM event",
info->desc, /*long_desc=*/NULL,
- /*encoding_desc=*/buf->buf,
- /*metric_name=*/NULL, /*metric_expr=*/NULL);
+ /*encoding_desc=*/buf->buf);
pfm_for_each_event_attr(j, info) {
pfm_event_attr_info_t ainfo;
@@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
/*scale_unit=*/NULL,
/*deprecated=*/NULL, "PFM event",
ainfo.desc, /*long_desc=*/NULL,
- /*encoding_desc=*/buf->buf,
- /*metric_name=*/NULL, /*metric_expr=*/NULL);
+ /*encoding_desc=*/buf->buf);
}
}
}
--
2.39.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-07 14:04 [PATCH] tools/perf: Fix perf tool build error in util/pfm.c Thomas Richter @ 2023-02-07 15:02 ` Arnaldo Carvalho de Melo 2023-02-08 5:58 ` Ian Rogers 0 siblings, 1 reply; 9+ messages in thread From: Arnaldo Carvalho de Melo @ 2023-02-07 15:02 UTC (permalink / raw) To: Ian Rogers, Thomas Richter Cc: linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk Em Tue, Feb 07, 2023 at 03:04:47PM +0100, Thomas Richter escreveu: > I have downloaded linux-next and build the perf tool using > > # make LIBPFM4=1 > > to have libpfm4 support built into perf. The build fails: > > # make LIBPFM4=1 Ian, Can you please take a look? Should we go this way or have some feature test to check how that function signature should look? - Arnaldo > .... > INSTALL libbpf_headers > CC util/pfm.o > util/pfm.c: In function ‘print_libpfm_event’: > util/pfm.c:189:9: error: too many arguments to function ‘print_cb->print_event’ > 189 | print_cb->print_event(print_state, > | ^~~~~~~~ > util/pfm.c:220:25: error: too many arguments to function ‘print_cb->print_event’ > 220 | print_cb->print_event(print_state, > > The build error is caused by > commit d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > which changes the function prototype of > struct print_callbacks { > ... > void (*print_event)(...); --> last two parameters removed. > }; > > but does not adjust the usage of this function prototype in util/pfm.c. > In file util/pfm.c function print_event() is still invoked with 13 parameters > instead of 11. The compile fails. > > When I adjust the file util/pfm.c as in this patch, the build works file. > Please check this patch for correctness, I have just fixed the compile > issue. > > Fixes d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > Cc: irogers@google.com > Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> > --- > tools/perf/util/pfm.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c > index ac3227ba769c..b59ba825ddc9 100644 > --- a/tools/perf/util/pfm.c > +++ b/tools/perf/util/pfm.c > @@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > /*scale_unit=*/NULL, > /*deprecated=*/NULL, "PFM event", > info->desc, /*long_desc=*/NULL, > - /*encoding_desc=*/buf->buf, > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > + /*encoding_desc=*/buf->buf); > > pfm_for_each_event_attr(j, info) { > pfm_event_attr_info_t ainfo; > @@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > /*scale_unit=*/NULL, > /*deprecated=*/NULL, "PFM event", > ainfo.desc, /*long_desc=*/NULL, > - /*encoding_desc=*/buf->buf, > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > + /*encoding_desc=*/buf->buf); > } > } > } > -- > 2.39.1 > -- - Arnaldo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-07 15:02 ` Arnaldo Carvalho de Melo @ 2023-02-08 5:58 ` Ian Rogers 2023-02-08 13:40 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 9+ messages in thread From: Ian Rogers @ 2023-02-08 5:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Richter, linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk On Tue, Feb 7, 2023 at 7:02 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Em Tue, Feb 07, 2023 at 03:04:47PM +0100, Thomas Richter escreveu: > > I have downloaded linux-next and build the perf tool using > > > > # make LIBPFM4=1 > > > > to have libpfm4 support built into perf. The build fails: > > > > # make LIBPFM4=1 > > Ian, > > Can you please take a look? Should we go this way or have some > feature test to check how that function signature should look? > > - Arnaldo Tested-by: Ian Rogers <irogers@google.com> Wrt tests, there is make_with_libpfm4 in tools/perf/tests/make. Thanks, Ian > > .... > > INSTALL libbpf_headers > > CC util/pfm.o > > util/pfm.c: In function ‘print_libpfm_event’: > > util/pfm.c:189:9: error: too many arguments to function ‘print_cb->print_event’ > > 189 | print_cb->print_event(print_state, > > | ^~~~~~~~ > > util/pfm.c:220:25: error: too many arguments to function ‘print_cb->print_event’ > > 220 | print_cb->print_event(print_state, > > > > The build error is caused by > > commit d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > which changes the function prototype of > > struct print_callbacks { > > ... > > void (*print_event)(...); --> last two parameters removed. > > }; > > > > but does not adjust the usage of this function prototype in util/pfm.c. > > In file util/pfm.c function print_event() is still invoked with 13 parameters > > instead of 11. The compile fails. > > > > When I adjust the file util/pfm.c as in this patch, the build works file. > > Please check this patch for correctness, I have just fixed the compile > > issue. > > > > Fixes d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > Cc: irogers@google.com > > Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> > > --- > > tools/perf/util/pfm.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c > > index ac3227ba769c..b59ba825ddc9 100644 > > --- a/tools/perf/util/pfm.c > > +++ b/tools/perf/util/pfm.c > > @@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > /*scale_unit=*/NULL, > > /*deprecated=*/NULL, "PFM event", > > info->desc, /*long_desc=*/NULL, > > - /*encoding_desc=*/buf->buf, > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > + /*encoding_desc=*/buf->buf); > > > > pfm_for_each_event_attr(j, info) { > > pfm_event_attr_info_t ainfo; > > @@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > /*scale_unit=*/NULL, > > /*deprecated=*/NULL, "PFM event", > > ainfo.desc, /*long_desc=*/NULL, > > - /*encoding_desc=*/buf->buf, > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > + /*encoding_desc=*/buf->buf); > > } > > } > > } > > -- > > 2.39.1 > > > > -- > > - Arnaldo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-08 5:58 ` Ian Rogers @ 2023-02-08 13:40 ` Arnaldo Carvalho de Melo 2023-02-08 13:44 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 9+ messages in thread From: Arnaldo Carvalho de Melo @ 2023-02-08 13:40 UTC (permalink / raw) To: Ian Rogers Cc: Thomas Richter, linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk Em Tue, Feb 07, 2023 at 09:58:48PM -0800, Ian Rogers escreveu: > On Tue, Feb 7, 2023 at 7:02 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > Em Tue, Feb 07, 2023 at 03:04:47PM +0100, Thomas Richter escreveu: > > > I have downloaded linux-next and build the perf tool using > > > > > > # make LIBPFM4=1 > > > > > > to have libpfm4 support built into perf. The build fails: > > > > > > # make LIBPFM4=1 > > > > Ian, > > > > Can you please take a look? Should we go this way or have some > > feature test to check how that function signature should look? > > > > - Arnaldo > > Tested-by: Ian Rogers <irogers@google.com> > > Wrt tests, there is make_with_libpfm4 in tools/perf/tests/make. I meant if we should support older versions or state that to build with libbpf we need to have the version with this new signature. I'll apply and test build it here. - Arnaldo > Thanks, > Ian > > > > .... > > > INSTALL libbpf_headers > > > CC util/pfm.o > > > util/pfm.c: In function ‘print_libpfm_event’: > > > util/pfm.c:189:9: error: too many arguments to function ‘print_cb->print_event’ > > > 189 | print_cb->print_event(print_state, > > > | ^~~~~~~~ > > > util/pfm.c:220:25: error: too many arguments to function ‘print_cb->print_event’ > > > 220 | print_cb->print_event(print_state, > > > > > > The build error is caused by > > > commit d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > > which changes the function prototype of > > > struct print_callbacks { > > > ... > > > void (*print_event)(...); --> last two parameters removed. > > > }; > > > > > > but does not adjust the usage of this function prototype in util/pfm.c. > > > In file util/pfm.c function print_event() is still invoked with 13 parameters > > > instead of 11. The compile fails. > > > > > > When I adjust the file util/pfm.c as in this patch, the build works file. > > > Please check this patch for correctness, I have just fixed the compile > > > issue. > > > > > > Fixes d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > > Cc: irogers@google.com > > > Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> > > > --- > > > tools/perf/util/pfm.c | 6 ++---- > > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > > > diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c > > > index ac3227ba769c..b59ba825ddc9 100644 > > > --- a/tools/perf/util/pfm.c > > > +++ b/tools/perf/util/pfm.c > > > @@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > > /*scale_unit=*/NULL, > > > /*deprecated=*/NULL, "PFM event", > > > info->desc, /*long_desc=*/NULL, > > > - /*encoding_desc=*/buf->buf, > > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > > + /*encoding_desc=*/buf->buf); > > > > > > pfm_for_each_event_attr(j, info) { > > > pfm_event_attr_info_t ainfo; > > > @@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > > /*scale_unit=*/NULL, > > > /*deprecated=*/NULL, "PFM event", > > > ainfo.desc, /*long_desc=*/NULL, > > > - /*encoding_desc=*/buf->buf, > > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > > + /*encoding_desc=*/buf->buf); > > > } > > > } > > > } > > > -- > > > 2.39.1 > > > > > > > -- > > > > - Arnaldo -- - Arnaldo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-08 13:40 ` Arnaldo Carvalho de Melo @ 2023-02-08 13:44 ` Arnaldo Carvalho de Melo 2023-02-08 14:07 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 9+ messages in thread From: Arnaldo Carvalho de Melo @ 2023-02-08 13:44 UTC (permalink / raw) To: Ian Rogers Cc: Thomas Richter, linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk Em Wed, Feb 08, 2023 at 10:40:57AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Feb 07, 2023 at 09:58:48PM -0800, Ian Rogers escreveu: > > On Tue, Feb 7, 2023 at 7:02 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > > > Em Tue, Feb 07, 2023 at 03:04:47PM +0100, Thomas Richter escreveu: > > > > I have downloaded linux-next and build the perf tool using > > > > > > > > # make LIBPFM4=1 > > > > > > > > to have libpfm4 support built into perf. The build fails: > > > > > > > > # make LIBPFM4=1 > > > > > > Ian, > > > > > > Can you please take a look? Should we go this way or have some > > > feature test to check how that function signature should look? > > > > > > - Arnaldo > > > > Tested-by: Ian Rogers <irogers@google.com> > > > > Wrt tests, there is make_with_libpfm4 in tools/perf/tests/make. > > I meant if we should support older versions or state that to build with > libbpf we need to have the version with this new signature. I see, the signature change wasn't in libpfm, nevermind, testing now. - Arnaldo > I'll apply and test build it here. > > - Arnaldo > > > Thanks, > > Ian > > > > > > .... > > > > INSTALL libbpf_headers > > > > CC util/pfm.o > > > > util/pfm.c: In function ‘print_libpfm_event’: > > > > util/pfm.c:189:9: error: too many arguments to function ‘print_cb->print_event’ > > > > 189 | print_cb->print_event(print_state, > > > > | ^~~~~~~~ > > > > util/pfm.c:220:25: error: too many arguments to function ‘print_cb->print_event’ > > > > 220 | print_cb->print_event(print_state, > > > > > > > > The build error is caused by > > > > commit d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > > > which changes the function prototype of > > > > struct print_callbacks { > > > > ... > > > > void (*print_event)(...); --> last two parameters removed. > > > > }; > > > > > > > > but does not adjust the usage of this function prototype in util/pfm.c. > > > > In file util/pfm.c function print_event() is still invoked with 13 parameters > > > > instead of 11. The compile fails. > > > > > > > > When I adjust the file util/pfm.c as in this patch, the build works file. > > > > Please check this patch for correctness, I have just fixed the compile > > > > issue. > > > > > > > > Fixes d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > > > Cc: irogers@google.com > > > > Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> > > > > --- > > > > tools/perf/util/pfm.c | 6 ++---- > > > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c > > > > index ac3227ba769c..b59ba825ddc9 100644 > > > > --- a/tools/perf/util/pfm.c > > > > +++ b/tools/perf/util/pfm.c > > > > @@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > > > /*scale_unit=*/NULL, > > > > /*deprecated=*/NULL, "PFM event", > > > > info->desc, /*long_desc=*/NULL, > > > > - /*encoding_desc=*/buf->buf, > > > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > > > + /*encoding_desc=*/buf->buf); > > > > > > > > pfm_for_each_event_attr(j, info) { > > > > pfm_event_attr_info_t ainfo; > > > > @@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > > > /*scale_unit=*/NULL, > > > > /*deprecated=*/NULL, "PFM event", > > > > ainfo.desc, /*long_desc=*/NULL, > > > > - /*encoding_desc=*/buf->buf, > > > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > > > + /*encoding_desc=*/buf->buf); > > > > } > > > > } > > > > } > > > > -- > > > > 2.39.1 > > > > > > > > > > -- > > > > > > - Arnaldo > > -- > > - Arnaldo -- - Arnaldo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-08 13:44 ` Arnaldo Carvalho de Melo @ 2023-02-08 14:07 ` Arnaldo Carvalho de Melo 2023-02-15 14:17 ` PING " Thomas Richter 0 siblings, 1 reply; 9+ messages in thread From: Arnaldo Carvalho de Melo @ 2023-02-08 14:07 UTC (permalink / raw) To: Ian Rogers Cc: Thomas Richter, linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk Em Wed, Feb 08, 2023 at 10:44:10AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Feb 08, 2023 at 10:40:57AM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Tue, Feb 07, 2023 at 09:58:48PM -0800, Ian Rogers escreveu: > > > On Tue, Feb 7, 2023 at 7:02 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > > > > > Em Tue, Feb 07, 2023 at 03:04:47PM +0100, Thomas Richter escreveu: > > > > > I have downloaded linux-next and build the perf tool using > > > > > > > > > > # make LIBPFM4=1 > > > > > > > > > > to have libpfm4 support built into perf. The build fails: > > > > > > > > > > # make LIBPFM4=1 > > > > > > > > Ian, > > > > > > > > Can you please take a look? Should we go this way or have some > > > > feature test to check how that function signature should look? > > > > > > > > - Arnaldo > > > > > > Tested-by: Ian Rogers <irogers@google.com> > > > > > > Wrt tests, there is make_with_libpfm4 in tools/perf/tests/make. I realized I hadn't libbpf-devel installed on the machine I run 'make -C tools/perf build-test' :-\ Fixed. - Arnaldo > > I meant if we should support older versions or state that to build with > > libbpf we need to have the version with this new signature. > > I see, the signature change wasn't in libpfm, nevermind, testing now. > > - Arnaldo > > > I'll apply and test build it here. > > > > - Arnaldo > > > > > Thanks, > > > Ian > > > > > > > > .... > > > > > INSTALL libbpf_headers > > > > > CC util/pfm.o > > > > > util/pfm.c: In function ‘print_libpfm_event’: > > > > > util/pfm.c:189:9: error: too many arguments to function ‘print_cb->print_event’ > > > > > 189 | print_cb->print_event(print_state, > > > > > | ^~~~~~~~ > > > > > util/pfm.c:220:25: error: too many arguments to function ‘print_cb->print_event’ > > > > > 220 | print_cb->print_event(print_state, > > > > > > > > > > The build error is caused by > > > > > commit d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > > > > which changes the function prototype of > > > > > struct print_callbacks { > > > > > ... > > > > > void (*print_event)(...); --> last two parameters removed. > > > > > }; > > > > > > > > > > but does not adjust the usage of this function prototype in util/pfm.c. > > > > > In file util/pfm.c function print_event() is still invoked with 13 parameters > > > > > instead of 11. The compile fails. > > > > > > > > > > When I adjust the file util/pfm.c as in this patch, the build works file. > > > > > Please check this patch for correctness, I have just fixed the compile > > > > > issue. > > > > > > > > > > Fixes d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") > > > > > Cc: irogers@google.com > > > > > Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> > > > > > --- > > > > > tools/perf/util/pfm.c | 6 ++---- > > > > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c > > > > > index ac3227ba769c..b59ba825ddc9 100644 > > > > > --- a/tools/perf/util/pfm.c > > > > > +++ b/tools/perf/util/pfm.c > > > > > @@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > > > > /*scale_unit=*/NULL, > > > > > /*deprecated=*/NULL, "PFM event", > > > > > info->desc, /*long_desc=*/NULL, > > > > > - /*encoding_desc=*/buf->buf, > > > > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > > > > + /*encoding_desc=*/buf->buf); > > > > > > > > > > pfm_for_each_event_attr(j, info) { > > > > > pfm_event_attr_info_t ainfo; > > > > > @@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, > > > > > /*scale_unit=*/NULL, > > > > > /*deprecated=*/NULL, "PFM event", > > > > > ainfo.desc, /*long_desc=*/NULL, > > > > > - /*encoding_desc=*/buf->buf, > > > > > - /*metric_name=*/NULL, /*metric_expr=*/NULL); > > > > > + /*encoding_desc=*/buf->buf); > > > > > } > > > > > } > > > > > } > > > > > -- > > > > > 2.39.1 > > > > > > > > > > > > > -- > > > > > > > > - Arnaldo > > > > -- > > > > - Arnaldo > > -- > > - Arnaldo -- - Arnaldo ^ permalink raw reply [flat|nested] 9+ messages in thread
* PING Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-08 14:07 ` Arnaldo Carvalho de Melo @ 2023-02-15 14:17 ` Thomas Richter 2023-02-15 16:26 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 9+ messages in thread From: Thomas Richter @ 2023-02-15 14:17 UTC (permalink / raw) To: Arnaldo Carvalho de Melo, Ian Rogers Cc: linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk On 2/8/23 15:07, Arnaldo Carvalho de Melo wrote: > Em Wed, Feb 08, 2023 at 10:44:10AM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Wed, Feb 08, 2023 at 10:40:57AM -0300, Arnaldo Carvalho de Melo escreveu: >>> Em Tue, Feb 07, 2023 at 09:58:48PM -0800, Ian Rogers escreveu: >>>> On Tue, Feb 7, 2023 at 7:02 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: >>>>> >>>>> Em Tue, Feb 07, 2023 at 03:04:47PM +0100, Thomas Richter escreveu: >>>>>> I have downloaded linux-next and build the perf tool using >>>>>> >>>>>> # make LIBPFM4=1 >>>>>> >>>>>> to have libpfm4 support built into perf. The build fails: >>>>>> >>>>>> # make LIBPFM4=1 >>>>> >>>>> Ian, >>>>> >>>>> Can you please take a look? Should we go this way or have some >>>>> feature test to check how that function signature should look? >>>>> >>>>> - Arnaldo >>>> >>>> Tested-by: Ian Rogers <irogers@google.com> >>>> >>>> Wrt tests, there is make_with_libpfm4 in tools/perf/tests/make. > > I realized I hadn't libbpf-devel installed on the machine I run 'make -C > tools/perf build-test' :-\ Fixed. > > - Arnaldo > >>> I meant if we should support older versions or state that to build with >>> libbpf we need to have the version with this new signature. >> >> I see, the signature change wasn't in libpfm, nevermind, testing now. >> >> - Arnaldo >> >>> I'll apply and test build it here. >>> >>> - Arnaldo >>> >>>> Thanks, >>>> Ian >>>> >>>>>> .... >>>>>> INSTALL libbpf_headers >>>>>> CC util/pfm.o >>>>>> util/pfm.c: In function ‘print_libpfm_event’: >>>>>> util/pfm.c:189:9: error: too many arguments to function ‘print_cb->print_event’ >>>>>> 189 | print_cb->print_event(print_state, >>>>>> | ^~~~~~~~ >>>>>> util/pfm.c:220:25: error: too many arguments to function ‘print_cb->print_event’ >>>>>> 220 | print_cb->print_event(print_state, >>>>>> >>>>>> The build error is caused by >>>>>> commit d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") >>>>>> which changes the function prototype of >>>>>> struct print_callbacks { >>>>>> ... >>>>>> void (*print_event)(...); --> last two parameters removed. >>>>>> }; >>>>>> >>>>>> but does not adjust the usage of this function prototype in util/pfm.c. >>>>>> In file util/pfm.c function print_event() is still invoked with 13 parameters >>>>>> instead of 11. The compile fails. >>>>>> >>>>>> When I adjust the file util/pfm.c as in this patch, the build works file. >>>>>> Please check this patch for correctness, I have just fixed the compile >>>>>> issue. >>>>>> >>>>>> Fixes d9dc8874d6ce ("perf pmu-events: Remove now unused event and metric variables") >>>>>> Cc: irogers@google.com >>>>>> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> >>>>>> --- >>>>>> tools/perf/util/pfm.c | 6 ++---- >>>>>> 1 file changed, 2 insertions(+), 4 deletions(-) >>>>>> >>>>>> diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c >>>>>> index ac3227ba769c..b59ba825ddc9 100644 >>>>>> --- a/tools/perf/util/pfm.c >>>>>> +++ b/tools/perf/util/pfm.c >>>>>> @@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, >>>>>> /*scale_unit=*/NULL, >>>>>> /*deprecated=*/NULL, "PFM event", >>>>>> info->desc, /*long_desc=*/NULL, >>>>>> - /*encoding_desc=*/buf->buf, >>>>>> - /*metric_name=*/NULL, /*metric_expr=*/NULL); >>>>>> + /*encoding_desc=*/buf->buf); >>>>>> >>>>>> pfm_for_each_event_attr(j, info) { >>>>>> pfm_event_attr_info_t ainfo; >>>>>> @@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state, >>>>>> /*scale_unit=*/NULL, >>>>>> /*deprecated=*/NULL, "PFM event", >>>>>> ainfo.desc, /*long_desc=*/NULL, >>>>>> - /*encoding_desc=*/buf->buf, >>>>>> - /*metric_name=*/NULL, /*metric_expr=*/NULL); >>>>>> + /*encoding_desc=*/buf->buf); >>>>>> } >>>>>> } >>>>>> } >>>>>> -- >>>>>> 2.39.1 >>>>>> >>>>> >>>>> -- >>>>> >>>>> - Arnaldo >>> >>> -- >>> >>> - Arnaldo >> >> -- >> >> - Arnaldo > Friendly ping, is this already in linux-next? -- Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany -- Vorsitzender des Aufsichtsrats: Gregor Pillen Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: PING Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-15 14:17 ` PING " Thomas Richter @ 2023-02-15 16:26 ` Arnaldo Carvalho de Melo 2023-02-15 20:28 ` Stephen Rothwell 0 siblings, 1 reply; 9+ messages in thread From: Arnaldo Carvalho de Melo @ 2023-02-15 16:26 UTC (permalink / raw) To: Thomas Richter, Stephen Rothwell Cc: Ian Rogers, linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk Em Wed, Feb 15, 2023 at 03:17:44PM +0100, Thomas Richter escreveu: > Friendly ping, is this already in linux-next? To answer that, next time, please: $ git remote add linux-next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git $ git checkout -b linux-next-master linux-next/master $ git log -10 --no-merges --oneline tools/perf 8f46f36d81a6b4f5 mm: discard __GFP_ATOMIC 14292a4ae1a37a7c perf bpf: Avoid build breakage with libbpf < 0.8.0 + LIBBPF_DYNAMIC=1 f00eccb447762c99 perf build: Fix build error when NO_LIBBPF=1 213b760fbc69f2d6 perf tools: Don't install libtraceevent plugins as its not anymore in the kernel sources dce088ab0d51ae3b perf kmem: Support field "node" in evsel__process_alloc_event() coping with recent tracepoint restructuring b3719108ae60169e perf kmem: Support legacy tracepoints d891f2b724b39a2a perf build: Properly guard libbpf includes 6f9aba7f0d74e8dd perf tests bpf prologue: Fix bpf-script-test-prologue test compile issue with clang 481028dbf1daa280 (tag: perf-tools-fixes-for-v6.2-1-2023-01-06, tag: perf-tools-fixes-for-v6.1-1-2023-01-06) perf tools: Fix build on uClibc systems by adding missing sys/types.h include 54b353a20c7e8be9 perf stat: Fix handling of --for-each-cgroup with --bpf-counters to match non BPF mode $ So it isn't there, then: ⬢[acme@toolbox perf]$ git log --oneline -5 91621be65d6812cd (HEAD -> perf/core) perf record: Fix segfault with --overwrite and --max-size 37f322cd58d81a9d (quaco/perf/core, acme/tmp.perf/core) perf stat: Avoid merging/aggregating metric counts twice 6a5558f1166473f7 (seventh/perf/core, acme/perf/core) perf tools: Fix perf tool build error in util/pfm.c ffd1240e8f081426 perf tools: Fix auto-complete on aarch64 1bece1351c653c3d perf lock contention: Support old rw_semaphore type ⬢[acme@toolbox perf]$ It is in my perf/core branch for some time, so should've been in linux-next by now: ⬢[acme@toolbox perf]$ git show --pretty=fuller acme/perf/core | head commit 6a5558f1166473f741de33c32ffb161d7f7732cb Author: Thomas Richter <tmricht@linux.ibm.com> AuthorDate: Tue Feb 7 15:04:47 2023 +0100 Commit: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Wed Feb 8 11:07:47 2023 -0300 perf tools: Fix perf tool build error in util/pfm.c I have downloaded linux-next and build the perf tool using ⬢[acme@toolbox perf]$ In such cases please CC the linux-next maintainer: Stephen, can you please merge acme/perf/core into linux-next? - Arnaldo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: PING Re: [PATCH] tools/perf: Fix perf tool build error in util/pfm.c 2023-02-15 16:26 ` Arnaldo Carvalho de Melo @ 2023-02-15 20:28 ` Stephen Rothwell 0 siblings, 0 replies; 9+ messages in thread From: Stephen Rothwell @ 2023-02-15 20:28 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Richter, Stephen Rothwell, Ian Rogers, linux-kernel-next, linux-perf-users, hca, egorenar, gor, svens, sumanthk [-- Attachment #1: Type: text/plain, Size: 769 bytes --] Hi Arnaldo, On Wed, 15 Feb 2023 13:26:18 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > In such cases please CC the linux-next maintainer: > > Stephen, can you please merge acme/perf/core into linux-next? I currently fetch every day and merge git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git branches perf/urgent and perf/core (as you have asked me to in the past). In yesterday's linux-next release, the top of those branches were commits f883675bf652 ("Merge tag 'gpio-fixes-for-v6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux") and 6a5558f11664 ("perf tools: Fix perf tool build error in util/pfm.c") respectively. This latter one has not changed today. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-02-15 20:33 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-02-07 14:04 [PATCH] tools/perf: Fix perf tool build error in util/pfm.c Thomas Richter 2023-02-07 15:02 ` Arnaldo Carvalho de Melo 2023-02-08 5:58 ` Ian Rogers 2023-02-08 13:40 ` Arnaldo Carvalho de Melo 2023-02-08 13:44 ` Arnaldo Carvalho de Melo 2023-02-08 14:07 ` Arnaldo Carvalho de Melo 2023-02-15 14:17 ` PING " Thomas Richter 2023-02-15 16:26 ` Arnaldo Carvalho de Melo 2023-02-15 20:28 ` Stephen Rothwell
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).