20151208-3:GPROF(用于观测函数、代码运行时间)

Right-click onthe generated binary in the Project Explorer view, and select Run As -> RunConfigurations. In the resulting dialog, double click on xCORE Application,then perform the following operations:
​ ->On the Main tab select the desired target, or alternatively check the simulator option.
​ ->On the Simulator tab, check Enable Gprof output.

Now select theRun button to launch the application. On completion, a number of *.gprofprofiling files will be written to the top level of the project, one for eachlogical core present in the system. The perspective will automatically switchto GProf Profiling, and a dialog will appear listing the avaiable *.gproffiles.
​ ->Select tile[0]_core0.gprof and click Open.
You will then be prompted to choose the binary corresponding to this run. The correct binary should be selected by default.
​ ->Select OK.
The gprof viewwill then be populated with the profile for logical core 0, which in this casecorresponds to the main thread of execution.

Expand the app_getting_started_with_gprof.xc node in the tree. This will** reveal the time spent in each function of this application during execution**. As expected, roughly 90% of the time is spent in functon A, and 10% in function B.

Expand thefunctionA node in the tree. This will reveal the timespent in each line of this function. Doubleclick on the top line.This will bring up the corresponding line in the editor. As you can see,roughly 60% of the time of this function is spent performing the loopmanagement.

注意执行run后,会在项目的目录下生成一系列的.gprof files,点击后进入GPROF Profiling界面。

clip_image002.jpg
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 这是一个画家的故事,一个悲惨的故事. H城是一座旅游业十分发达的城市,因为这里出现过...
    秋沙星云阅读 819评论 7 8
  • 对那些非常努力学习的高中生,但成绩很难提高的同学,特别是来自农村的学生,我非常同情,我也是其中的一位,明白...
    残花累累阅读 274评论 0 0