c ++ g ++ llvm-clang编译器概要分析 [英] c++ g++ llvm-clang compiler profiling

查看:183
本文介绍了c ++ g ++ llvm-clang编译器概要分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请注意,我的问题不是:我如何告诉我的编译器在编译时进行编译。



我想要编辑处理。对于每个文件,我想知道在每个行花费了多少时间。



我正在处理项目,一些文件有巨大的编译时间,我想弄清楚为什么。



有没有反正要做到这一点与g ++或llvm-clang?

感谢!



输出-v -ftft-report(这是什么意思)?



下面是解析器还是展开模板的使用?

 执行时间(秒)
呼号图构造:0.06(2%)usr 0.00(0%)sys 0.09(2%)wall 3181 kB(1%)ggc
呼叫图优化: (0%)系统0.05(1%)壁5243kB(2%)ggc
cfg清除:0.02(1%)usr 0.00(0%)sys 0.02(0%)壁11kB
df live regs:0.01(0%)usr 0.00(0%)sys 0.01(0%)wall 0 kB(0%)ggc
df reg dead / unused notes:0.03 0.00(0%)系统0.03(1%)墙壁0 kB(0%)系统0.03(1%)墙壁%kB(1%)ggc
注册信息: ggc
别名分析:0.01(0%)usr 0.00(0%)系统0.01(0%)墙450 kB(0%)ggc
重建跳转标签:0.03(1%)usr 0.00 %)壁厚0 kB(0%)ggc
预处理:0.12(4%)usr 0.06(12%)系统1.46(27%)壁2752 kB b分析器:0.67(21%)usr 0.15(29%)sys 0.89(16%)wall 91749 kB(36%)ggc
名称查找:0.15(5%)usr 0.12 %)壁14384kB(6%)ggc
在线启发式:0.03(1%)usr 0.00(0%)sys 0.03(1%)wall 0 kB(0%)ggc
tree gimplify:0.06 (2%)us0 0.01(2%)sys 0.09(2%)壁15992kB(6%)ggc
树eh:0.02(1%)usr 0.01 kB(2%)ggc
树CFG构建:0.01(0%)usr 0.01(2%)系统0.03(1%)壁6636 kB(3%)ggc
树CFG清除:0.02 %)usr 0.01(2%)sys 0.02(0%)wall 15 kB(0%)ggc
tree find ref。 vars:0.00(0%)usr 0.00(0%)系统0.00(0%)壁1870kB(1%)ggc
树SSA重写:0.01 %)墙2357 kB(1%)ggc
tree SSA其他:0.00(0%)usr 0.01(2%)系统0.00(0%)墙37 kB(0%)ggc
树形操作数扫描:0.01(0%)usr 0.04(8%)系统0.06(1%)壁6340kB(2%)ggc
树SSA正常:0.05 %ggc
优势计算:0.04(1%)usr 0.00(0%)系统0.04(1%)wall 0 kB(0%)ggc
expand:0.60 18%)usr 0.03(6%)sys 0.71(13%)wall 45557 kB(18%)ggc
varconst:0.02(1%)usr 0.00 1%)ggc
跳转:0.00(0%)usr 0.00(0%)sys 0.00(0%)wall 1745 kB(1%)ggc
模式切换: 0%)系统0.01(0%)壁0 kB(0%)ggc
整合RA:0.35(11%)usr 0.00(0%)系统0.35(6%)壁5259 kB(2%)ggc
reload:0.29(9%)usr 0.01(2%)sys 0.31(6%)wall 6490 kB(3%)ggc
thread pro&结果:0.10(3%)usr 0.01(2%)系统0.13(2%)壁4832kB(2%)ggc
最终:0.19壁2985kB(1%)ggc
symout:0.25(8%)usr 0.01(2%)sys 0.26(5%)wall 27322 kB(11%)ggc
总计:3.25 0.51 5.49 256741 kB


解决方案

使用g ++尝试这些命令行选项


-v -ftft-report


您有关编译过程的更多信息。罪魁祸首通常是模板。


Note, my question is not: how do I tell my compiler to compile with profiling on.

I want to profile my compiles process. For each file, I'd like to know how much time is spent on each line of the program.

I'm working on a project, some files have huge compile times, I'm trying to figure out why.

Is there anyway to do this with g++ or llvm-clang?

Thanks!

Output of -v -ftime-report (what oes it mean)?

In the following, is "parser" or "expand" the use of templates?

Execution times (seconds)
  callgraph construction:   0.06 ( 2%) usr   0.00 ( 0%) sys   0.09 ( 2%) wall    3181 kB ( 1%) ggc
  callgraph optimization:   0.05 ( 2%) usr   0.00 ( 0%) sys   0.05 ( 1%) wall    5243 kB ( 2%) ggc
  cfg cleanup           :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall      11 kB ( 0%) ggc
  df live regs          :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall       0 kB ( 0%) ggc
  df reg dead/unused notes:   0.03 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall    1993 kB ( 1%) ggc
  register information  :   0.04 ( 1%) usr   0.00 ( 0%) sys   0.04 ( 1%) wall       0 kB ( 0%) ggc
  alias analysis        :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall     450 kB ( 0%) ggc
  rebuild jump labels   :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall       0 kB ( 0%) ggc
  preprocessing         :   0.12 ( 4%) usr   0.06 (12%) sys   1.46 (27%) wall    2752 kB ( 1%) ggc
  parser                :   0.67 (21%) usr   0.15 (29%) sys   0.89 (16%) wall   91749 kB (36%) ggc
  name lookup           :   0.15 ( 5%) usr   0.12 (24%) sys   0.24 ( 4%) wall   14384 kB ( 6%) ggc
  inline heuristics     :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall       0 kB ( 0%) ggc
  tree gimplify         :   0.06 ( 2%) usr   0.01 ( 2%) sys   0.09 ( 2%) wall   15992 kB ( 6%) ggc
  tree eh               :   0.02 ( 1%) usr   0.01 ( 2%) sys   0.03 ( 1%) wall    4405 kB ( 2%) ggc
  tree CFG construction :   0.01 ( 0%) usr   0.01 ( 2%) sys   0.03 ( 1%) wall    6636 kB ( 3%) ggc
  tree CFG cleanup      :   0.02 ( 1%) usr   0.01 ( 2%) sys   0.02 ( 0%) wall      15 kB ( 0%) ggc
  tree find ref. vars   :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall    1870 kB ( 1%) ggc
  tree SSA rewrite      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall    2357 kB ( 1%) ggc
  tree SSA other        :   0.00 ( 0%) usr   0.01 ( 2%) sys   0.00 ( 0%) wall      37 kB ( 0%) ggc
  tree operand scan     :   0.01 ( 0%) usr   0.04 ( 8%) sys   0.06 ( 1%) wall    6340 kB ( 2%) ggc
  tree SSA to normal    :   0.05 ( 2%) usr   0.00 ( 0%) sys   0.05 ( 1%) wall      95 kB ( 0%) ggc
  dominance computation :   0.04 ( 1%) usr   0.00 ( 0%) sys   0.04 ( 1%) wall       0 kB ( 0%) ggc
  expand                :   0.60 (18%) usr   0.03 ( 6%) sys   0.71 (13%) wall   45557 kB (18%) ggc
  varconst              :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall    3532 kB ( 1%) ggc
  jump                  :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall    1745 kB ( 1%) ggc
  mode switching        :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall       0 kB ( 0%) ggc
  integrated RA         :   0.35 (11%) usr   0.00 ( 0%) sys   0.35 ( 6%) wall    5259 kB ( 2%) ggc
  reload                :   0.29 ( 9%) usr   0.01 ( 2%) sys   0.31 ( 6%) wall    6490 kB ( 3%) ggc
  thread pro- & epilogue:   0.10 ( 3%) usr   0.01 ( 2%) sys   0.13 ( 2%) wall    4832 kB ( 2%) ggc
  final                 :   0.19 ( 6%) usr   0.01 ( 2%) sys   0.21 ( 4%) wall    2985 kB ( 1%) ggc
  symout                :   0.25 ( 8%) usr   0.01 ( 2%) sys   0.26 ( 5%) wall   27322 kB (11%) ggc
  TOTAL                 :   3.25             0.51             5.49             256741 kB

解决方案

Try these command line options with g++

-v -ftime-report

That should give you more information on the compiling process. The culprit is usually templates though.

这篇关于c ++ g ++ llvm-clang编译器概要分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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