gpt4 book ai didi

debugging - Haskell 程序以编程方式获取编译器参数?

转载 作者:行者123 更新时间:2023-12-02 23:46:52 26 4
gpt4 key购买 nike

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

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

最佳答案

也许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的影响。所以,也许这足以满足您的目的(?)

关于debugging - Haskell 程序以编程方式获取编译器参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35400613/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com