MacOS 10.6 上的 gprof,带有 c++程序有调用数据但没有计时数据——为什么?

发布于 2024-10-08 11:02:46 字数 3579 浏览 0 评论 0原文

我有一个在 MacOS 10.6 上运行的 C++ 单线程程序。它获取呼叫计数,但不获取时间信息。

这是输出的示例:

            0.00        0.00       9/31377020     __ZNSaISsEC1Ev [454]
            0.00        0.00       9/31377020     __ZNSaISsED1Ev [314]
            0.00        0.00       9/31377020     __Z12banner_stampRSt14basic_ofstreamIcSt11char_traitsIcEE [3960]
            0.00        0.00       9/31377020     __ZStorSt13_Ios_OpenmodeS_ [14555]
            0.00        0.00       9/31377020     __ZNSaIP13ifstream_lineEC1Ev [497]
            0.00        0.00       9/31377020     __ZNSaIP13ifstream_lineED1Ev [321]
            0.00        0.00       9/31377020     __ZNSt6vectorISsSaISsEE5beginEv [511]
            0.00        0.00       9/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EEC1ERKS2_ [510]
            0.00        0.00       9/31377020     __ZNSt6vectorISsSaISsEEC1ERKS0_ [512]
            0.00        0.00       9/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EED1Ev [404]
            0.00        0.00       9/31377020     __ZNSt6vectorISsSaISsEED1Ev [405]
            0.00        0.00     144/31377020     __ZNK9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEdeEv [9475]
            0.00        0.00     144/31377020     __ZN9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEppEi [327]
            0.00        0.00     144/31377020     __ZSt4findIN9__gnu_cxx17__normal_iteratorIPP13ifstream_lineSt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_ [296]
            0.00        0.00     144/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPS1_S3_EE [251]
            0.00        0.00     144/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE9push_backERKS1_ [316]
            0.00        0.00     144/31377020     __ZNSt6vectorISsSaISsEE9push_backERKSs [317]
            0.00        0.00     153/31377020     __ZNSt6vectorISsSaISsEE3endEv [312]
            0.00        0.00     153/31377020     __ZN9__gnu_cxxneIPSsSt6vectorISsSaISsEEEEbRKNS_17__normal_iteratorIT_T0_EESA_ [294]
            0.00        0.00     153/31377020     __ZN13ifstream_lineC1EPKc [4844]
            0.00        0.00     153/31377020     __ZN13ifstream_lineD0Ev [4845]
            0.00        0.00     162/31377020     __ZN16feature_recorder13fname_counterEiSs [229]
            0.00        0.00  442461/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EEixEm [12736]
            0.00        0.00  442479/31377020     __ZNKSt6vectorIP13ifstream_lineSaIS1_EE4sizeEv [10022]
            0.00        0.00  442605/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE5beginEv [113]
            0.00        0.00  442605/31377020     __ZN13ifstream_line8nextlineEv [112]
            0.00        0.00  442704/31377020     __ZStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_ [14535]
            0.00        0.00 6816415/31377020     __ZN9__gnu_cxx17__normal_iteratorIPP13ifstream_lineSt6vectorIS2_SaIS2_EEEppEi [92]
            0.00        0.00 7258876/31377020     __ZN9__gnu_cxxneIPP13ifstream_lineSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_ [87]
            0.00        0.00 7259020/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE3endEv [91]
            0.00        0.00 7828118/31377020     __ZNK9__gnu_cxx17__normal_iteratorIPP13ifstream_lineSt6vectorIS2_SaIS2_EEEdeEv [9445] [86]      
     0.0    0.00        0.00 31377020         __ZN16feature_recorder9recombineEv [86]
            0.00        0.00       9/57          __ZN20feature_recorder_set13recombine_allEv [384]

很奇怪,是吗? 31,377,020 通电话,但记录时间为 0。

有人知道发生了什么事吗?

I have a C++ single-threaded program running on MacOS 10.6. It's getting call counts but not time information.

Here's an example of the output:

            0.00        0.00       9/31377020     __ZNSaISsEC1Ev [454]
            0.00        0.00       9/31377020     __ZNSaISsED1Ev [314]
            0.00        0.00       9/31377020     __Z12banner_stampRSt14basic_ofstreamIcSt11char_traitsIcEE [3960]
            0.00        0.00       9/31377020     __ZStorSt13_Ios_OpenmodeS_ [14555]
            0.00        0.00       9/31377020     __ZNSaIP13ifstream_lineEC1Ev [497]
            0.00        0.00       9/31377020     __ZNSaIP13ifstream_lineED1Ev [321]
            0.00        0.00       9/31377020     __ZNSt6vectorISsSaISsEE5beginEv [511]
            0.00        0.00       9/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EEC1ERKS2_ [510]
            0.00        0.00       9/31377020     __ZNSt6vectorISsSaISsEEC1ERKS0_ [512]
            0.00        0.00       9/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EED1Ev [404]
            0.00        0.00       9/31377020     __ZNSt6vectorISsSaISsEED1Ev [405]
            0.00        0.00     144/31377020     __ZNK9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEdeEv [9475]
            0.00        0.00     144/31377020     __ZN9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEppEi [327]
            0.00        0.00     144/31377020     __ZSt4findIN9__gnu_cxx17__normal_iteratorIPP13ifstream_lineSt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_ [296]
            0.00        0.00     144/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPS1_S3_EE [251]
            0.00        0.00     144/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE9push_backERKS1_ [316]
            0.00        0.00     144/31377020     __ZNSt6vectorISsSaISsEE9push_backERKSs [317]
            0.00        0.00     153/31377020     __ZNSt6vectorISsSaISsEE3endEv [312]
            0.00        0.00     153/31377020     __ZN9__gnu_cxxneIPSsSt6vectorISsSaISsEEEEbRKNS_17__normal_iteratorIT_T0_EESA_ [294]
            0.00        0.00     153/31377020     __ZN13ifstream_lineC1EPKc [4844]
            0.00        0.00     153/31377020     __ZN13ifstream_lineD0Ev [4845]
            0.00        0.00     162/31377020     __ZN16feature_recorder13fname_counterEiSs [229]
            0.00        0.00  442461/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EEixEm [12736]
            0.00        0.00  442479/31377020     __ZNKSt6vectorIP13ifstream_lineSaIS1_EE4sizeEv [10022]
            0.00        0.00  442605/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE5beginEv [113]
            0.00        0.00  442605/31377020     __ZN13ifstream_line8nextlineEv [112]
            0.00        0.00  442704/31377020     __ZStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_ [14535]
            0.00        0.00 6816415/31377020     __ZN9__gnu_cxx17__normal_iteratorIPP13ifstream_lineSt6vectorIS2_SaIS2_EEEppEi [92]
            0.00        0.00 7258876/31377020     __ZN9__gnu_cxxneIPP13ifstream_lineSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_ [87]
            0.00        0.00 7259020/31377020     __ZNSt6vectorIP13ifstream_lineSaIS1_EE3endEv [91]
            0.00        0.00 7828118/31377020     __ZNK9__gnu_cxx17__normal_iteratorIPP13ifstream_lineSt6vectorIS2_SaIS2_EEEdeEv [9445] [86]      
     0.0    0.00        0.00 31377020         __ZN16feature_recorder9recombineEv [86]
            0.00        0.00       9/57          __ZN20feature_recorder_set13recombine_allEv [384]

Pretty weird, huh? 31,377,020 calls through, but 0 time recorded.

Anybody know what's going on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谈情不如逗狗 2024-10-15 11:02:46

我前段时间听说 gprof 在 Snow Leopard 上无法正常工作,并且症状就像您所描述的那样。如果您找不到解决方案,那么您可以尝试其他分析器,例如 shark

I have heard some time ago that gprof did not work correctly on Snow Leopard and symptoms were like you described. If you find no solution then you may try out some other profiler like shark.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文