Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve timing, add Trace Event Format output #844

Merged
merged 33 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c2665c7
Copy CIL Stats module as Timing
sim642 Sep 29, 2022
dfd6c9c
Switch from Stats to Timing
sim642 Sep 29, 2022
8de1902
Add back FrontC and Cabs2cil timing
sim642 Sep 29, 2022
a5b34cf
Clean up Timing relics
sim642 Sep 29, 2022
e3444d2
Remove Timing.repeattime
sim642 Sep 29, 2022
88a03bf
Convert Timing into dune library
sim642 Sep 29, 2022
2d57f09
Lift Timing into a functor
sim642 Sep 29, 2022
0ea27fa
Use intf trick for Goblint_timing
sim642 Sep 29, 2022
bb366d0
Refactor timing workflow
sim642 Sep 29, 2022
c21c18b
Refactor timing interface
sim642 Sep 29, 2022
ca21566
Clean up timing records
sim642 Sep 29, 2022
59ff298
Fix timing not account for all cputime
sim642 Sep 29, 2022
a99cd31
Rewrite timing printing with boxes
sim642 Sep 29, 2022
a28df45
Fix super ridiculous XML timings hack
sim642 Sep 29, 2022
b38495d
Fix timing not accounting for frame resources
sim642 Sep 30, 2022
9e36f2d
Add walltime to timing
sim642 Sep 30, 2022
96cd673
Add allocated bytes to timing
sim642 Sep 30, 2022
bd7cc64
Print only enabled timing, align columns
sim642 Sep 30, 2022
5b8475e
Add TEF to timing
sim642 Sep 30, 2022
51c966e
Add TEF timing for program under analysis
sim642 Sep 30, 2022
97fc4d7
Add TEF track names
sim642 Sep 30, 2022
e8bc2bf
Only expose Timing.Default.wrap directly under Timing
sim642 Sep 30, 2022
21a4414
Make TEF files openable in Firefox Profiler
sim642 Sep 30, 2022
d860c1c
Document Goblint_timing
sim642 Sep 30, 2022
c57d8b5
Refactor Goblint_timing implementation
sim642 Sep 30, 2022
5176adb
Fix root walltime in timing
sim642 Sep 30, 2022
2a85e4e
Add async ProcessPool TEF tracing
sim642 Sep 30, 2022
fe0d2ed
Add args argument to timing for custom TEF data
sim642 Sep 30, 2022
5dbe2fc
Add dbg.timing options, remove printstats
sim642 Sep 30, 2022
a5d89fe
Update timing documentation
sim642 Sep 30, 2022
ec8121e
Fix Goblint_timing.dummy_options documentation
sim642 Oct 4, 2022
695b36b
Merge branch 'master' into timing
sim642 Oct 7, 2022
5c003f5
Add timing args to race and deadlock warnings
sim642 Oct 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .semgrep/stats.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .semgrep/timing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rules:
- id: cil-stats
pattern-either:
- pattern: Stats.$FUN
- pattern: GoblintCil.Stats.$FUN
fix: Timing.$FUN
message: use Timing instead
languages: [ocaml]
severity: ERROR

- id: timing-time-partial
patterns:
- pattern: Timing.time $NAME $FUNC $ARG $BADARG ...
message: Timing.time measuring only partial, not complete function application (see https://goblint.readthedocs.io/en/latest/developer-guide/profiling/#timing)
languages: [ocaml]
severity: ERROR
6 changes: 4 additions & 2 deletions conf/incremental.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
"trace": {
"context": true
},
"debug": true
"debug": true,
"timing": {
"enabled": true
}
},
"printstats": true,
"result": "none",
"solver": "td3",
"solvers": {
Expand Down
6 changes: 4 additions & 2 deletions conf/minimal_incremental.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
"trace": {
"context": true
},
"debug": true
"debug": true,
"timing": {
"enabled": true
}
},
"printstats": true,
"result": "none",
"solver": "td3",
"solvers": {
Expand Down
6 changes: 5 additions & 1 deletion conf/zstd-race.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@
"inlines": false
}
},
"printstats": true,
"dbg": {
"timing": {
"enabled": true
}
},
"warn": {
"assert": false,
"behavior": false,
Expand Down
26 changes: 18 additions & 8 deletions docs/developer-guide/profiling.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# Profiling

## Stats
`Stats` is an OCaml module from CIL that can be used to profile certain parts of code.
## Timing
`Timing` is an OCaml module (based on CIL's `Stats`) that can be used to profile certain parts of code.

Wrap the function call to be profiled with `Stats.time`. For example, replace
Wrap the function call to be profiled with `Timing.wrap`. For example, replace
```ocaml
f x y z
```
with
```ocaml
Stats.time "mything" (f x y) z
Timing.wrap "mything" (f x y) z
```
where `mything` should be replaced with a relevant name to be shown in the output.
Note that all but the last argument are partially applied to `f`.
The last argument is given separately for `Stats.time` to apply and measure.
The last argument is given separately for `Timing.wrap` to apply and measure.

Then run Goblint with `--enable printstats` or `-v` (verbose) to see the timing stats under `Timings:`.
Then run Goblint with `--enable dbg.timing.enabled` or `-v` (verbose) to see the timing stats under `Timings:`.

The timings are automatically presented as a tree which follows the nesting of `Stats.time` calls.
Unlike [tracing](./debugging.md#tracing), timings cannot be toggled easily, so be considerate of where you leave them after doing the profiling.
The timings are automatically presented as a tree which follows the nesting of `Timing.wrap` calls.
Unlike [tracing](./debugging.md#tracing), timings cannot be toggled easily individually, so be considerate of where you leave them after doing the profiling.

### Trace Event Format
[Trace Event Format (TEF)](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit) is a simple JSON-based format for profiling data.
Besides just accumulating timing information, all timed calls are individually recorded, allowing flamegraph-style visualization.

Goblint can produce a TEF file with
```console
--enable dbg.timing.enabled --set dbg.timing.tef goblint.timing.json
```
Then open `goblint.timing.json` in [Perfetto UI](https://ui.perfetto.dev/).


## perf
Expand Down
2 changes: 2 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
arg-complete
yaml
uuidm
catapult
catapult-file
(conf-gmp (>= 3)) ; only needed transitively, but they don't have lower bound, which is needed on MacOS
(conf-ruby :with-test)
(benchmark :with-test) ; TODO: make this optional somehow, (optional) on bench executable doesn't work
Expand Down
4 changes: 3 additions & 1 deletion goblint.opam
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ depends: [
"arg-complete"
"yaml"
"uuidm"
"catapult"
"catapult-file"
"conf-gmp" {>= "3"}
"conf-ruby" {with-test}
"benchmark" {with-test}
Expand Down Expand Up @@ -72,7 +74,7 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
# also remember to generate/adjust goblint.opam.locked!
available: os-distribution != "alpine" & arch != "arm64"
pin-depends: [
[ "goblint-cil.2.0.0" "git+https://github.com/goblint/cil.git#d4724fe93b0356c611b0b0bd2172210d3f1eeb5b" ]
[ "goblint-cil.2.0.0" "git+https://github.com/goblint/cil.git#bfb977b48d6d92e0ecbdab2e04f2576095506107" ]
# TODO: add back after release, only pinned for optimization (https://github.com/ocaml-ppx/ppx_deriving/pull/252)
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
# TODO: add back after release, only pinned for CI stability
Expand Down
4 changes: 3 additions & 1 deletion goblint.opam.locked
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ depends: [
"bigstringaf" {= "0.8.0"}
"bos" {= "0.2.1"}
"camlidl" {= "1.09"}
"catapult" {= "0.1.1"}
"catapult-file" {= "0.1.1"}
"cmdliner" {= "1.1.1" & with-doc}
"conf-autoconf" {= "0.1"}
"conf-gcc" {= "1.0"}
Expand Down Expand Up @@ -122,7 +124,7 @@ available: os-distribution != "alpine" & arch != "arm64"
pin-depends: [
[
"goblint-cil.2.0.0"
"git+https://github.com/goblint/cil.git#d4724fe93b0356c611b0b0bd2172210d3f1eeb5b"
"git+https://github.com/goblint/cil.git#bfb977b48d6d92e0ecbdab2e04f2576095506107"
]
[
"apron.v0.9.13"
Expand Down
2 changes: 1 addition & 1 deletion goblint.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# also remember to generate/adjust goblint.opam.locked!
available: os-distribution != "alpine" & arch != "arm64"
pin-depends: [
[ "goblint-cil.2.0.0" "git+https://github.com/goblint/cil.git#d4724fe93b0356c611b0b0bd2172210d3f1eeb5b" ]
[ "goblint-cil.2.0.0" "git+https://github.com/goblint/cil.git#bfb977b48d6d92e0ecbdab2e04f2576095506107" ]
# TODO: add back after release, only pinned for optimization (https://github.com/ocaml-ppx/ppx_deriving/pull/252)
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
# TODO: add back after release, only pinned for CI stability
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-incremental-multiple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ conf=$base/$test.json
patch1=$base/${test}_1.patch
patch2=$base/${test}_2.patch

args="--enable dbg.debug --enable printstats -v"
args="--enable dbg.debug --enable dbg.timing.enabled -v"

cat $source

Expand Down
2 changes: 1 addition & 1 deletion scripts/test-incremental.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source=$base/$test.c
conf=$base/$test.json
patch=$base/$test.patch

args="--enable dbg.debug --enable printstats -v --enable allglobs"
args="--enable dbg.debug --enable dbg.timing.enabled -v --enable allglobs"

./goblint --conf $conf $args --enable incremental.save $source &> $base/$test.before.log

Expand Down
10 changes: 5 additions & 5 deletions scripts/update_suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def run_testset (testset, cmd, starttime)

def run
filename = File.basename(@path)
cmd = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --set printstats true --set goblint-dir .goblint-#{@id.sub('/','-')} 2>#{@testset.statsfile}"
cmd = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --enable dbg.timing.enabled --set goblint-dir .goblint-#{@id.sub('/','-')} 2>#{@testset.statsfile}"
starttime = Time.now
run_testset(@testset, cmd, starttime)
end
Expand Down Expand Up @@ -434,8 +434,8 @@ def create_test_set(lines)

def run
filename = File.basename(@path)
cmd = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --set printstats true --enable incremental.save --set goblint-dir .goblint-#{@id.sub('/','-')}-incr-save 2>#{@testset.statsfile}"
cmd_incr = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset_incr.warnfile} --set printstats true --enable incremental.load --set goblint-dir .goblint-#{@id.sub('/','-')}-incr-load 2>#{@testset_incr.statsfile}"
cmd = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --enable dbg.timing.enabled --enable incremental.save --set goblint-dir .goblint-#{@id.sub('/','-')}-incr-save 2>#{@testset.statsfile}"
cmd_incr = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset_incr.warnfile} --enable dbg.timing.enabled --enable incremental.load --set goblint-dir .goblint-#{@id.sub('/','-')}-incr-load 2>#{@testset_incr.statsfile}"
starttime = Time.now
run_testset(@testset_incr, cmd, starttime)
# apply patch
Expand Down Expand Up @@ -478,8 +478,8 @@ def create_test_set(lines)
end
def run ()
filename = File.basename(@path)
cmd1 = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --set printstats true --set save_run run --set goblint-dir .goblint-#{@id.sub('/','-')}-run-save 2>#{@testset.statsfile}"
cmd2 = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --set printstats true --conf run/config.json --set save_run '' --set load_run run --set goblint-dir .goblint-#{@id.sub('/','-')}-run-load 2>#{@testset.statsfile}"
cmd1 = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --enable dbg.timing.enabled --set save_run run --set goblint-dir .goblint-#{@id.sub('/','-')}-run-save 2>#{@testset.statsfile}"
cmd2 = "#{$goblint} #{filename} #{@params} #{ENV['gobopt']} 1>#{@testset.warnfile} --enable dbg.timing.enabled --conf run/config.json --set save_run '' --set load_run run --set goblint-dir .goblint-#{@id.sub('/','-')}-run-load 2>#{@testset.statsfile}"
starttime = Time.now
run_testset(@testset, cmd1, starttime)
run_testset(@testset, cmd2, starttime)
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/accessAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ struct
| `Left g' -> (* accesses *)
(* ignore (Pretty.printf "WarnGlobal %a\n" CilType.Varinfo.pretty g); *)
let accs = G.access (ctx.global g) in
Stats.time "access" (Access.warn_global safe vulnerable unsafe g') accs
Timing.wrap "access" (Access.warn_global safe vulnerable unsafe g') accs
| `Right _ -> (* vars *)
()
end
Expand Down
4 changes: 2 additions & 2 deletions src/analyses/apron/apronAnalysis.apron.ml
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ struct
RH.map (fun _ -> AD.to_oct) m
in
let post_process m =
let m = Stats.time "convert" convert m in
let m = Timing.wrap "convert" convert m in
RH.map (fun _ v -> OctApron.marshal v) m
in
let results = post_process results in
Expand All @@ -615,7 +615,7 @@ struct
let file = GobConfig.get_string "exp.apron.prec-dump" in
if file <> "" then begin
Printf.printf "exp.apron.prec-dump is potentially costly (for domains other than octagons), do not use for performance data!\n";
Stats.time "apron.prec-dump" store_data (Fpath.v file)
Timing.wrap "apron.prec-dump" store_data (Fpath.v file)
end;
Priv.finalize ()
end
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/basePriv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ struct
module G = Priv.G
module V = Priv.V

let time str f arg = Stats.time "priv" (Stats.time str f) arg
let time str f arg = Timing.wrap "priv" (Timing.wrap str f) arg

let startstate = Priv.startstate
let read_global ask getg st x = time "read_global" (Priv.read_global ask getg st) x
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/deadlock.ml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct
end
in

Stats.time "deadlock" (iter_lock LS.empty []) g
Timing.wrap "deadlock" (iter_lock LS.empty []) g
| _ -> Queries.Result.top q
end

Expand Down
2 changes: 1 addition & 1 deletion src/domains/mapDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ module Timed (M: S) : S with
type key = M.key and
type value = M.value =
struct
let time str f arg = GoblintCil.Stats.time (M.name ()) (GoblintCil.Stats.time str f) arg
let time str f arg = Timing.wrap (M.name ()) (Timing.wrap str f) arg

(* Printable.S *)
type t = M.t
Expand Down
2 changes: 1 addition & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(name goblint_lib)
(public_name goblint.lib)
(modules :standard \ goblint mainspec privPrecCompare apronPrecCompare messagesCompare)
(libraries goblint.sites goblint-cil.all-features batteries.unthreaded qcheck-core.runner sha json-data-encoding jsonrpc cpu arg-complete fpath yaml yaml.unix uuidm
(libraries goblint.sites goblint-cil.all-features batteries.unthreaded qcheck-core.runner sha json-data-encoding jsonrpc cpu arg-complete fpath yaml yaml.unix uuidm goblint_timing catapult
; Conditionally compile based on whether apron optional dependency is installed or not.
; Alternative dependencies seem like the only way to optionally depend on optional dependencies.
; See: https://dune.readthedocs.io/en/stable/concepts.html#alternative-dependencies.
Expand Down
11 changes: 3 additions & 8 deletions src/framework/analyses.ml
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,9 @@ struct
BatPrintf.fprintf f "<run>";
BatPrintf.fprintf f "<parameters>%s</parameters>" Goblintutil.command_line;
BatPrintf.fprintf f "<statistics>";
(* FIXME: This is a super ridiculous hack we needed because BatIO has no way to get the raw channel CIL expects here. *)
let name, chn = Filename.open_temp_file "stat" "goblint" in
Stats.print chn "";
Stdlib.close_out chn;
let f_in = BatFile.open_in name in
let s = BatIO.read_all f_in in
BatIO.close_in f_in;
BatPrintf.fprintf f "%s" s;
let timing_ppf = BatFormat.formatter_of_out_channel f in
Timing.Default.print timing_ppf;
Format.pp_print_flush timing_ppf ();
BatPrintf.fprintf f "</statistics>";
BatPrintf.fprintf f "<result>\n";
BatEnum.iter (fun b -> BatPrintf.fprintf f "<file name=\"%s\" path=\"%s\">\n%a</file>\n" (Filename.basename b) b p_funs (SH.find_all file2funs b)) (BatEnum.uniq @@ SH.keys file2funs);
Expand Down
10 changes: 5 additions & 5 deletions src/framework/cfgTools.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ let computeSCCs (module Cfg: CfgBidir) nodes =
);
r

let computeSCCs x = Stats.time "computeSCCs" (computeSCCs x)
let computeSCCs x = Timing.wrap "computeSCCs" (computeSCCs x)

let rec pretty_edges () = function
| [] -> Pretty.dprintf ""
Expand Down Expand Up @@ -359,7 +359,7 @@ let createCFG (file: file) =
| ComputedGoto _ ->
failwith "MyCFG.createCFG: unsupported stmt"
in
Stats.time "handle" (List.iter handle) fd.sallstmts;
Timing.wrap ~args:[("function", `String fd.svar.vname)] "handle" (List.iter handle) fd.sallstmts;

if Messages.tracing then Messages.trace "cfg" "Over\n";

Expand Down Expand Up @@ -436,7 +436,7 @@ let createCFG (file: file) =
else
NH.iter (NH.replace node_scc_global) node_scc; (* there's no merge inplace *)
in
Stats.time "iter_connect" iter_connect ();
Timing.wrap ~args:[("function", `String fd.svar.vname)] "iter_connect" iter_connect ();

(* Verify that function is now connected *)
let reachable_return' = find_backwards_reachable ~initial_size:(NH.keys fd_nodes |> BatEnum.hard_count) (module TmpCfg) (Function fd) in
Expand All @@ -450,7 +450,7 @@ let createCFG (file: file) =
ignore (Pretty.eprintf "cfgF (%a), cfgB (%a)\n" GobHashtbl.pretty_statistics (GobHashtbl.magic_stats cfgF) GobHashtbl.pretty_statistics (GobHashtbl.magic_stats cfgB));
cfgF, cfgB

let createCFG = Stats.time "createCFG" createCFG
let createCFG = Timing.wrap "createCFG" createCFG


let minimizeCFG (fw,bw) =
Expand Down Expand Up @@ -580,7 +580,7 @@ let getCFG (file: file) : cfg * cfg =
let cfgF, cfgB = createCFG file in
let cfgF, cfgB =
if get_bool "exp.mincfg" then
Stats.time "minimizing the cfg" minimizeCFG (cfgF, cfgB)
Timing.wrap "minimizing the cfg" minimizeCFG (cfgF, cfgB)
else
(cfgF, cfgB)
in
Expand Down
8 changes: 7 additions & 1 deletion src/framework/constraints.ml
Original file line number Diff line number Diff line change
Expand Up @@ -690,12 +690,18 @@ struct

let tf (v,c) (e,u) getl sidel getg sideg =
let old_node = !current_node in
let old_fd = Option.map Node.find_fundec old_node |? Cil.dummyFunDec in
let new_fd = Node.find_fundec v in
if not (CilType.Fundec.equal old_fd new_fd) then
Timing.Program.enter new_fd.svar.vname;
let old_context = !M.current_context in
current_node := Some u;
M.current_context := Some (Obj.repr c);
Fun.protect ~finally:(fun () ->
current_node := old_node;
M.current_context := old_context
M.current_context := old_context;
if not (CilType.Fundec.equal old_fd new_fd) then
Timing.Program.exit new_fd.svar.vname
) (fun () ->
let d = tf (v,c) (e,u) getl sidel getg sideg in
d
Expand Down
8 changes: 4 additions & 4 deletions src/framework/control.ml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ struct

let startstate, more_funs =
if (get_bool "dbg.verbose") then print_endline ("Initializing "^string_of_int (CfgTools.numGlobals file)^" globals.");
Stats.time "global_inits" do_global_inits file
Timing.wrap "global_inits" do_global_inits file
in

let otherfuns = if get_bool "kernel" then otherfuns @ more_funs else otherfuns in
Expand Down Expand Up @@ -463,7 +463,7 @@ struct
if get_bool "dbg.verbose" then
print_endline ("Solving the constraint system with " ^ get_string "solver" ^ ". Solver statistics are shown every " ^ string_of_int (get_int "dbg.solver-stats-interval") ^ "s or by signal " ^ get_string "dbg.solver-signal" ^ ".");
Goblintutil.should_warn := get_string "warn_at" = "early" || gobview;
let (lh, gh), solver_data = Stats.time "solving" (Slvr.solve entrystates entrystates_global) startvars' in
let (lh, gh), solver_data = Timing.wrap "solving" (Slvr.solve entrystates entrystates_global) startvars' in
if GobConfig.get_bool "incremental.save" then
Serialize.Cache.(update_data SolverData solver_data);
if save_run_str <> "" then (
Expand Down Expand Up @@ -494,7 +494,7 @@ struct
Serialize.marshal MCPRegistry.registered_name analyses;
Serialize.marshal (file, Cabs2cil.environment) cil;
Serialize.marshal !Messages.Table.messages_list warnings;
Serialize.marshal (Stats.top, Gc.quick_stat ()) stats
Serialize.marshal (Timing.Default.root, Gc.quick_stat ()) stats
);
Goblintutil.(self_signal (signal_of_string (get_string "dbg.solver-signal"))); (* write solver_stats after solving (otherwise no rows if faster than dbg.solver-stats-interval). TODO better way to write solver_stats without terminal output? *)
);
Expand Down Expand Up @@ -645,7 +645,7 @@ struct
| `Right _ -> (* contexts global *)
()
in
Stats.time "warn_global" (GHT.iter warn_global) gh;
Timing.wrap "warn_global" (GHT.iter warn_global) gh;

if get_bool "ana.sv-comp.enabled" then
WResult.write lh gh entrystates;
Expand Down
Loading