Files
lix/tests
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
..
2019-06-24 17:09:09 +02:00
2018-05-30 13:28:01 +02:00
2018-08-06 14:06:54 +02:00
2017-05-02 15:46:10 +02:00
2014-08-21 21:50:19 +02:00
2019-08-02 10:48:15 -04:00
2016-08-10 18:05:35 +02:00
2018-02-13 14:26:19 +00:00
2018-01-16 19:23:18 +01:00
2014-08-21 21:50:19 +02:00
2018-02-03 10:08:05 +01:00
2019-08-02 18:39:16 +02:00
2014-08-21 21:50:19 +02:00
2016-09-12 13:40:07 +02:00
2019-03-10 01:50:33 +01:00
2006-07-21 13:21:43 +00:00
2018-12-13 14:30:52 +01:00
2019-03-04 18:27:45 +08:00
2019-07-25 09:44:01 -04:00
2014-08-21 21:50:19 +02:00
2018-02-13 14:26:19 +00:00
2017-10-02 23:45:27 -04:00
2018-02-08 13:46:23 +01:00
2019-08-02 10:48:15 -04:00
2018-01-16 19:23:18 +01:00
2018-01-16 19:23:18 +01:00
2019-08-02 10:48:15 -04:00
2016-08-10 18:05:35 +02:00
2016-08-10 18:05:35 +02:00
2018-01-16 19:23:18 +01:00
2017-11-20 18:36:36 +01:00
2018-02-25 16:40:05 -06:00
2016-04-11 16:20:15 +02:00
2007-08-13 13:15:02 +00:00
2016-10-19 15:19:38 +02:00
2016-09-08 18:22:28 +02:00
2019-07-02 11:18:36 -04:00
2012-12-04 14:47:50 +01:00
2012-12-04 14:47:50 +01:00
2018-02-08 15:25:03 +01:00