diff options
author | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-04-19 00:27:49 +0300 |
---|---|---|
committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-05-16 16:31:52 +0300 |
commit | ced23d2e3762ecfb859ae65d3a351218edff7205 (patch) | |
tree | 4ec4026d8c611285babba1b67a7b1bd1bfa31bc8 /tools/objtool/include | |
parent | ca653464dd097fe64e69f1735e9f348b2a0f8037 (diff) | |
download | linux-ced23d2e3762ecfb859ae65d3a351218edff7205.tar.xz |
objtool: Include backtrace in verbose mode
Include backtrace in verbose mode. This makes it easy to gather all the
information needed for diagnosing objtool warnings.
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Link: https://lore.kernel.org/r/c255224fabcf7e64bac232fec1c77c9fc2d7d7ab.1681853186.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/include')
-rw-r--r-- | tools/objtool/include/objtool/warn.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h index f195deab456e..ac04d3fe4dd9 100644 --- a/tools/objtool/include/objtool/warn.h +++ b/tools/objtool/include/objtool/warn.h @@ -63,12 +63,14 @@ static inline char *offstr(struct section *sec, unsigned long offset) _insn->sym->warned = 1; \ }) -#define BT_FUNC(format, insn, ...) \ -({ \ - struct instruction *_insn = (insn); \ - char *_str = offstr(_insn->sec, _insn->offset); \ - WARN(" %s: " format, _str, ##__VA_ARGS__); \ - free(_str); \ +#define BT_INSN(insn, format, ...) \ +({ \ + if (opts.verbose || opts.backtrace) { \ + struct instruction *_insn = (insn); \ + char *_str = offstr(_insn->sec, _insn->offset); \ + WARN(" %s: " format, _str, ##__VA_ARGS__); \ + free(_str); \ + } \ }) #define WARN_ELF(format, ...) \ |