summaryrefslogtreecommitdiff
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorAlexandre Chartre <alexandre.chartre@oracle.com>2025-11-21 10:53:21 +0100
committerPeter Zijlstra <peterz@infradead.org>2025-11-21 15:30:10 +0100
commitfcb268b47a2f4a497fdb40ef24bb9e06488b7213 (patch)
tree1b33d6d5c0ac717905fc6ad75a5acc473ae3db80 /tools/objtool/check.c
parent70589843b36fee0c6e73632469da4e5fd11f0968 (diff)
objtool: Trace instruction state changes during function validation
During function validation, objtool maintains a per-instruction state, in particular to track call frame information. When tracing validation, print any instruction state changes. Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://patch.msgid.link/20251121095340.464045-12-alexandre.chartre@oracle.com
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 409dec9efb49..a02f8db75827 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3677,6 +3677,8 @@ static int validate_insn(struct objtool_file *file, struct symbol *func,
struct instruction *prev_insn, struct instruction *next_insn,
bool *dead_end)
{
+ /* prev_state is not used if there is no disassembly support */
+ struct insn_state prev_state __maybe_unused;
struct alternative *alt;
u8 visited;
int ret;
@@ -3785,7 +3787,11 @@ static int validate_insn(struct objtool_file *file, struct symbol *func,
if (skip_alt_group(insn))
return 0;
- if (handle_insn_ops(insn, next_insn, statep))
+ prev_state = *statep;
+ ret = handle_insn_ops(insn, next_insn, statep);
+ TRACE_INSN_STATE(insn, &prev_state, statep);
+
+ if (ret)
return 1;
switch (insn->type) {