MyNixOS website logo
Description

Visualise an eventlog.

eventlog2html is a library for visualising eventlogs. At the moment, the intended use is to visualise eventlogs which have heap profiling events, as a replacement to hp2ps and hp2pretty. eventlog2html creates a static webpage which contains a collection of different interactive charts for analysing heap usage. Trace events are displayed on the chart and the charts can be zoomed, scrolled and filtered to give a more exploratory feel to heap profile analysis.

eventlog2html

Interactive Documentation

GHC Matrix CI Hackage

eventlog2html is a tool to visualise eventlogs. In particular, it creates interactive charts for the heap profiling information included in the eventlog.

The complete documentation contain interactiveexamples and complete usage information.

How to use

The tool produces a static webpage to visualise the heap profile. For an eventlog program.eventlog, a static page titled program.eventlog.html will be created adjacent to the original file.

In order to use eventlog2html you first need an eventlog with heap profiling samples.

Compile your program with -prof. In a cabal project, the easiest way to do this is to set profiling: True in the cabal.project file.

Then, run your program with the normal profiling flags with an additional -l flag. This will tell GHC to also emit the eventlog.

my-leaky-program +RTS -hy -l-au

In the current directory a file my-leaky-program.eventlog will be produced. This is what you need to pass to eventlog2html to generate the profiling graphs.

eventlog2html my-leaky-program.eventlog

Note: The -l-au suffix will result in a significantly smaller eventlog as it will not include thread events. This makes a big difference for multi-threaded applications.

Building the project

There are two supported ways to build the project: cabal new-build and nix. For development the normal cabal new-build workflow should work fine.

There are also nix files provided which can build both the tool and documentation. Binary caches are populated by CI.

cachix use mpickering
nix build -f . eventlog2html
nix build -f . site

Using nix means that you can conveniently try the project using

nix run -f https://github.com/mpickering/eventlog2html/archive/master.tar.gz eventlog2html -c eventlog2html my-leaky-program.eventlog

Fixing CI

If we need a newer version of a dependency then it might be necessary to update the index-state which haskell.nix uses to compute the build plan.

All this requires is updating the date in build.nix to something more recent. The index-state-hashes are updated once a day so you might have to choose a date from a few days ago rather than the current date.

Modifying Documentation

The documentation for the project is located in the docs folder. It is a hakyll site built by the generator in the hakyll-eventlog folder. CI automatically builds and deploys changes to the documentation.

Additional examples can be added by adding an eventlog to the examples subdirectory. They will automatically be added to the examples gallery.

You can build the documentation using the nix target or using cabal new-build hakyll-eventlog and invoking the resulting executable in the docs/ directory.

There is a custom pandoc filter which can insert rendered eventlogs into the documentation. To understand how this works it's probably easiest to read the code or copy the existing examples.

Metadata

Version

0.11.1

Maintainers (1)

Executables (1)

  • bin/eventlog2html

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows