Ser*_*tch 6 c++ profiling cmake debug-information perf
我试图perf在 Ubuntu 20.04 上进行配置,但问题是许多函数没有出现在其中(可能是因为它们是内联的),或者只出现它们的地址(没有名称等)。我正在使用 CMake 的RelWithDebInfo构建。但有一些模板函数我不知道如何将其引入分析器结果中。我认为noinline如果这在 C++ 中对于模板函数是合法的,那么标记它们可能会有所帮助,但这会破坏代码库并且需要针对每个函数完成。有什么建议如何noinline同时实现所有功能吗?
您可以添加-fno-inline到CMAKE_CXX_FLAGS.
来自GCC 手册页:
Run Code Online (Sandbox Code Playgroud)-fno-inline Do not expand any functions inline apart from those marked with the "always_inline" attribute. This is the default when not optimizing. Single functions can be exempted from inlining by marking them with the "noinline" attribute.
| 归档时间: |
|
| 查看次数: |
736 次 |
| 最近记录: |