]> Git Repo - linux.git/commitdiff
perf tools: Fix perf tool build error in util/pfm.c
authorThomas Richter <[email protected]>
Tue, 7 Feb 2023 14:04:47 +0000 (15:04 +0100)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 8 Feb 2023 14:07:47 +0000 (11:07 -0300)
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 d9dc8874d6ce46cc ("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: d9dc8874d6ce46cc ("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]>
tools/perf/util/pfm.c

index ac3227ba769c66ad6674af287b66801222b2a844..b59ba825ddc96f54e9914d74086612e41e620bca 100644 (file)
@@ -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);
                }
        }
 }
This page took 0.065792 seconds and 4 git commands to generate.