diff --git a/src/client/opamSolution.ml b/src/client/opamSolution.ml index b32b6635666..554fa320a00 100644 --- a/src/client/opamSolution.ml +++ b/src/client/opamSolution.ml @@ -246,6 +246,7 @@ let display_error (n, error) = module Json = struct let output_request request user_action = + OpamTrace.with_span "Solution.Json.output_request" @@ fun () -> if OpamClientConfig.(!r.json_out = None) then () else let atoms = List.map (fun a -> `String (OpamFormula.short_string_of_atom a)) @@ -264,6 +265,7 @@ module Json = struct OpamJson.append "request" j let output_solution t solution = + OpamTrace.with_span "Solution.Json.output_solution" @@ fun () -> if OpamClientConfig.(!r.json_out = None) then () else match solution with | Success solution -> diff --git a/src/solver/opamCudf.ml b/src/solver/opamCudf.ml index 9f6f8390ef8..8205418799b 100644 --- a/src/solver/opamCudf.ml +++ b/src/solver/opamCudf.ml @@ -1524,6 +1524,7 @@ let call_external_solver ~version_map univ req = Dose_algo.Depsolver.Sat(None,Cudf.load_universe []) let check_request ?(explain=true) ~version_map univ req = + OpamTrace.with_span "Cudf.check_request" @@ fun () -> let chrono = OpamConsole.timer () in log "Checking request..."; let result = Dose_algo.Depsolver.check_request ~explain (to_cudf univ req) in @@ -1546,6 +1547,7 @@ let check_request ?(explain=true) ~version_map univ req = (* Return the universe in which the system has to go *) let get_final_universe ~version_map univ req = + OpamTrace.with_span "Cudf.get_final_universe" @@ fun () -> let fail msg = let f = dump_cudf_error ~version_map univ req in let msg = @@ -1593,6 +1595,7 @@ let actions_of_diff (install, remove) = actions let resolve ~extern ~version_map universe request = + OpamTrace.with_span "Cudf.resolve" @@ fun () -> log "resolve request=%a" (slog string_of_request) request; let resp = let check () = check_request ~version_map universe request in diff --git a/src/solver/opamSolver.ml b/src/solver/opamSolver.ml index dbf2283f26d..8b789f4d9b8 100644 --- a/src/solver/opamSolver.ml +++ b/src/solver/opamSolver.ml @@ -331,6 +331,7 @@ let opam2cudf_set universe version_map packages = OpamCudf.Set.empty let load_cudf_packages opam_universe ?version_map opam_packages = + OpamTrace.with_span "Solver.load_cudf_packages" @@ fun () -> let chrono = OpamConsole.timer () in let version_map = match version_map with | Some vm -> vm @@ -367,6 +368,7 @@ let map_to_cudf_universe cudf_packages_map = (* load a cudf universe from an opam one *) let load_cudf_universe opam_universe ?version_map opam_packages = + OpamTrace.with_span "Solver.load_cudf_universe" @@ fun () -> let load_f = load_cudf_packages opam_universe ?version_map opam_packages in fun ?add_invariant ?depopts ~build ~post () -> log "Load cudf universe (depopts:%a, build:%b, post:%b)" @@ -436,6 +438,7 @@ let cycle_conflict ~version_map univ cycles = OpamCudf.cycle_conflict ~version_map univ cycles let resolve universe request = + OpamTrace.with_span "Solver.resolve" @@ fun () -> log "resolve request=%a" (slog string_of_request) request; let all_packages = universe.u_available ++ universe.u_installed in let version_map = cudf_versions_map universe in @@ -464,6 +467,7 @@ let resolve universe request = opam_invariant_package version_map universe.u_invariant in let solution = + OpamTrace.with_span "Solver.resolve.solution" @@ fun () -> try Cudf.add_package cudf_universe invariant_pkg; Cudf.add_package cudf_universe deprequest_pkg; diff --git a/src/state/opamSwitchState.ml b/src/state/opamSwitchState.ml index a03d187b1da..07c995124fa 100644 --- a/src/state/opamSwitchState.ml +++ b/src/state/opamSwitchState.ml @@ -945,6 +945,7 @@ let universe st ?reinstall ~requested user_action = + OpamTrace.with_span "SwitchState.universe" @@ fun () -> let chrono = OpamConsole.timer () in let names = OpamPackage.names_of_packages requested in let requested_allpkgs =