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:
parent
543cee1c92
commit
128750225d
4 changed files with 20 additions and 29 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue