diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e9e719b..1a1f777 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ jobs: name: mpickering signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - run: cachix push mpickering --watch-store& - - run: nix-build -A eventlog2html --arg ci true --argstr haskellCompiler ghc927 --option trusted-public-keys "mpickering.cachix.org-1:COxPsDJqqrggZgvKG6JeH9baHPue8/pcpYkmcBPUbeg= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" --option substituters "https://cache.iog.io https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ https://mpickering.cachix.org" + - run: nix-build -A eventlog2html --arg ci true --argstr haskellCompiler ghc9102 --option trusted-public-keys "mpickering.cachix.org-1:COxPsDJqqrggZgvKG6JeH9baHPue8/pcpYkmcBPUbeg= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" --option substituters "https://cache.iog.io https://cache.nixos.org/ https://mpickering.cachix.org" deploy: runs-on: ubuntu-latest steps: @@ -28,7 +28,7 @@ jobs: run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id - name: Restore LFS cache - uses: actions/cache@v2 + uses: actions/cache@v4 id: lfs-cache with: path: .git/lfs @@ -44,7 +44,7 @@ jobs: name: mpickering signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - run: cachix push mpickering --watch-store& - - run: nix-build -A site --arg ci true -o site --option trusted-public-keys "mpickering.cachix.org-1:COxPsDJqqrggZgvKG6JeH9baHPue8/pcpYkmcBPUbeg= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option substituters "https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ https://mpickering.cachix.org" + - run: nix-build -A site --arg ci true -o site --option trusted-public-keys "mpickering.cachix.org-1:COxPsDJqqrggZgvKG6JeH9baHPue8/pcpYkmcBPUbeg= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option substituters "https://cache.iog.io https://cache.nixos.org/ https://mpickering.cachix.org" # This stuff is only to avoid the deployment crashing when it # tries to remove files - run: mkdir -p build-folder diff --git a/.github/workflows/ghc-matrix.yml b/.github/workflows/ghc-matrix.yml index 1d19024..5e1659d 100644 --- a/.github/workflows/ghc-matrix.yml +++ b/.github/workflows/ghc-matrix.yml @@ -16,13 +16,13 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ghc-version: ['9.0.2', '9.2.7', '9.4.7', '9.6.2', '9.8.1', '9.10.1'] + ghc-version: ['9.6.7', '9.8.4', '9.10.2', '9.12.2'] include: - os: windows-latest - ghc-version: '9.6.2' + ghc-version: '9.12.2' - os: macos-latest - ghc-version: '9.6.2' + ghc-version: '9.12.2' steps: - uses: actions/checkout@v4 diff --git a/default.nix b/default.nix index d0ffd51..6227d6b 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,4 @@ -{ci ? false, haskellCompiler ? "ghc927" }: +{ci ? false, haskellCompiler ? "ghc9102" }: let # Import the Haskell.nix library, haskell-src = import ((import ./nix/sources.nix)."haskell.nix") {}; @@ -8,7 +8,7 @@ let haskell = pin.haskell-nix; - ciOptions = [ { packages.eventlog2html.configureFlags = [ "--ghc-option=-Werror" ]; } ]; + ciOptions = []; # [ { packages.eventlog2html.configureFlags = [ "--ghc-option=-Werror" ]; } ]; opts = [ { packages.vault.doHaddock = false; } ]; @@ -17,7 +17,7 @@ let compiler-nix-name = haskellCompiler; src = haskell.haskellLib.cleanGit { name = "eventlog2html"; src = ./.; }; modules = (if ci then ciOptions else []) ++ opts; - index-state = "2023-03-25T00:00:00Z"; + index-state = "2025-06-01T00:00:00Z"; }; diff --git a/eventlog2html.cabal b/eventlog2html.cabal index ac0ba79..8c6ded5 100644 --- a/eventlog2html.cabal +++ b/eventlog2html.cabal @@ -46,7 +46,7 @@ Library containers >= 0.5.0 && < 0.8, file-embed >= 0.0.11 && < 0.1, filepath >= 1.4.2 && < 1.6, - ghc-events >= 0.19.0 && < 0.21, + ghc-events >= 0.20.0 && < 0.21, ghc-heap >= 9 && < 10, hashable >= 1.0 && < 1.6, hashtables >= 1.2.3 && < 1.5, diff --git a/nix/sources.json b/nix/sources.json index 6b7f2c3..8bba503 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://input-output-hk.github.io/haskell.nix", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "af82dc3e464f58f5cc90400200f703e197d52e84", - "sha256": "0cdbxwqd8d22dxnqx6d1060hpjk5awwp4z5v5lvavp3p8fngg9cv", + "rev": "60bd09012b12681434a27ab04617ad5b1cfa4650", + "sha256": "1b4pqsfrfnyxdn1zm7jm3c6drn83xg4xq7676j2iffjpz21njcvq", "type": "tarball", - "url": "https://github.com/input-output-hk/haskell.nix/archive/af82dc3e464f58f5cc90400200f703e197d52e84.tar.gz", + "url": "https://github.com/input-output-hk/haskell.nix/archive/60bd09012b12681434a27ab04617ad5b1cfa4650.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { diff --git a/src/Eventlog/Data.hs b/src/Eventlog/Data.hs index 7ba02b5..3d58b83 100644 --- a/src/Eventlog/Data.hs +++ b/src/Eventlog/Data.hs @@ -40,11 +40,11 @@ generateJsonData a (ProfData h binfo ccMap fs traces heap_info ipes _ticky_count sortBy (flip (comparing (fst . snd))) $ Map.toList keeps -- Only supply the cost centre view in cost centre profiling mode. cc_descs = case hHeapProfileType h of - Just HeapProfBreakdownCostCentre -> Just (outputTree ccMap mdescs) + (FromEventlog (Just HeapProfBreakdownCostCentre)) -> Just (outputTree ccMap mdescs) _ -> Nothing use_ipes = case hHeapProfileType h of - Just HeapProfBreakdownInfoTable -> Just ipes + (FromEventlog (Just HeapProfBreakdownInfoTable)) -> Just ipes _ -> Nothing -- If we have IPE info, try to translate info table pointers to names diff --git a/src/Eventlog/Events.hs b/src/Eventlog/Events.hs index 9bc364e..b4c8561 100644 --- a/src/Eventlog/Events.hs +++ b/src/Eventlog/Events.hs @@ -344,7 +344,7 @@ elHeader EL{..} = let title = maybe "" T.unwords pargs date = formatDate clocktimeSec ppSamplingRate = T.pack . maybe "" (show . fromNano) $ samplingRate - in \v -> Header title date heapProfileType ppSamplingRate "" "" v (T.unpack . head <$> pargs) + in \v -> Header title date (FromEventlog heapProfileType) ppSamplingRate "" "" v (T.unpack . head <$> pargs) elBucketMap :: EL -> BucketMap diff --git a/src/Eventlog/HeapProf.hs b/src/Eventlog/HeapProf.hs index 1ac6028..354a728 100644 --- a/src/Eventlog/HeapProf.hs +++ b/src/Eventlog/HeapProf.hs @@ -27,7 +27,7 @@ chunkT s = [job, date, smpU, valU] = zipWith header [sJOB, sDATE, sSAMPLE_UNIT, sVALUE_UNIT] hs fs = chunkSamples ss - in (\v -> Header job date Nothing (pack "") smpU valU v Nothing + in (\v -> Header job date FromHPFile (pack "") smpU valU v Nothing , fs ) diff --git a/src/Eventlog/HtmlTemplate.hs b/src/Eventlog/HtmlTemplate.hs index fe174d0..4f49387 100644 --- a/src/Eventlog/HtmlTemplate.hs +++ b/src/Eventlog/HtmlTemplate.hs @@ -19,7 +19,7 @@ import Data.FileEmbed import Eventlog.Data import Eventlog.Javascript import Eventlog.Args -import Eventlog.Types (Header(..), HeapProfBreakdown(..)) +import Eventlog.Types (Header(..), HeapProfBreakdown(..), ProfileType(..)) import Eventlog.Rendering.Bootstrap import Eventlog.Rendering.Types import Eventlog.VegaTemplate @@ -162,11 +162,15 @@ perTabFooter :: Header -> Html perTabFooter header' = do H.div ! class_ "row" $ do H.div ! class_ "col" $ do - toHtml $ maybe "No heap profile" ppHeapProfileType (hHeapProfileType header') + toHtml $ render_type (hHeapProfileType header') ", created at " code $ toHtml $ hDate header' " by " code $ toHtml $ hJob header' + where + render_type FromHPFile = "heap profile" + render_type (FromEventlog Nothing) = "No heap profile" + render_type (FromEventlog (Just t)) = ppHeapProfileType t select_data :: IncludeTraceData -> ChartType -> [Text] @@ -223,6 +227,7 @@ ppHeapProfileType (HeapProfBreakdownRetainer) = "Retainer profiling (implied by ppHeapProfileType (HeapProfBreakdownBiography) = "Biographical profiling (implied by -hb)" ppHeapProfileType (HeapProfBreakdownClosureType) = "Basic heap profile (implied by -hT)" ppHeapProfileType (HeapProfBreakdownInfoTable) = "Info table profile (implied by -hi)" +ppHeapProfileType (HeapProfBreakdownEra) = "Era profile (implied by -he)" allTabs :: EventlogType @@ -248,7 +253,11 @@ metaTab header' _as = " seconds between heap samples" has_heap_profile :: Header -> Bool -has_heap_profile h = isJust (hHeapProfileType h) +has_heap_profile h = + case (hHeapProfileType h) of + FromHPFile -> True + FromEventlog t -> isJust t + allHeapTabs :: Header -> Args -> HeapProfileData -> [TabGroup] allHeapTabs header' as x = diff --git a/src/Eventlog/Types.hs b/src/Eventlog/Types.hs index 456e718..4c22c8f 100644 --- a/src/Eventlog/Types.hs +++ b/src/Eventlog/Types.hs @@ -19,7 +19,7 @@ data Header = Header { hJob :: Text , hDate :: Text - , hHeapProfileType :: Maybe HeapProfBreakdown + , hHeapProfileType :: ProfileType , hSamplingRate :: Text , hSampleUnit :: Text , hValueUnit :: Text @@ -27,6 +27,8 @@ data Header = , hProgPath :: Maybe FilePath } deriving Show +data ProfileType = FromHPFile | FromEventlog (Maybe HeapProfBreakdown) deriving Show + -- The bucket is a key to uniquely identify a band newtype Bucket = Bucket Text