Re: x86_64 Compiler Output Kernel Bloat v4.4

From: Mihai DonÈu
Date: Mon Jan 18 2016 - 17:12:21 EST


On Mon, 18 Jan 2016 14:45:48 -0700 Jeff Merkey wrote:
> On 1/18/16, Jeff Merkey <linux.mdb@xxxxxxxxx> wrote:
> > On 1/18/16, Jeff Merkey <linux.mdb@xxxxxxxxx> wrote:
> > > I noticed that in the assembler output for the x86_64 builds almost
> > > every single function originating from C code has a nop instruction
> > > that prefaces the function call. I guess the concern with this is
> > > the wasted space issue as each one of these placeholders takes up a
> > > bunch of bytes at the head of each function. Is there a reason this
> > > assembler header is there in the first place to anyones knowledge?
> > > Since every single function just about is prefaced by this inert 5
> > > byte instruction it adds up to quite a bit of bloat in the size of the
> > > linux executable.

If I'm not mistaking, those bytes are used to dynamically enable ftrace:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/trace/ftrace-design.txt

--
Mihai DonÈu