Logging: use GCC #pragma to suppress the frame pointer
We have a few lambdas now. However, GCC probably inlines everything anyway in release mode, so this is likely moot. Change-Id: Ic15405335d804bdea761fffd16d50573621446ab Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
bd728d1149
commit
0c3ac95899
@ -1279,11 +1279,12 @@ void QMessagePattern::setPattern(const QString &pattern)
|
|||||||
*/
|
*/
|
||||||
static constexpr int TypicalBacktraceFrameCount = 8;
|
static constexpr int TypicalBacktraceFrameCount = 8;
|
||||||
|
|
||||||
#if (defined(Q_CC_GNU) || __has_attribute(optimize)) \
|
# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG)
|
||||||
&& !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
|
|
||||||
// force skipping the frame pointer, to save the backtrace() function some work
|
// force skipping the frame pointer, to save the backtrace() function some work
|
||||||
__attribute__((optimize("omit-frame-pointer")))
|
# pragma GCC push_options
|
||||||
|
# pragma GCC optimize ("omit-frame-pointer")
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
static QStringList backtraceFramesForLogMessage(int frameCount)
|
static QStringList backtraceFramesForLogMessage(int frameCount)
|
||||||
{
|
{
|
||||||
struct DecodedFrame {
|
struct DecodedFrame {
|
||||||
@ -1422,6 +1423,10 @@ static QString formatBacktraceForLogMessage(const QMessagePattern::BacktracePara
|
|||||||
|
|
||||||
return frames.join(backtraceSeparator);
|
return frames.join(backtraceSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG)
|
||||||
|
# pragma GCC pop_options
|
||||||
|
# endif
|
||||||
#endif // QLOGGING_HAVE_BACKTRACE && !QT_BOOTSTRAPPED
|
#endif // QLOGGING_HAVE_BACKTRACE && !QT_BOOTSTRAPPED
|
||||||
|
|
||||||
Q_GLOBAL_STATIC(QMessagePattern, qMessagePattern)
|
Q_GLOBAL_STATIC(QMessagePattern, qMessagePattern)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user