[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <173145729034.2747044.453926054000880254.stgit@mhiramat.roam.corp.google.com>
Date: Wed, 13 Nov 2024 09:21:30 +0900
From: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Dima Kogan <dima@...retsauce.net>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v3 2/2] perf disasm: Fix compilation error with stubs
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
Commit 333ea1451083 ("perf disasm: Define stubs for the LLVM and capstone
disassemblers") introduces stubs but that causes compilation errors when
LIBCAPSTONE=n or LIBLLVM=n. This fixes those errors.
Fixes: 333ea1451083 ("perf disasm: Define stubs for the LLVM and capstone disassemblers")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
---
tools/perf/util/disasm.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index df6c172c9c7f..88f71f6e5e70 100644
--- a/tools/perf/util/disasm.c
+++ b/tools/perf/util/disasm.c
@@ -1422,14 +1422,14 @@ read_symbol(const char *filename, struct map *map, struct symbol *sym,
free(buf);
return NULL;
}
-#else // defined(HAVE_LIBCAPSTONE_SUPPORT) || defined(HAVE_LIBLLVM_SUPPORT)
+#endif // defined(HAVE_LIBCAPSTONE_SUPPORT) || defined(HAVE_LIBLLVM_SUPPORT)
+
static void symbol__disassembler_missing(const char *disassembler, const char *filename,
struct symbol *sym)
{
pr_debug("The %s disassembler isn't linked in for %s in %s\n",
disassembler, sym->name, filename);
}
-#endif
#ifdef HAVE_LIBCAPSTONE_SUPPORT
static void print_capstone_detail(cs_insn *insn, char *buf, size_t len,
@@ -1724,7 +1724,8 @@ static int symbol__disassemble_capstone(char *filename, struct symbol *sym,
}
#else // HAVE_LIBCAPSTONE_SUPPORT
static int symbol__disassemble_capstone(char *filename, struct symbol *sym,
- struct annotate_args *args)
+ struct annotate_args *args __maybe_unused)
+{
symbol__disassembler_missing("capstone", filename, sym);
return -1;
}
Powered by blists - more mailing lists