lix/src/libutil
Eelco Dolstra e82767910c Add some basic profiling support to the evaluator
Setting the environment variable NIX_COUNT_CALLS to 1 enables some
basic profiling in the evaluator.  It will count calls to functions
and primops as well as evaluations of attributes.

For example, to see where evaluation of a NixOS configuration spends
its time:

$ NIX_SHOW_STATS=1 NIX_COUNT_CALLS=1 ./src/nix-instantiate/nix-instantiate '<nixos>' -A system --readonly-mode
...
calls to 39 primops:
    239532 head
    233962 tail
    191252 hasAttr
...
calls to 1595 functions:
    224157 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/lists.nix:17:19'
    221767 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/lists.nix:17:14'
    221767 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/lists.nix:17:10'
...
evaluations of 7088 attributes:
    167377 undefined position
    132459 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/attrsets.nix:119:41'
     47322 `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/attrsets.nix:13:21'
...
2012-08-12 23:29:28 -04:00
..
archive.cc * Revert r15436. This was a workaround for a bug in btrfs which seems 2010-05-04 12:42:58 +00:00
archive.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
hash.cc Use data() instead of c_str() where appropriate 2012-02-09 18:27:45 +01:00
hash.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
immutable.cc On Linux, make the Nix store really read-only by using the immutable bit 2012-02-15 01:31:56 +01:00
immutable.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
Makefile.am Drop the externals directory 2012-03-18 23:54:57 +01:00
md5.c * Optional switch "--with-openssl=<PATH>" to use OpenSSL's 2006-02-13 19:52:43 +00:00
md5.h * Some Cygwin fixes. 2006-05-24 13:23:20 +00:00
md32_common.h * Add SHA-256. 2005-01-14 12:03:04 +00:00
serialise.cc Use data() instead of c_str() where appropriate 2012-02-09 18:27:45 +01:00
serialise.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
sha1.c * Optional switch "--with-openssl=<PATH>" to use OpenSSL's 2006-02-13 19:52:43 +00:00
sha1.h * Optional switch "--with-openssl=<PATH>" to use OpenSSL's 2006-02-13 19:52:43 +00:00
sha256.c * Add SHA-256. 2005-01-14 12:03:04 +00:00
sha256.h * FreeBSD 4.x doesn't have stdint.h, use inttypes.h instead (which is 2005-05-04 16:32:54 +00:00
types.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
util.cc Drop the block count in the garbage collector 2012-08-01 22:34:46 -04:00
util.hh Add some basic profiling support to the evaluator 2012-08-12 23:29:28 -04:00
xml-writer.cc Escape `>' signs in the XML output. 2010-03-31 08:29:01 +00:00
xml-writer.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00