2010-12-19 1 views
1

MacOS 10.6에서 실행되는 C++ 단일 스레드 프로그램이 있습니다. 그것은 콜 카운트를 얻지 만 시간 정보는 얻지 못합니다. 응,MacOS 10.6에서 gprof가 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 시간이 기록되었습니다.

아무도 모르게됩니다.

+0

vy32, 알고 계십니까, gprof가 10.5를 작동합니까? – osgx

+0

거기 http://stackoverflow.com/questions/1101545/problem-with-gprof-on-os-x-program-is-not-of-the-host-architecture는 의견입니다 "업데이트 : 그것은 마치 gprof 최신 개발자 도구를 사용하여 Mac OS X 10.6 (Snow Leopard)에서 작업 중입니다. " 최신 DevTools를 사용하십니까? – osgx

+0

예, 최신 devtools가 있습니다. 감사. – vy32

답변

2

스노우 레오파드에서 gprof가 올바르게 작동하지 않는다고 들었습니다. 증상은 설명 된 것과 같습니다. 해결책이 없다면 shark과 같은 다른 프로파일 러를 사용해보십시오.

+0

나는 상어와 다른 개발 도구를 시험해 보았다. 누출은 매력 이었지만, 다른 것들은 쓸모없는 것으로 밝혀졌습니다. – vy32

+0

vy32,'shark'은 다소 강력합니다 – osgx

+0

gprof와 같은 유용한 콜 트리를 제공 할 수는 있습니다. 예, 실행중인 프로그램의 프로필을 작성할 수 있습니다. 그러나 직접 호출 추적이 아닌 샘플링을 통해 수행합니다. – vy32

관련 문제