简体   繁体   English

Ghc的配置文件和代码覆盖范围选项有冲突吗?

[英]Ghc's profiling and code coverage options conflict?

For GHC, if I add the -fhpc option while the -prof -fprof-auto options are enabled, GHC does not add any cost centers to the code, and the profiling report shows only CAFs. 对于GHC,如果在启用-prof -fprof-auto选项的同时添加-fhpc选项,则GHC不会在代码中添加任何成本中心,并且性能分析报告仅显示CAF。 However, if I remove -fhpc profiling works fine. 但是,如果删除了-fhpc ,则分析工作正常。 Is there a reason for this? 是否有一个原因? Is there a way to enable both of these features? 有办法启用这两个功能吗?

There is no deep reason behind this - the simple truth of the matter is that GHC's "Coverage" pass is only run once (at maximum), and only ever generates one kind of annotation. 这背后没有深层原因-问题的简单事实是,GHC的“覆盖”通道仅运行一次(最多),并且仅生成一种注释。

I think at this point it would mainly be a question of somebody putting in a bit of time to implement a fix and properly check that mixtures of annotations don't cause bad side-effects. 我认为目前主要是有人花一些时间来实施修复并适当地检查混合注释不会引起不良副作用的问题。 Opening a GHC ticket for this particular issue might be a good idea - especially if you have a good use-case. 为这个特定问题开张GHC票可能是一个好主意,特别是如果您有很好的用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM