Logging number of procedure summaries invalidated for incremental analysis

Summary:
Add logging for the number of procedures whose summaries are invalidated by incremental analysis

This will help verify that incremental analysis is working as expected in production

Reviewed By: ngorogiannis

Differential Revision: D16686911

fbshipit-source-id: 53c89c3bb
master
Phoebe Nichols 6 years ago committed by Facebook Github Bot
parent 8286347ebf
commit 085ffa166e

@ -163,8 +163,8 @@ let get_unflagged_leaves g =
g.node_map []
let iter_flagged graph ~f =
NodeMap.iter (fun _id node -> if node.Node.flag then f node else ()) graph.node_map
let fold_flagged graph ~f =
NodeMap.fold (fun _id node acc -> if node.Node.flag then f node acc else acc) graph.node_map
(** choose some reasonable minimum capacity that also is a prime number *)

@ -63,8 +63,8 @@ val add_edge : t -> pname:Typ.Procname.t -> successor_pname:Typ.Procname.t -> un
val create_node : t -> Typ.Procname.t -> Typ.Procname.t sexp_list -> unit
(** create a new node with edges from [pname] to [successor_pnames] in the graph *)
val iter_flagged : t -> f:(Node.t -> unit) -> unit
(** iterate over the nodes in the graph with flag set to true *)
val fold_flagged : t -> f:(Node.t -> 'a -> 'a) -> 'a -> 'a
(** perform a fold over the nodes in the graph with flag set to true *)
val default_initial_capacity : int
(** reasonable minimum capacity for the graph that is prime *)

@ -145,6 +145,7 @@ let invalidate_changed_procedures changed_files =
L.progress "Incremental analysis: invalidating procedures that have been changed@." ;
let reverse_callgraph = CallGraph.create CallGraph.default_initial_capacity in
ReverseAnalysisCallGraph.build reverse_callgraph ;
let total_nodes = CallGraph.n_procs reverse_callgraph in
SourceFile.Set.iter
(fun sf ->
SourceFiles.proc_names_of_source sf
@ -152,7 +153,14 @@ let invalidate_changed_procedures changed_files =
changed_files ;
if Config.debug_level_analysis > 0 then
CallGraph.to_dotty reverse_callgraph "reverse_analysis_callgraph.dot" ;
CallGraph.iter_flagged reverse_callgraph ~f:(fun node -> SpecsFiles.delete node.pname) ;
let invalidated_nodes =
CallGraph.fold_flagged reverse_callgraph
~f:(fun node acc -> SpecsFiles.delete node.pname ; acc + 1)
0
in
L.progress
"Incremental analysis: %d nodes in reverse analysis call graph, %d of which were invalidated @."
total_nodes invalidated_nodes ;
(* save some memory *)
CallGraph.reset reverse_callgraph

Loading…
Cancel
Save