Re: [RFC PATCH v2 00/17] objtool: Function validation tracing

From: Alexandre Chartre
Date: Wed Sep 24 2025 - 05:27:29 EST




On 9/24/25 00:33, Josh Poimboeuf wrote:
On Thu, Jun 19, 2025 at 04:56:42PM +0200, Alexandre Chartre wrote:
Hi,

Version v2 of this RFC addresses all comments from Josh and Peter,
in particular:

- add --disas option to disassemble functions
- do not fail the build if libopcodes is not available. Instead objtool
is then built without disassembly support. In that case, objtool prints
a warning message if trying to use disassembly.

Example:
$ ./tools/objtool/objtool --disas --link vmlinux.o
vmlinux.o: warning: objtool: Rebuild with libopcodes for disassembly support
- remove dbuffer
- rename VTRACE* to TRACE*
- add trace.[ch] for trace-related functions and macros

Sorry for the delay... this is looking really good. A few nits I saw
when testing:

1) With "make -s" I see

Auto-detecting system features:
... libbfd: [ on ]
... disassembler-init-styled: [ on ]

but I'm thinking that should be completely silent?


2) Also seeing an oddity with --trace:

$ OBJTOOL_ARGS='--trace=shrink_node' make -s -j12 mm/vmscan.o
shrink_node: validation begin
12440: shrink_node push %rbp - - statecfa=rsp+16 rbp=(cfa-16) stack_size=16
12440: shrink_node push %rbp
12441: shrink_node+0x1 mov %rsp,%rbp - - statecfa=rbp+16
12441: shrink_node+0x1 mov %rsp,%rbp

For the instructions which have unwinding state changes, it's printing
them twice. Also the formatting looks a little off (two dashes;
"statecfa").


Thanks for all comments, I will address them and also resync the code.

alex.