mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Chartre <alexandre.chartre@oracle.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: alexandre.chartre@oracle.com, linux-kernel@vger.kernel.org,
	mingo@kernel.org, peterz@infradead.org
Subject: Re: [RFC 00/13] objtool: Function validation tracing
Date: Wed, 11 Jun 2025 08:00:32 +0200	[thread overview]
Message-ID: <7e803ed0-60ac-4d5e-a039-904c3fba8e80@oracle.com> (raw)
In-Reply-To: <iutvcrog7abyz2ski5fhcfzikc54b2gwodsds2gmovutahapg4@5rk4o4b7eajz>


On 6/10/25 23:05, Josh Poimboeuf wrote:
> On Tue, Jun 10, 2025 at 03:00:50PM +0200, Alexandre Chartre wrote:
>> Here is the patch to handle both old and new binutils versions:
>>
>> 8<------------------------------------------------------------------->8
>> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
>> index 00350fc7c662..91a2858fea14 100644
>> --- a/tools/objtool/Makefile
>> +++ b/tools/objtool/Makefile
>> @@ -7,6 +7,11 @@ srctree := $(patsubst %/,%,$(dir $(CURDIR)))
>>   srctree := $(patsubst %/,%,$(dir $(srctree)))
>>   endif
>> +FEATURE_USER = .objtool
>> +FEATURE_TESTS = disassembler-init-styled
>> +FEATURE_DISPLAY = disassembler-init-styled
>> +include $(srctree)/tools/build/Makefile.feature
> 
> Thanks, that worked.
> 
> That Makefile.feature thing is nice (except it prints an annoying
> newline on every build after the first one).
> 
> Can we also use that to determine if binutils-devel (or binutils-dev or
> whatever) is installed, and then make the build of disas.c optional?

This would probably require a new feature test, I will look at it.

> Then if somebody tries to use '--trace', it could tell them to install
> the binutils development package and rebuild objtool.  That way we don't
> disrupt everybody's kernel build for a feature they probably won't use.
> 
> That would also mean disas_warned_funcs() would be disabled on missing
> binutils-devel.  But I think that's probably fine.  In fact that will
> now have less reason for existing now that we have this tracing.  Maybe
> we won't need it at all.
> 

We can also fall back to using objdump if binutils-devel is not there.

And thanks for all the other comments, I will address them and resubmit. I am
also adding the "disas" option.

alex.


  reply	other threads:[~2025-06-11  6:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06 15:34 Alexandre Chartre
2025-06-06 15:34 ` [RFC 01/13] objtool: Move disassembly functions to a separated file Alexandre Chartre
2025-06-06 15:34 ` [RFC 02/13] objtool: Create disassembly context Alexandre Chartre
2025-06-10 21:12   ` Josh Poimboeuf
2025-06-06 15:34 ` [RFC 03/13] objtool: Disassemble code with libopcodes instead of running objdump Alexandre Chartre
2025-06-10 21:22   ` Josh Poimboeuf
2025-06-11 12:23   ` Peter Zijlstra
2025-06-11 13:35     ` Alexandre Chartre
2025-06-11 19:25       ` Josh Poimboeuf
2025-06-06 15:34 ` [RFC 04/13] objtool: Print symbol during disassembly Alexandre Chartre
2025-06-10 21:55   ` Josh Poimboeuf
2025-06-06 15:34 ` [RFC 05/13] objtool: Store instruction disassembly result Alexandre Chartre
2025-06-10 22:40   ` Josh Poimboeuf
2025-06-06 15:34 ` [RFC 06/13] objtool: Disassemble instruction on warning or backtrace Alexandre Chartre
2025-06-06 15:34 ` [RFC 07/13] objtool: Extract code to validate instruction from the validate branch loop Alexandre Chartre
2025-06-10 23:31   ` Josh Poimboeuf
2025-06-06 15:34 ` [RFC 08/13] objtool: Record symbol name max length Alexandre Chartre
2025-06-06 15:34 ` [RFC 09/13] objtool: Add option to trace function validation Alexandre Chartre
2025-06-11  0:48   ` Josh Poimboeuf
2025-06-06 15:34 ` [RFC 10/13] objtool: Trace instruction state changes during " Alexandre Chartre
2025-06-11  1:23   ` Josh Poimboeuf
2025-06-06 15:34 ` [RFC 11/13] objtool: Improve register reporting " Alexandre Chartre
2025-06-06 15:34 ` [RFC 12/13] objtool: Improve tracing of alternative instructions Alexandre Chartre
2025-06-06 15:34 ` [RFC 13/13] objtool: Do not validate IBT for .return_sites and .call_sites Alexandre Chartre
2025-06-06 15:58 ` [RFC 00/13] objtool: Function validation tracing Josh Poimboeuf
2025-06-06 19:29   ` Alexandre Chartre
2025-06-09 18:31 ` Josh Poimboeuf
2025-06-10  7:07   ` Alexandre Chartre
2025-06-10 13:00     ` Alexandre Chartre
2025-06-10 21:05       ` Josh Poimboeuf
2025-06-11  6:00         ` Alexandre Chartre [this message]
2025-06-11 14:20           ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e803ed0-60ac-4d5e-a039-904c3fba8e80@oracle.com \
    --to=alexandre.chartre@oracle.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®