Skip to content

Commit 6a5558f

Browse files
Thomas Richteracmel
authored andcommitted
perf tools: Fix perf tool build error in util/pfm.c
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 d9dc887 ("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: d9dc887 ("perf pmu-events: Remove now unused event and metric variables") Signed-off-by: Thomas Richter <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Tested-by: Ian Rogers <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Sumanth Korikkar <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ffd1240 commit 6a5558f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/perf/util/pfm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
193193
/*scale_unit=*/NULL,
194194
/*deprecated=*/NULL, "PFM event",
195195
info->desc, /*long_desc=*/NULL,
196-
/*encoding_desc=*/buf->buf,
197-
/*metric_name=*/NULL, /*metric_expr=*/NULL);
196+
/*encoding_desc=*/buf->buf);
198197

199198
pfm_for_each_event_attr(j, info) {
200199
pfm_event_attr_info_t ainfo;
@@ -224,8 +223,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
224223
/*scale_unit=*/NULL,
225224
/*deprecated=*/NULL, "PFM event",
226225
ainfo.desc, /*long_desc=*/NULL,
227-
/*encoding_desc=*/buf->buf,
228-
/*metric_name=*/NULL, /*metric_expr=*/NULL);
226+
/*encoding_desc=*/buf->buf);
229227
}
230228
}
231229
}

0 commit comments

Comments
 (0)