summaryrefslogtreecommitdiff
path: root/tools/objtool/orc_gen.c
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/orc_gen.c
parent27d000d635ce48b579988e9b3240352a2a0306e0 (diff)
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/orc_gen.c')
-rw-r--r--tools/objtool/orc_gen.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index b327f9ccfe73..48efd1e2f00d 100644
--- a/tools/objtool/orc_gen.c
+++ b/tools/objtool/orc_gen.c
@@ -47,8 +47,7 @@ static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi,
orc->type = ORC_TYPE_REGS_PARTIAL;
break;
default:
- WARN_FUNC("unknown unwind hint type %d",
- insn->sec, insn->offset, cfi->type);
+ WARN_INSN(insn, "unknown unwind hint type %d", cfi->type);
return -1;
}
@@ -80,8 +79,7 @@ static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi,
orc->sp_reg = ORC_REG_DX;
break;
default:
- WARN_FUNC("unknown CFA base reg %d",
- insn->sec, insn->offset, cfi->cfa.base);
+ WARN_INSN(insn, "unknown CFA base reg %d", cfi->cfa.base);
return -1;
}
@@ -96,8 +94,7 @@ static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi,
orc->bp_reg = ORC_REG_BP;
break;
default:
- WARN_FUNC("unknown BP base reg %d",
- insn->sec, insn->offset, bp->base);
+ WARN_INSN(insn, "unknown BP base reg %d", bp->base);
return -1;
}