From 08ba3e2acb81b779fc3bf71b5a8c81cb09429c16 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Tue, 21 May 2019 09:04:23 -0700 Subject: [PATCH] [callgraph] log a bit more Reviewed By: mbouaziz Differential Revision: D15431944 fbshipit-source-id: 7e06a0e2c --- infer/src/backend/InferAnalyze.ml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/infer/src/backend/InferAnalyze.ml b/infer/src/backend/InferAnalyze.ml index a502c6b4f..12715706e 100644 --- a/infer/src/backend/InferAnalyze.ml +++ b/infer/src/backend/InferAnalyze.ml @@ -24,10 +24,18 @@ let analyze_target : TaskScheduler.target Tasks.doer = Callbacks.analyze_file exe_env source_file ; if Config.write_html then Printer.write_all_html_files source_file ) in + (* In call-graph scheduling, log progress every [per_procedure_logging_granularity] procedures. + The default roughly reflects the average number of procedures in a C++ file. *) + let per_procedure_logging_granularity = 200 in + (* [procs_left] is set to 1 so that we log the first procedure sent to us. *) + let procs_left = ref 1 in let analyze_proc_name exe_env proc_name = - L.debug Analysis Verbose "%a starting@." Typ.Procname.pp proc_name ; - Callbacks.analyze_proc_name exe_env proc_name ; - L.debug Analysis Verbose "%a DONE@." Typ.Procname.pp proc_name + decr procs_left ; + if Int.( <= ) !procs_left 0 then ( + L.progress "Analysing block of %d procs, starting with %a@." + per_procedure_logging_granularity Typ.Procname.pp proc_name ; + procs_left := per_procedure_logging_granularity ) ; + Callbacks.analyze_proc_name exe_env proc_name in fun target -> if Config.memcached then Memcached.connect () ;