From 57d0dbb1c62401559533ced7c1c686da5125df75 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 13 Aug 2022 21:29:30 +0300 Subject: feat(tvix/eval): implement optional runtime tracing This adds a `disassembler` feature to the crate configuration that traces the operations executed and the state of the stack at runtime. This can be enabled by compiling with `--feature disassembler`. This will also gain a more sensible layout of code slices eventually. Change-Id: I34c15e1cd346ecc4362b5afba6bf82dd49359d20 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6193 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/eval/Cargo.toml') diff --git a/tvix/eval/Cargo.toml b/tvix/eval/Cargo.toml index 836b5deed1..b0ccabed2e 100644 --- a/tvix/eval/Cargo.toml +++ b/tvix/eval/Cargo.toml @@ -11,6 +11,7 @@ smol_str = "0.1" rustyline = "10.0.0" dirs = "4.0.0" path-clean = "0.1" +tabwriter = { version = "1.2", optional = true } [dev-dependencies] criterion = "0.3.6" @@ -21,6 +22,9 @@ test-generator = "0.3.0" # Nix implementation (at version 2.3) against Tvix. nix_tests = [] +# Enables printing compiled code and tracing the stack state at runtime. +disassembler = ["dep:tabwriter"] + [[bench]] name = "eval" harness = false -- cgit 1.4.1