summaryrefslogtreecommitdiffstats
path: root/tools/objtool/include
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2023-04-12 12:03:17 -0700
committerPeter Zijlstra <peterz@infradead.org>2023-04-14 16:08:28 +0200
commit246b2c85487a7bc5f6a09098e18a96506b1b55df (patch)
tree86736688a0958d0524f121e4f0d0b4025a0ac1a1 /tools/objtool/include
parent27d000d635ce48b579988e9b3240352a2a0306e0 (diff)
downloadlinux-246b2c85487a7bc5f6a09098e18a96506b1b55df.tar.gz
linux-246b2c85487a7bc5f6a09098e18a96506b1b55df.tar.bz2
linux-246b2c85487a7bc5f6a09098e18a96506b1b55df.zip
objtool: Add WARN_INSN()
It's easier to use and also gives easy access to the instruction's containing function, which is useful for printing that function's symbol. It will also be useful in the future for rate-limiting and disassembly of warned functions. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/2eaa3155c90fba683d8723599f279c46025b75f3.1681325924.git.jpoimboe@kernel.org
Diffstat (limited to 'tools/objtool/include')
-rw-r--r--tools/objtool/include/objtool/warn.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
index a3e79ae75f2e..b1c920dc9516 100644
--- a/tools/objtool/include/objtool/warn.h
+++ b/tools/objtool/include/objtool/warn.h
@@ -53,6 +53,11 @@ static inline char *offstr(struct section *sec, unsigned long offset)
free(_str); \
})
+#define WARN_INSN(insn, format, ...) \
+({ \
+ WARN_FUNC(format, insn->sec, insn->offset, ##__VA_ARGS__); \
+})
+
#define BT_FUNC(format, insn, ...) \
({ \
struct instruction *_insn = (insn); \