lix/doc/manual
Graham Christensen ee9c988a1b
Track function start and ends for flame graphs
With this patch, and this file I called `log.py`:

    #!/usr/bin/env nix-shell
    #!nix-shell -i python3 -p python3 --pure

    import sys
    from pprint import pprint

    stack = []
    timestack = []

    for line in open(sys.argv[1]):
        components = line.strip().split(" ", 2)
        if components[0] != "function-trace":
            continue

        direction = components[1]
        components = components[2].rsplit(" ", 2)

        loc = components[0]
        _at = components[1]
        time = int(components[2])

        if direction == "entered":
            stack.append(loc)
            timestack.append(time)
        elif direction == "exited":
            dur = time - timestack.pop()
            vst = ";".join(stack)
            print(f"{vst} {dur}")
            stack.pop()

and:

    nix-instantiate --trace-function-calls -vvvv ../nixpkgs/pkgs/top-level/release.nix -A unstable > log.matthewbauer 2>&1
    ./log.py ./log.matthewbauer > log.matthewbauer.folded
    flamegraph.pl --title matthewbauer-post-pr log.matthewbauer.folded > log.matthewbauer.folded.svg

I can make flame graphs like: http://gsc.io/log.matthewbauer.folded.svg

---

Includes test cases around function call failures and tryEval. Uses
RAII so the finish is always called at the end of the function.
2019-08-14 16:09:35 -04:00
..
advanced-topics Merge pull request #2995 from tweag/post-build-hook 2019-08-07 15:02:29 +02:00
command-ref Track function start and ends for flame graphs 2019-08-14 16:09:35 -04:00
expressions Merge pull request #2882 from grahamc/docs/1115-tarball-ttl 2019-07-06 00:15:27 +02:00
figures Fix corrupt PNG 2013-08-21 12:53:51 +02:00
glossary docs: Add IDs to important sections 2018-08-31 10:06:33 -04:00
images/callouts Add docbook icons to the distribution 2014-04-09 14:52:43 +02:00
installation autoconf: Fix C++17 detection not working on Ubuntu 16.04. 2019-07-03 04:32:25 +02:00
introduction editline: wip 2018-10-29 08:44:58 -05:00
packages Nix uses the CPP SDK, not Java 2019-06-20 14:47:45 +02:00
release-notes Merge pull request #2582 from LnL7/fetchgit-refs 2019-07-02 15:44:31 +02:00
hacking.xml Docs: Fix install prefix 2018-08-21 21:46:43 +02:00
local.mk Add a new option to disable documentation generation at configure time 2016-09-20 14:34:43 +00:00
manual.xml Create upgrade notes 2018-09-01 15:35:46 -04:00
nix-lang-ref.xml * Various updates. 2009-11-05 09:07:43 +00:00
quote-literals.xsl Generate release notes again 2014-03-12 14:24:29 +01:00
schemas.xml * Document setuid Nix installs. 2004-10-31 17:08:48 +00:00
style.css Update release notes 2018-02-19 20:38:53 +01:00