【问题标题】:Haskell program get compiler args programmatically?Haskell程序以编程方式获取编译器参数?
【发布时间】:2016-02-15 02:28:23
【问题描述】:

是否可以在 Haskell 中以编程方式获取编译器参数?

我正在编写一个堆栈跟踪格式化库,我会发现在编译时知道是否使用了“-prof”和“-fprof-auto”非常有用。

【问题讨论】:

  • 据我所知,没有。 RTS 选项有一个接口,但编译器选项没有。

标签: debugging haskell stack-trace compiler-options


【解决方案1】:

也许GHC.RTS.Flags.getProfFlags 提供了足够的信息?

没有分析:

ProfFlags {doHeapProfile = NoHeapProfiling, 
           heapProfileInterval = 100000000, heapProfileIntervalTicks = 10,
           includeTSOs = False, showCCSOnException = False, 
           maxRetainerSetSize = 0, ccsLength = 0, modSelector = Nothing, 
           descrSelector = Nothing, typeSelector = Nothing, ccSelector = Nothing,
           ccsSelector = Nothing, retainerSelector = Nothing, bioSelector = Nothing}

-prof:

ProfFlags {doHeapProfile = NoHeapProfiling, heapProfileInterval = 100000000,
           heapProfileIntervalTicks = 100, includeTSOs = False,
           showCCSOnException = False, maxRetainerSetSize = 107374182408,
           ccsLength = 25, modSelector = Nothing, descrSelector = Nothing, 
           typeSelector = Nothing, ccSelector = Nothing, ccsSelector = Nothing,
           retainerSelector = Nothing, bioSelector = Nothing}

我猜这些是动态参数,但它们似乎受到-prof 的影响。所以,也许这对你的目的就足够了(?)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多