Add --scheduler option

Reviewed By: ngorogiannis

Differential Revision: D19330599

fbshipit-source-id: f185b92ab
master
Fernando Gasperi Jabalera 5 years ago committed by Facebook Github Bot
parent b8d51b0493
commit 87b29a2d72

@ -1690,6 +1690,9 @@ INTERNAL OPTIONS
Reset the list of folders containing linters definitions to be Reset the list of folders containing linters definitions to be
empty (see linters-def-folder). empty (see linters-def-folder).
--scheduler { File | SyntacticCallGraph }
Specify the scheduler used for the analysis phase
--scuba-logging --scuba-logging
Activates: (direct) logging to scuba (Conversely: Activates: (direct) logging to scuba (Conversely:
--no-scuba-logging) --no-scuba-logging)

@ -11,6 +11,7 @@
open! IStd open! IStd
module F = Format module F = Format
module L = Logging module L = Logging
module CLOpt = CommandLineOption
let clear_caches () = let clear_caches () =
Ondemand.LocalCache.clear () ; Summary.OnDisk.clear_cache () ; Procname.SQLite.clear_cache () Ondemand.LocalCache.clear () ; Summary.OnDisk.clear_cache () ; Procname.SQLite.clear_cache ()
@ -113,11 +114,15 @@ let get_source_files_to_analyze ~changed_files =
let schedule sources = let schedule sources =
if Config.call_graph_schedule then if Config.call_graph_schedule then (
ProcessPool.TaskGenerator.chain CLOpt.warnf "WARNING: '--call-graph-schedule' is deprecated. Use '--scheduler' instead.@." ;
(SyntacticCallGraph.bottom_up sources) SyntacticCallGraph.make sources )
(FileScheduler.make sources) else
else FileScheduler.make sources match Config.scheduler with
| SyntacticCallGraph ->
SyntacticCallGraph.make sources
| File ->
FileScheduler.make sources
let analyze source_files_to_analyze = let analyze source_files_to_analyze =

@ -108,3 +108,6 @@ let bottom_up sources : SchedulerTypes.target ProcessPool.TaskGenerator.t =
next_aux () next_aux ()
in in
{remaining_tasks; is_empty; finished; next} {remaining_tasks; is_empty; finished; next}
let make sources = ProcessPool.TaskGenerator.chain (bottom_up sources) (FileScheduler.make sources)

@ -6,7 +6,7 @@
*) *)
open! IStd open! IStd
val bottom_up : SourceFile.t list -> SchedulerTypes.target ProcessPool.TaskGenerator.t val make : SourceFile.t list -> SchedulerTypes.target ProcessPool.TaskGenerator.t
(** task generator that works by (** task generator that works by
- loading the syntactic call graph from the capture DB - loading the syntactic call graph from the capture DB

@ -92,6 +92,8 @@ type build_system =
| BXcode | BXcode
[@@deriving compare] [@@deriving compare]
type scheduler = File | SyntacticCallGraph [@@deriving equal]
let equal_build_system = [%compare.equal: build_system] let equal_build_system = [%compare.equal: build_system]
(* List of ([build system], [executable name]). Several executables may map to the same build (* List of ([build system], [executable name]). Several executables may map to the same build
@ -2353,6 +2355,12 @@ and export_changed_functions_output =
"Name of file for export-changed-functions results" "Name of file for export-changed-functions results"
and scheduler =
CLOpt.mk_symbol ~long:"scheduler" ~default:File ~eq:equal_scheduler
~symbols:[("File", File); ("SyntacticCallGraph", SyntacticCallGraph)]
"Specify the scheduler used for the analysis phase"
and test_filtering = and test_filtering =
CLOpt.mk_bool ~deprecated:["test_filtering"] ~long:"test-filtering" CLOpt.mk_bool ~deprecated:["test_filtering"] ~long:"test-filtering"
"List all the files Infer can report on (should be called from the root of the project)" "List all the files Infer can report on (should be called from the root of the project)"
@ -3167,14 +3175,16 @@ and resource_leak = !resource_leak
and results_dir = !results_dir and results_dir = !results_dir
and seconds_per_iteration = !seconds_per_iteration and scheduler = !scheduler
and select = !select
and scuba_logging = !scuba_logging and scuba_logging = !scuba_logging
and scuba_normals = !scuba_normals and scuba_normals = !scuba_normals
and seconds_per_iteration = !seconds_per_iteration
and select = !select
and show_buckets = !print_buckets and show_buckets = !print_buckets
and siof = !siof and siof = !siof

@ -25,6 +25,8 @@ type build_system =
| BNdk | BNdk
| BXcode | BXcode
type scheduler = File | SyntacticCallGraph [@@deriving equal]
val equal_build_system : build_system -> build_system -> bool val equal_build_system : build_system -> build_system -> bool
val build_system_of_exe_name : string -> build_system val build_system_of_exe_name : string -> build_system
@ -604,6 +606,8 @@ val rest : string list
val results_dir : string val results_dir : string
val scheduler : scheduler
val scuba_logging : bool val scuba_logging : bool
val scuba_normals : string String.Map.t val scuba_normals : string String.Map.t

Loading…
Cancel
Save