Skip to content

Commit

Permalink
fix: profiler no longer miscounts solver times.
Browse files Browse the repository at this point in the history
This moves the allocation time of a new profiler when forking states to
an earlier position (into the `with_snapshot` method). This prevents the
solver time for deciding whether a branch is reachable or not from being
lost. Furthermore, we also need to allocate a new profiler when a branch
is skipped, to avoid falsely double-counting the stale profiler.
  • Loading branch information
mstarzinger committed Jul 28, 2021
1 parent ec74690 commit 811537b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine/symbolic_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,8 @@ where
let amount_of_file_descriptors_snapshot = self.amount_of_file_descriptors;
let profiler_snapshot = self.profiler.clone();

self.profiler = Profiler::new();

let result = f(self);
let profiler = self.profiler.clone();

Expand Down Expand Up @@ -986,7 +988,6 @@ where
next_pc,
);

this.profiler = Profiler::new();
this.profiler.took_beq_branch(decision);

this.pc = next_pc;
Expand Down

0 comments on commit 811537b

Please sign in to comment.