Re: F37 proposal: Add -fno-omit-frame-pointer to default compilation flags (System-Wide Change proposal)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/17/22 06:55, Kevin Kofler via devel wrote:
> Ben Cotton wrote (on behalf of Daan De Meyer, Davide Cavalca, Andrii 
> Nakryiko):
> 
>> Fedora will add -fno-omit-frame-pointer to the default C/C++
>> compilation flags, which will improve the effectiveness of profiling
>> and debugging tools.
> […]
>> Any performance or efficiency work relies on accurate profiling data.
> 
> So, you propose to destroy programs' performance in order to allow people to 
> more easily improve programs' performance? That strikes me as a particularly 
> bad idea.

A much better solution would be to enhance perf to run the unwinder in
user mode.  The whole reason that this is even a tradeoff is because
perf does unwinding in kernel mode, and a kernel-mode DWARF parser
is an terrible idea for security reasons.

> The profiling data collected with -fno-omit-frame-pointer will also not be 
> accurate for when the software is compiled with the default (under -O2 and 
> above) -fomit-frame-pointer. (In particular, the cost of shorter functions 
> will be significantly higher (in relation to the total) with the frame 
> pointer than with omitted frame pointer.) So it can actually lead to the 
> software getting tuned only for the Fedora build configuration.
> 
> In addition, the frame pointer also increases code size (though, to be fair, 
> the asynchronous unwind tables that we usually want for code compiled with 
> -fomit-frame-pointer also take space).
> 
>> Sampling profilers probe the target program's call stack at regular
>> intervals and store the stack traces. If we collect enough of them, we
>> can closely approximate the real cost of a library or function with
>> minimal runtime overhead.
> 
> Sampling profilers are fast, but will never reach the accuracy of Valgrind 
> (which, as far as I know, can deal with DWARF unwinding just fine).
> 
>         Kevin Kofler

Valgrind is not helpful for profiling production workloads.  It is
too slow and will not provide an accurate indication of where the
time is being spent.  That requires a sampling profiler.
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux