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

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

作者: skylaugher | 来源:发表于2018-11-13 20:56 被阅读0次

    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

    相关文章

      网友评论

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

          本文链接:https://www.haomeiwen.com/subject/bbhrfqtx.html