Re: [PATCH] kbuild: Add inline-account tool

From: Masahiro Yamada
Date: Sun Oct 22 2023 - 13:55:18 EST


On Sat, Oct 21, 2023 at 1:12 AM Andi Kleen <ak@xxxxxxxxxxxxxxx> wrote:
>
> A common cause of binary code bloat is excessive inlining. Traditional
> tools (like nm --size-sort -t d) don't address that directly because
> they only see the final functions, but don't know about inlines.
>
> This patch adds inline-account that makes it easy to track that down
> by accounting code bytes to all functions visible in the debug information,
> as well as code lines.
>
> Here are some examples:
>
> Show all inlines that increase code size by >1K in the core scheduler:
>
> $ inline-account.py --min-bytes=1000 kernel/sched/core.o



How to use this tool?

I did not get any output.




masahiro@zoe:~/workspace/linux-kbuild(a)$ ./scripts/inline-account.py
--min-bytes=1000 kernel/sched/core.o
Total code bytes seen 0

Code bytes by functions:
Function Total Avg Num

Code bytes by nearby source line blocks:
prefix
Line Total
masahiro@zoe:~/workspace/linux-kbuild(a)$ ./scripts/inline-account.py
kernel/sched/core.o
Total code bytes seen 0

Code bytes by functions:
Function Total Avg Num

Code bytes by nearby source line blocks:
prefix
Line Total
masahiro@zoe:~/workspace/linux-kbuild(a)$ ./scripts/inline-account.py
lib/maple_tree.o
Total code bytes seen 0

Code bytes by functions:
Function Total Avg Num

Code bytes by nearby source line blocks:
prefix
Line Total







I do not think this patch is mature enough
regarding the coding style.

Please polish the code.







--
Best Regards
Masahiro Yamada