[reporting] log reason for skipping call in EventLogger.CallTrace

Summary: - When a CallTrace result is CR_skip, then a reason for skipping the call will be included in the record

Reviewed By: dulmarod

Differential Revision: D7082572

fbshipit-source-id: 20ed191
master
Varun Arora 7 years ago committed by Facebook Github Bot
parent cbf9e3b88b
commit 7721280fa7

@ -1081,7 +1081,7 @@ let rec sym_exec tenv current_pdesc instr_ (prop_: Prop.normal Prop.t) path
() ()
| Some summary -> | Some summary ->
let proc_name = Specs.get_proc_name summary in let proc_name = Specs.get_proc_name summary in
Tabulation.log_call_trace proc_name callee_pname loc Tabulation.CR_skip ) ; Tabulation.log_call_trace proc_name callee_pname ~reason loc Tabulation.CR_skip ) ;
unknown_or_scan_call ~is_scan:false ~reason ret_typ_opt ret_annots unknown_or_scan_call ~is_scan:false ~reason ret_typ_opt ret_annots
Builtin. Builtin.
{ pdesc= current_pdesc { pdesc= current_pdesc

@ -83,14 +83,15 @@ let print_results tenv actual_pre results =
L.d_strln "***** END RESULTS FUNCTION CALL *******" L.d_strln "***** END RESULTS FUNCTION CALL *******"
let log_call_trace caller_name callee_name loc res = let log_call_trace caller_name callee_name ?reason loc res =
let call_trace = let call_trace =
EventLogger.CallTrace EventLogger.CallTrace
{ call_location= loc { call_location= loc
; call_result= string_of_call_result res ; call_result= string_of_call_result res
; callee_name= Typ.Procname.to_string callee_name ; callee_name= Typ.Procname.to_string callee_name
; caller_name= Typ.Procname.to_string caller_name ; caller_name= Typ.Procname.to_string caller_name
; lang= Typ.Procname.get_language caller_name |> Language.to_explicit_string } ; lang= Typ.Procname.get_language caller_name |> Language.to_explicit_string
; reason }
in in
if !Config.footprint then EventLogger.log call_trace if !Config.footprint then EventLogger.log call_trace

@ -17,7 +17,8 @@ type call_result =
| CR_not_found (** the callee has no specs *) | CR_not_found (** the callee has no specs *)
| CR_skip (** the callee was skipped *) | CR_skip (** the callee was skipped *)
val log_call_trace : Typ.Procname.t -> Typ.Procname.t -> Location.t -> call_result -> unit val log_call_trace :
Typ.Procname.t -> Typ.Procname.t -> ?reason:string -> Location.t -> call_result -> unit
(** Interprocedural footprint analysis *) (** Interprocedural footprint analysis *)

@ -110,7 +110,8 @@ type call_trace =
; call_result: string ; call_result: string
; callee_name: string ; callee_name: string
; caller_name: string ; caller_name: string
; lang: string } ; lang: string
; reason: string option }
let create_call_trace_row base record = let create_call_trace_row base record =
let open JsonBuilder in let open JsonBuilder in
@ -123,7 +124,7 @@ let create_call_trace_row base record =
|> add_string ~key:"call_result" ~data:record.call_result |> add_string ~key:"call_result" ~data:record.call_result
|> add_string ~key:"callee_name" ~data:record.callee_name |> add_string ~key:"callee_name" ~data:record.callee_name
|> add_string ~key:"caller_name" ~data:record.caller_name |> add_string ~key:"caller_name" ~data:record.caller_name
|> add_string ~key:"lang" ~data:record.lang |> add_string ~key:"lang" ~data:record.lang |> add_string_opt ~key:"reason" ~data:record.reason
type frontend_exception = type frontend_exception =

@ -23,7 +23,8 @@ type call_trace =
; call_result: string ; call_result: string
; callee_name: string ; callee_name: string
; caller_name: string ; caller_name: string
; lang: string } ; lang: string
; reason: string option }
type frontend_exception = type frontend_exception =
{ ast_node: string option { ast_node: string option

Loading…
Cancel
Save