1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

libexpr: Pass mutable EvalState to EvalProfiler

Sometimes the profiler might want to do evaluation (e.g. for getting
derivation names). This is not ideal, but is really necessary
to make the profiler stack traces useful for end users.
This commit is contained in:
Sergei Zimmerman 2025-05-25 14:58:31 +00:00
parent 543cee1c92
commit 128750225d
No known key found for this signature in database
GPG key ID: A9B0B557CA632325
4 changed files with 20 additions and 29 deletions

View file

@ -4,7 +4,7 @@
namespace nix {
void FunctionCallTrace::preFunctionCallHook(
const EvalState & state, const Value & v, std::span<Value *> args, const PosIdx pos)
EvalState & state, const Value & v, std::span<Value *> args, const PosIdx pos)
{
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(duration);
@ -12,7 +12,7 @@ void FunctionCallTrace::preFunctionCallHook(
}
void FunctionCallTrace::postFunctionCallHook(
const EvalState & state, const Value & v, std::span<Value *> args, const PosIdx pos)
EvalState & state, const Value & v, std::span<Value *> args, const PosIdx pos)
{
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(duration);