Re: [PATCH] x86: Use -m-omit-leaf-frame-pointer to shrink textsize

From: Jan Beulich
Date: Fri Dec 16 2011 - 06:46:14 EST


>>> On 16.12.11 at 10:23, Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
> On 12/16/2011 12:53 AM, Ingo Molnar wrote:
>> * Ingo Molnar <mingo@xxxxxxx> wrote:
>>
>>> [...]
>>>
>>> The call-chains are still intact for quality backtraces and
>>> for call-chain profiling (perf record -g), as the backtrace
>>> walker can deduct the full backtrace from the RIP of a leaf
>>> function and the parent chain.

Are you sure about that even if the leaf function uses rBP for a
different purpose?

>> Hm, noticed one complication while looking at annotated assembly
>> code in perf top. Code doing function calls from within asm() is
>> incorrectly marked 'leaf' by GCC:
>>
>> ffffffff812b82d8 <arch_local_save_flags>:
>> ffffffff812b82d8: ff 14 25 00 d9 c1 81 callq *0xffffffff81c1d900
>> ffffffff812b82df: c3 retq
>>
>> So all the paravirt details will have to be fixed, so that GCC
>> is able to see that there's a real function call done inside.
>> Jeremy, Konrad?

If the above is not a problem, wouldn't this simply result in a skipped
function layer?

Also, iirc it's not just pv-ops that uses calls within asm()-s.

> Um. So the issue is that a function that contains only pvops looks like
> it's a leaf to gcc and it does some leaf-function optimisation?
>
> How can we tell gcc the asm contains a call, or otherwise suppress the
> "leaf function" classification?

I'm afraid you can't without adding code (i.e. a dummy function call).

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/