Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
base: 35ebae198f5a
Choose a base ref
...
head repository: NixOS/nix
compare: 477f82e5a7d1
Choose a head ref
  • 2 commits
  • 7 files changed
  • 2 contributors

Commits on Aug 14, 2019

  1. 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.
    grahamc committed Aug 14, 2019
    Copy the full SHA
    ee9c988 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2019

  1. Merge pull request #2782 from grahamc/flames

    Track function start and end
    edolstra committed Aug 15, 2019
    Copy the full SHA
    477f82e View commit details
    Browse the repository at this point in the history