A modern, delicious implementation of the Nix package manager, focused on correctness, usability, and growth — and committed to doing right by its community
Find a file
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
.github Remove .github/FUNDING.yml 2019-07-23 15:21:23 +02:00
config
contrib Track function start and ends for flame graphs 2019-08-14 16:09:35 -04:00
corepkgs nix-channel: Don't fetch binary-cache-url 2019-06-25 13:27:16 +02:00
doc/manual Track function start and ends for flame graphs 2019-08-14 16:09:35 -04:00
m4 autoconf: Fix C++17 detection not working on Ubuntu 16.04. 2019-07-03 04:32:25 +02:00
maintainers Fix release script 2019-04-15 19:17:17 +02:00
misc
mk mk: add support for passing LDFLAGS to libs and bins 2019-07-03 04:32:25 +02:00
perl autoconf: Allow overriding CFLAGS/CXXFLAGS from outside. 2019-07-03 04:32:25 +02:00
scripts Add default for USER when unset 2019-07-25 09:39:44 -04:00
src Track function start and ends for flame graphs 2019-08-14 16:09:35 -04:00
tests Track function start and ends for flame graphs 2019-08-14 16:09:35 -04:00
.dir-locals.el
.editorconfig
.gitignore
.travis.yml
.version
bootstrap.sh
configure.ac Revert 82b7f0e840, cd8bc06e87, c3db9e6f8f 2019-07-05 00:35:59 +02:00
COPYING
local.mk
Makefile autoconf: Allow overriding CFLAGS/CXXFLAGS from outside. 2019-07-03 04:32:25 +02:00
Makefile.config.in Get BOOST_LDFLAGS from autoconf, fix Ubuntu 16.04 build. 2019-07-03 04:32:25 +02:00
nix.spec.in
README.md Add Open Collective 2019-07-18 10:57:26 +02:00
release-common.nix release-common: fix build with config.allowAliases = false 2019-05-30 18:08:33 +03:00
release.nix fetchGit -> fetchTarball 2019-05-17 22:28:03 +02:00
shell.nix fetchGit -> fetchTarball 2019-05-17 22:28:03 +02:00

Open Collective supporters

Nix, the purely functional package manager

Nix is a new take on package management that is fairly unique. Because of its purity aspects, a lot of issues found in traditional package managers don't appear with Nix.

To find out more about the tool, usage and installation instructions, please read the manual, which is available on the Nix website at http://nixos.org/nix/manual.

Contributing

Take a look at the Hacking Section of the manual. It helps you to get started with building Nix from source.

License

Nix is released under the LGPL v2.1

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit.