From 6c035e398870a95512591afec8e8510e51fc3c73 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Thu, 6 Aug 2020 10:10:54 -0700 Subject: [PATCH] [infer] Add max-jobs option Summary: This diff adds an option `max-jobs` that restrict the number of jobs running simultaneously. Reviewed By: ngorogiannis Differential Revision: D22978328 fbshipit-source-id: 544153c1c --- infer/man/man1/infer-analyze.txt | 3 +++ infer/man/man1/infer-full.txt | 7 +++++++ infer/man/man1/infer.txt | 4 ++++ infer/src/base/Config.ml | 8 +++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/infer/man/man1/infer-analyze.txt b/infer/man/man1/infer-analyze.txt index 4f3e05c5e..47790de62 100644 --- a/infer/man/man1/infer-analyze.txt +++ b/infer/man/man1/infer-analyze.txt @@ -209,6 +209,9 @@ OPTIONS Activates: Enable loop-hoisting and disable all other checkers (Conversely: --no-loop-hoisting-only) + --max-jobs int + Maximum number of analysis jobs running simultaneously + --perf-profiler-data-file file DEPRECATED: Specify the file containing perf profiler data to read diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index 7778e21a9..20dd2897d 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -783,6 +783,10 @@ OPTIONS Activates: Enable loop-hoisting and disable all other checkers (Conversely: --no-loop-hoisting-only) See also infer-analyze(1). + --max-jobs int + Maximum number of analysis jobs running simultaneously + See also infer-analyze(1). + --max-nesting int Level of nested procedure calls to show. Trace elements beyond the maximum nesting level are skipped. If omitted, all levels are @@ -1546,6 +1550,9 @@ INTERNAL OPTIONS --margin int Set right margin for the pretty printing functions + --max-jobs-reset + Cancel the effect of --max-jobs. + --max-nesting-reset Cancel the effect of --max-nesting. diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index ea8cf2a34..1fa0b007f 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -783,6 +783,10 @@ OPTIONS Activates: Enable loop-hoisting and disable all other checkers (Conversely: --no-loop-hoisting-only) See also infer-analyze(1). + --max-jobs int + Maximum number of analysis jobs running simultaneously + See also infer-analyze(1). + --max-nesting int Level of nested procedure calls to show. Trace elements beyond the maximum nesting level are skipped. If omitted, all levels are diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 6e3a158c4..74ce06087 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1563,6 +1563,12 @@ and margin = "Set right margin for the pretty printing functions" +and max_jobs = + CLOpt.mk_int_opt ~long:"max-jobs" + ~in_help:InferCommand.[(Analyze, manual_generic)] + ~meta:"int" "Maximum number of analysis jobs running simultaneously" + + and max_nesting = CLOpt.mk_int_opt ~long:"max-nesting" ~in_help:InferCommand.[(Explore, manual_explore_bugs)] @@ -2867,7 +2873,7 @@ and javac_classes_out = !javac_classes_out and job_id = !job_id -and jobs = !jobs +and jobs = Option.fold !max_jobs ~init:!jobs ~f:min and join_cond = !join_cond