Re: [RFC][PATCH 00/36] objtool: Make recordmcount a subcommand

From: Julien Thierry
Date: Tue Apr 14 2020 - 10:17:56 EST




On 4/14/20 2:35 PM, Steven Rostedt wrote:
On Tue, 14 Apr 2020 08:24:15 +0100
Julien Thierry <jthierry@xxxxxxxxxx> wrote:

If all you need from objtool it the elf parsing code, wouldn't it make
more sense to move that out of objtool, as a utility library that both
objtool and recordmcount could use (and perhaps other tools in the future?)

In patch 3 you seem to mention that other tools already have their own
code to parse elf. So instead of converting everything as an objtool
subcommand, maybe just have the library with the required functionality.

Any opinions on the above? What do people prefer?

I think we discussed this before (and originally that was the plan), but I
believe one of the goals for bringing recordmcount into objtool is to speed
up the processing. Instead of having to read the elf sections for each use
case, we do it once, and then execute all the necessary operations for that
build.

If we just have a elf parsing library, then each object file is going to
have that read redundantly for each operation that is done on it.

I was hoping to have objtool handle all the operations needed that required
reading elf headers.


That makes sense, however, having each operation as an objtool subcommand doesn't solve that issue, right? Each invocation of objtool will re-read the elf object.

I guess having all the relevant code in objtool as subcommand would be a first step towards that goal.

But if that's not what objtool maintainers want, then we can certainly go
back to looking at pulling out the elf headers, and have each tool be a
standalone again.


I'm no maintainer nor know their feeling about this and I haven't been part of the initial discussion. My main concern was about the approach of moving existing subcommand code to arch specific folders.

Thanks for the explanations.

Cheers,

--
Julien Thierry