stackcollapse-ghc 0.0.1.3 → 0.0.1.4
raw patch · 5 files changed
+40/−11 lines, 5 filesdep +filepathdep ~basedep ~hspec-golden
Dependencies added: filepath
Dependency ranges changed: base, hspec-golden
Files
- CHANGELOG.md +8/−0
- README.md +12/−1
- app/Main.hs +1/−1
- stackcollapse-ghc.cabal +5/−2
- test/Spec.hs +14/−7
CHANGELOG.md view
@@ -3,6 +3,14 @@ `stackcollapse-ghc` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 0.0.1.4++This release does not change functionality++* Rebuild with hspec-golden >=0.2.0.0 && < 0.3+* Support ghc 8.10.4+* Do not use deprected `Data.ByteString.Lazy.putStrLn`+ ## 0.0.1.3 This release does not change functionality
README.md view
@@ -1,6 +1,6 @@ # stackcollapse-ghc -[](https://travis-ci.org/marcin-rzeznicki/stackcollapse-ghc)+[](https://travis-ci.org/marcin-rzeznicki/stackcollapse-ghc) [](https://hackage.haskell.org/package/stackcollapse-ghc) [](http://stackage.org/lts/package/stackcollapse-ghc) [](http://stackage.org/nightly/package/stackcollapse-ghc)@@ -25,6 +25,7 @@ * [Colors](#using-distinct-colors-for-modules) * [Qualified names](#turning-off-qualified-names) * [Source locations](#adding-source-locations)+ * [Reverse flamegraphs](#reverse-flamegraphs) * [All options](#all-options) * [Installation](#installation) @@ -121,6 +122,16 @@ ``` ++### "Reverse" flamegraphs++Sometimes it makes sense to to have functions at the bottom and their callers above them. This mode is called "reverse" flamegraph. You can make such graphs with `stackcollapse-ghc` (the real work is done by the `flamegraph` script)++```bash+stackcollapse-ghc prof_file | flamegraph.pl --reverse --title 'Reverse' --countname ticks > path_to_svg+```++ ## All options
app/Main.hs view
@@ -27,7 +27,7 @@ import Data.Function ((&)) import Control.Monad (foldM) import Control.Exception-import qualified Data.ByteString.Lazy as Lazy+import qualified Data.ByteString.Lazy.Char8 as Lazy cmdLineOpts :: [OptDescr (StackCollapseConfig -> Either String StackCollapseConfig)]
stackcollapse-ghc.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: stackcollapse-ghc-version: 0.0.1.3+version: 0.0.1.4 synopsis: Program to fold GHC prof files into flamegraph input description: Program to fold GHC prof files into flamegraph input @@ -60,6 +60,8 @@ GHC == 8.8.2 GHC == 8.8.3 GHC == 8.10.1+ GHC == 8.10.2+ GHC == 8.10.3 source-repository head type: git@@ -123,7 +125,8 @@ hs-source-dirs: test main-is: Spec.hs other-modules: Helpers- build-depends: hspec-golden >= 0.1.0.2 && < 0.1.1,+ build-depends: filepath,+ hspec-golden >= 0.2.0.0 && < 0.3, hspec, utf8-string ^>=1.0.1 ghc-options: -threaded
test/Spec.hs view
@@ -12,6 +12,7 @@ import Data.ByteString.Lazy.UTF8 (toString) import Data.Either.Extra (fromEither) import Control.Arrow (left)+import System.FilePath ((</>)) path_ProfFilesDir :: String path_ProfFilesDir = "test/prof_files/"@@ -31,18 +32,18 @@ [ defaultConfig , defaultConfig `prependUserModule` userModuleFromString "Example" , defaultConfig { sourceMode = SourceUser }- `prependUserModule` userModuleFromString "Example"+ `prependUserModule` userModuleFromString "Example" , defaultConfig { functionNameMode = QualifiedNever }- `prependUserModule` userModuleFromString "Example"+ `prependUserModule` userModuleFromString "Example" , defaultConfig { operationMode = Alloc }- `prependUserModule` userModuleFromString "Example"]+ `prependUserModule` userModuleFromString "Example"] context "standard prof" $ withConfigs "countSemiprimes" [ defaultConfig { inputType = Standard }- `prependUserModule` userModuleFromString "Example"+ `prependUserModule` userModuleFromString "Example" , defaultConfig { inputType = Standard, operationMode = Alloc }- `prependUserModule` userModuleFromString "Example"]+ `prependUserModule` userModuleFromString "Example"] context "unicode chars" $ withConfigs "unicode"@@ -96,12 +97,18 @@ , encodePretty = toString , writeToFile = Lazy.writeFile , readFromFile = Lazy.readFile- , directory = path_GoldenDir- , testName+ , actualFile+ , goldenFile , failFirstTime = False } where testName = stem ++ embedInFileName opts++ testSpecificDir = path_GoldenDir </> testName++ goldenFile = testSpecificDir </> "golden"++ actualFile = Just $ testSpecificDir </> "actual" prepareTest :: String -> StackCollapseConfig -> IO StackCollapse prepareTest stem opts = let profFilePath = path_ProfFile stem