Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不了解 gprof 关于如何编译程序以使用 gprof 进行分析的文档。在g ++中,是否需要在-g选项之外使用选项(调试信息)进行编译-pg。在每种情况下,我都会得到不同的结果,我想看看我的应用程序中的瓶颈在哪里,而不是在调试模式下,编译器忽略了许多优化(例如内联)
-g
-pg
文档显示您可以执行任一操作,并指出您需要 -g 进行逐行分析。因此,如果您想在发布条件下进行分析,并且可以接受不逐行执行,那么您应该能够在没有 -g 的情况下进行编译。