如何获得使用gcc编译代码和ARM Cortex A8目标的调用图分析? [英] How to get call graph profiling working with gcc compiled code and ARM Cortex A8 target?

查看:340
本文介绍了如何获得使用gcc编译代码和ARM Cortex A8目标的调用图分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要在ARM板上进行性能分析,并需要查看调用图。我尝试过使用OProfile,Kernel perf和Google性能工具。所有工作正常,但不输出任何调用图信息。

这使我得出结论,我没有正确编译我的代码。



在编译我的C ++代码时,我使用了下列标志:

特定曲目:

  -march = armv7 -a -mtune = cortex-a8 -mfloat-abi = hard -mfpu = vfpv3 

常规:

  -fexceptions -fno-strict-aliasing -D_REENTRANT -Wall -Wextra 

调试(带优化):

  -O2 -g -fno-omit-frame-pointer 

我做了很多谷歌搜索,发现了一些相关的主题:


  • libunwind?

  • 矮人

  • (asynchronous-)unwind-tables

  • -mapcs-frame



然而,我不完全了解这些都是如何连接的。任何有关如何获得通话图表的提示?



请注意(由于Rian的回答):我有兴趣查明某些方法是否以及为什么需要更长的时间(关于其他)在ARM比x86-64。它不会帮助在不同的平台上执行此操作(即使我的代码在两者上编译,我都可以在x86-64上执行调用图)。 解决方案

我知道你想对ARM cortex-A8进行性能分析,但是如果你对调用图感兴趣,为什么不编译x86并运行valgrind的callgrind工具并使用kcachegrind检查结果?


$ b 在两种体系结构之间调用图应该是相同的,即使它们函数的编译方式略有不同,函数之间的关系也不应该改变。 b
$ b

不需要特殊标志:

  valgrind --tool = callgrind -v --dump -every-bb = 10000000 ./some-app 
kcachegrind&


I am biting my teeth out on this one...

I need to do profiling on an ARM board and need to view call graphs. I tried with OProfile, Kernel perf and Google performance tools. All work fine but do not output any call-graph information.

This led me to the conclusion that I am not compiling my code correctly.

I use the following flags when compiling my C++ code:

Arch specific:

-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=vfpv3

General:

-fexceptions -fno-strict-aliasing -D_REENTRANT -Wall -Wextra

Debugging (with optimization):

-O2 -g -fno-omit-frame-pointer

I did a lot of Google searching and found some related topics:

  • libunwind ?
  • dwarf
  • (asynchronous-)unwind-tables
  • -mapcs-frame

However I do not fully understand how these are all connected. Any hints on how to get call graphs working?

Note (due to Rian's answer): I am interested in finding out if and why some methods take longer (in relation to others) on ARM than x86-64. It does not help to do this on a different platform (Even though my code compiles on both and I can do call-graphs on x86-64).

解决方案

I know you want to do your profiling on an ARM cortex-A8 but if you're interested in call-graphs, why not compile for x86 and run valgrind's callgrind tool and examine the results with kcachegrind?

The call graphs should be the same between the two architectures, even if they compile the functions slightly differently, the relationship between functions shouldn't change.

No special flags needed:

valgrind --tool=callgrind -v --dump-every-bb=10000000 ./some-app
kcachegrind &

这篇关于如何获得使用gcc编译代码和ARM Cortex A8目标的调用图分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆