简体   繁体   English

ghc-gc-tune 0.2.1是否适用于ghc 7.4.1?

[英]Does ghc-gc-tune 0.2.1 work with ghc 7.4.1?

Does ghc-gc-tune 0.2.1 work with ghc 7.4.1? ghc-gc-tune 0.2.1是否适用于ghc 7.4.1? It seems ghc-gc-tune has not been updated for quite a while and may only work with ghc 6.x? 似乎ghc-gc-tune已经有一段时间没有更新了,可能只适用于ghc 6.x? I cannot find any reliable information on this. 我找不到任何关于此的可靠信息。

I get the following error: 我收到以下错误:

ghc-gc-tune: Can't parse GC stats: " ,(\"num_GCs\", \"320602\")\n ,(\"average_bytes_used\", \"105444\")\n ,(\"max_bytes_used\", \"131296\")\n ,(\"num_byte_usage_samples\", \"1677\")\n ,(\"peak_megabytes_allocated\", \"2\")\n ,(\"init_cpu_seconds\", \"0.00\")\n ,(\"init_wall_seconds\", \"0.00\")\n ,(\"mutator_cpu_seconds\", \"6.24\")\n ,(\"mutator_wall_seconds\", \"6.23\")\n ,(\"GC_cpu_seconds\", \"3.57\")\n ,(\"GC_wall_seconds\", \"3.58\")\n ]\n"

I have updated the package to work with the GHC 7 series. 我已经更新了包,以便与GHC 7系列配合使用。

Here's the result from a question on the -cafe 这是关于-cafe问题的结果

在此输入图像描述

Line 485 of ghc-gc-tune.hs [1] reads ghc-gc-tune.hs [1]的485行读取

Right str     -> return $! Just $! parse (unlines . drop 1 . lines $ str)

Which seems to be trimming off the start of your GC infodump, which is then not valid Haskell list syntax - three options in easy→hard order: 这似乎正在削减GC infodump的开始,这是无效的Haskell列表语法 - easy→hard order中的三个选项:

  1. make your code print a single newline to stderr when it starts (quick hack) 让你的代码在stderr启动时打印一个换行符(快速破解)

     main = hPutStrLn stderr "" >> do ... -- untested... 
  2. patch ghc-gc-tune.hs to stop it dropping 1 line of stderr 补丁ghc-gc-tune.hs来阻止它丢弃1行stderr

     Right str -> return $! Just $! parse str -- untested... 
  3. patch ghc-gc-tune.hs to try the current way, then without dropping 1 line, picking the one that works most successfully 补丁ghc-gc-tune.hs尝试当前的方式,然后不丢弃1行,选择一个最成功的方法

     -- code left as an exercise -- bonus points if it's submitted upstream as a patch 

Possibly earlier versions of GHC output an additional header on stderr, try something like: 可能早期版本的GHC在stderr上输出额外的标题,尝试类似:

./ghc-compiled-test-program +RTS -t --machine-readable -RTS

to inspect the output. 检查输出。

[1] http://code.haskell.org/~dons/code/ghc-gc-tune/ghc-gc-tune.hs [1] http://code.haskell.org/~dons/code/ghc-gc-tune/ghc-gc-tune.hs

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

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