summaryrefslogtreecommitdiff
path: root/tools/objtool/include
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/include
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/include')
-rw-r--r--tools/objtool/include/objtool/trace.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/objtool/include/objtool/trace.h b/tools/objtool/include/objtool/trace.h
index 3f3c830ed114..33fe9c6acb4f 100644
--- a/tools/objtool/include/objtool/trace.h
+++ b/tools/objtool/include/objtool/trace.h
@@ -30,6 +30,12 @@ extern int trace_depth;
} \
})
+#define TRACE_INSN_STATE(insn, sprev, snext) \
+({ \
+ if (trace) \
+ trace_insn_state(insn, sprev, snext); \
+})
+
static inline void trace_enable(void)
{
trace = true;
@@ -53,10 +59,14 @@ static inline void trace_depth_dec(void)
trace_depth--;
}
+void trace_insn_state(struct instruction *insn, struct insn_state *sprev,
+ struct insn_state *snext);
+
#else /* DISAS */
#define TRACE(fmt, ...) ({})
#define TRACE_INSN(insn, fmt, ...) ({})
+#define TRACE_INSN_STATE(insn, sprev, snext) ({})
static inline void trace_enable(void) {}
static inline void trace_disable(void) {}