From 4f4af6262a7cf87fe3658116526bf6db18aa9e96 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 30 Aug 2017 12:14:37 +0800 Subject: [PATCH] doc/dev/perf: add doc on disabling -fomit-frame-pointer Signed-off-by: Kefu Chai --- doc/dev/perf.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/dev/perf.rst b/doc/dev/perf.rst index 5e42255a6e282..57742eec4ca02 100644 --- a/doc/dev/perf.rst +++ b/doc/dev/perf.rst @@ -20,6 +20,22 @@ To view by callee (where you can see who calls each top function):: :note: If the caller/callee views look the same you may be suffering from a kernel bug; upgrade to 4.8 or later. +Common Issues +------------- + +Ceph use `RelWithDebInfo` as its default `CMAKE_BUILD_TYPE`. Hence `-O2 -g` is +used to compile the tree in this case. And the `-O2` optimization level +enables `-fomit-frame-pointer` by default. But this prevents stack profilers +from accessing the complete stack information. So one can disable this option +when launching `cmake` :: + + cmake -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer" + +or when building the tree:: + + make CMAKE_CXX_FLAGS="-fno-omit-frame-pointer" + + Flamegraphs ----------- -- 2.39.5