Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParseError {errorContexts = [], errorMessage = "Failed reading: takeWhile1", errorPosition = 10:39} @(yesod_GBB6gCJ4065E6aE3B1q92h:Yesod.Core.Class.Yesod ./Yesod/Core/Class/Yesod.hs:629:5) #35

Open
niteria opened this issue Jun 15, 2016 · 3 comments

Comments

@niteria
Copy link

niteria commented Jun 15, 2016

I got this error while trying to load: haddock.prof.txt

TKYProf 0.2.2.2 launched, listening on http://localhost:3000/
15/Jun/2016:10:36:16 +0100 [Info#yesod-core] Application launched @(yesod_GBB6gCJ4065E6aE3B1q92h:Yesod.Core.Dispatch ./Yesod/Core/Dispatch.hs:157:11)
15/Jun/2016:10:36:29 +0100 [Error#yesod-core] ParseError {errorContexts = [], errorMessage = "Failed reading: takeWhile1", errorPosition = 10:39} @(yesod_GBB6gCJ4065E6aE3B1q92h:Yesod.Core.Class.Yesod ./Yesod/Core/Class/Yesod.hs:629:5)
127.0.0.1 - - [15/Jun/2016:10:36:29 +0100] "POST /reports HTTP/1.1" 500 - "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"

The profile was produced with GHC 8.

@niteria
Copy link
Author

niteria commented Jun 15, 2016

I suspect it's because it was created with -P instead of -p.

@maoe
Copy link
Owner

maoe commented Jun 15, 2016

Thanks for the report. Apparently the SRC column has been added (since GHC 8?). I've fixed it in my ghc-time-alloc-prof library, which is meant for a replacement for the parser in tkyprof. I think I had a branch which replaces the parser but I need time to remember where I was.

For the time being, you can try the dump command in ghc-time-alloc-prof. The UI isn't good at all but it's kind of usable.

Sort by time:

% stack exec dump -- haddock.prof.txt
MAIN.MAIN:716 (100.0,0.0,100.0,0.0)
|
+- GHC.runGhc:1432 (100.0,0.0,100.0,0.0)
|  |
|  +- GHC.withCleanupSession:1439 (99.9,19.6,99.9,24.3)
|  |  |
|  |  +- GHC.typecheckModule:1723 (57.8,0.1,50.3,0.1)
|  |  |  |
|  |  |  +- HscMain.Typecheck-Rename:1724 (57.8,0.0,50.2,0.0)
|  |  |  |  |
|  |  |  |  `- TcRnDriver.tcRnModule:1727 (57.8,0.3,50.2,0.2)
|  |  |  |     |
|  |  |  |     +- TcRnDriver.withTcPlugins:1732 (57.5,0.0,50.1,0.0)
|  |  |  |     |  |
|  |  |  |     |  +- TcRnDriver.tcRnModuleTcRnM:1735 (57.5,0.0,50.1,0.0)
|  |  |  |     |  |  |
|  |  |  |     |  |  +- TcRnDriver.tcRnSrcDecls:1870 (39.7,0.0,22.7,0.0)
...

Who calls it:

% stack exec dump -- haddock.prof.txt tcRnModuleTcRnM TcRnDriver
Callee {calleeName = "tcRnModuleTcRnM", calleeModule = "TcRnDriver", calleeEntries = 468, calleeTime = 0.0, calleeAlloc = 0.0, calleeTicks = Just 0, calleeBytes = Just 0}
CallSite {callSiteCostCentre = CostCentre {costCentreName = "withTcPlugins", costCentreModule = "TcRnDriver", costCentreSrc = Just "compiler/typecheck/TcRnDriver.hs:(2502,1)-(2518,31)", costCentreNo = 1732, costCentreEntries = 468, costCentreIndTime = 0.0, costCentreIndAlloc = 0.0, costCentreInhTime = 57.5, costCentreInhAlloc = 50.1, costCentreTicks = Just 1, costCentreBytes = Just 29952}, callSiteContribEntries = 0, callSiteContribTime = 0.0, callSiteContribAlloc = 0.0, callSiteContribTicks = Just 12, callSiteContribBytes = Just 835016}
CallSite {callSiteCostCentre = CostCentre {costCentreName = "withTcPlugins", costCentreModule = "TcRnDriver", costCentreSrc = Just "compiler/typecheck/TcRnDriver.hs:(2502,1)-(2518,31)", costCentreNo = 2148, costCentreEntries = 0, costCentreIndTime = 0.0, costCentreIndAlloc = 0.0, costCentreInhTime = 0.0, costCentreInhAlloc = 0.0, costCentreTicks = Just 0, costCentreBytes = Just 0}, callSiteContribEntries = 0, callSiteContribTime = 0.0, callSiteContribAlloc = 0.0, callSiteContribTicks = Just 0, callSiteContribBytes = Just 0}
CallSite {callSiteCostCentre = CostCentre {costCentreName = "CAF", costCentreModule = "TcRnDriver", costCentreSrc = Just "<entire-module>", costCentreNo = 864, costCentreEntries = 0, costCentreIndTime = 0.0, costCentreIndAlloc = 0.0, costCentreInhTime = 0.0, costCentreInhAlloc = 0.0, costCentreTicks = Just 0, costCentreBytes = Just 48}, callSiteContribEntries = 0, callSiteContribTime = 0.0, callSiteContribAlloc = 0.0, callSiteContribTicks = Just 0, callSiteContribBytes = Just 0}
CallSite {callSiteCostCentre = CostCentre {costCentreName = "tcRnModule", costCentreModule = "TcRnDriver", costCentreSrc = Just "compiler/typecheck/TcRnDriver.hs:(133,1)-(159,45)", costCentreNo = 1727, costCentreEntries = 468, costCentreIndTime = 0.3, costCentreIndAlloc = 0.2, costCentreInhTime = 57.8, costCentreInhAlloc = 50.2, costCentreTicks = Just 213, costCentreBytes = Just 114853928}, callSiteContribEntries = 468, callSiteContribTime = 0.0, callSiteContribAlloc = 0.0, callSiteContribTicks = Just 1, callSiteContribBytes = Just 117168}

@niteria
Copy link
Author

niteria commented Jun 16, 2016

Thanks for the quick response. I think I've tried ghc-time-alloc-prof from Hackage and got the same error. I will try the github repo. The think I want to eventually achieve is to compute a difference between two profiles. Your library looks like a good fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants