12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- From 480ba2b14a7cdede78579df6fb8c3937574a2b05 Mon Sep 17 00:00:00 2001
- From: huxin <wb-hx963136@alibaba-inc.com>
- Date: Tue, 29 Nov 2022 04:17:55 +0800
- Subject: [PATCH] Fix too few arguments to function 'init_disassemble_info'
- error when compile perf
- ---
- tools/perf/util/annotate.c | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
- diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
- index 308189454788..6ab9a5c6f651 100644
- --- a/tools/perf/util/annotate.c
- +++ b/tools/perf/util/annotate.c
- @@ -1684,6 +1684,18 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
- #define PACKAGE "perf"
- #include <bfd.h>
- #include <dis-asm.h>
- +
- +static int fprintf_styled(void *a, enum disassembler_style b, const char* fmt, ...)
- +{
- + va_list args;
- + int r;
- +
- + va_start(args, fmt);
- + r = vprintf(fmt, args);
- + va_end(args);
- +
- + return r;
- +}
-
- static int symbol__disassemble_bpf(struct symbol *sym,
- struct annotate_args *args)
- @@ -1727,7 +1739,8 @@ static int symbol__disassemble_bpf(struct symbol *sym,
- goto out;
- }
- init_disassemble_info(&info, s,
- - (fprintf_ftype) fprintf);
- + (fprintf_ftype) fprintf,
- + fprintf_styled);
-
- info.arch = bfd_get_arch(bfdf);
- info.mach = bfd_get_mach(bfdf);
- --
- 2.17.1
|