about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-11T21·04+0200
committerEelco Dolstra <edolstra@gmail.com>2019-04-11T21·04+0200
commitbb6e6923f25841874b6a915d234d884ddd4c92dd (patch)
treedb1483219b801816e0923d6c800fdac1d6db751e /src/libexpr/eval.cc
parent41ba5135e0a2d9940c4e8cbedff44eb1a47af782 (diff)
Add environment variable NIX_SHOW_SYMBOLS for dumping the symbol table
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 211f7a55f737..d8e10d9f20e1 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1811,6 +1811,7 @@ void EvalState::printStats()
             gc.attr("totalBytes", totalBytes);
         }
 #endif
+
         if (countCalls) {
             {
                 auto obj = topObj.object("primops");
@@ -1846,6 +1847,11 @@ void EvalState::printStats()
                 }
             }
         }
+
+        if (getEnv("NIX_SHOW_SYMBOLS", "0") != "0") {
+            auto list = topObj.list("symbols");
+            symbols.dump([&](const std::string & s) { list.elem(s); });
+        }
     }
 }