Is it possible to get the compiler args programmatically in Haskell?
I am writing a stack trace formatting library and I would find it very useful to know if "-prof" and "-fprof-auto" were used when compiling.
Is it possible to get the compiler args programmatically in Haskell?
I am writing a stack trace formatting library and I would find it very useful to know if "-prof" and "-fprof-auto" were used when compiling.
Perhaps GHC.RTS.Flags.getProfFlags
provides enough information?
No profiling:
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}
With -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}
I guess that these are dynamic parameters, but they seem to be affected by -prof
. So, perhaps it's enough for your purposes (?)