Tabulation.log_call_trace: do nothing if footprint is false

Reviewed By: jvillard

Differential Revision: D9218172

fbshipit-source-id: aad5109e4
master
Mehdi Bouaziz 7 years ago committed by Facebook Github Bot
parent 8a6aa4b1fd
commit 66d37a496a

@ -82,36 +82,37 @@ let print_results tenv actual_pre results =
let log_call_trace ~caller_name ~callee_name ?callee_attributes ?reason ?dynamic_dispatch loc res = let log_call_trace ~caller_name ~callee_name ?callee_attributes ?reason ?dynamic_dispatch loc res =
let get_valid_source_file loc = if !Config.footprint then
let file = loc.Location.file in let get_valid_source_file loc =
if SourceFile.is_invalid file then None else Some file let file = loc.Location.file in
in if SourceFile.is_invalid file then None else Some file
let callee_clang_method_kind, callee_source_file = in
match callee_attributes with let callee_clang_method_kind, callee_source_file =
| Some attributes when Language.curr_language_is Language.Clang -> match callee_attributes with
let callee_clang_method_kind = | Some attributes when Language.curr_language_is Language.Clang ->
ProcAttributes.string_of_clang_method_kind attributes.ProcAttributes.clang_method_kind let callee_clang_method_kind =
in ProcAttributes.string_of_clang_method_kind attributes.ProcAttributes.clang_method_kind
let callee_source_file = get_valid_source_file attributes.ProcAttributes.loc in in
(Some callee_clang_method_kind, callee_source_file) let callee_source_file = get_valid_source_file attributes.ProcAttributes.loc in
| Some attributes -> (Some callee_clang_method_kind, callee_source_file)
(None, get_valid_source_file attributes.ProcAttributes.loc) | Some attributes ->
| None -> (None, get_valid_source_file attributes.ProcAttributes.loc)
(None, None) | None ->
in (None, None)
let call_trace = in
EventLogger.CallTrace let call_trace =
{ call_location= loc EventLogger.CallTrace
; call_result= string_of_call_result res { call_location= loc
; callee_clang_method_kind ; call_result= string_of_call_result res
; callee_source_file ; callee_clang_method_kind
; callee_name= Typ.Procname.to_string callee_name ; callee_source_file
; caller_name= Typ.Procname.to_string caller_name ; callee_name= Typ.Procname.to_string callee_name
; lang= Typ.Procname.get_language caller_name |> Language.to_explicit_string ; caller_name= Typ.Procname.to_string caller_name
; reason ; lang= Typ.Procname.get_language caller_name |> Language.to_explicit_string
; dynamic_dispatch } ; reason
in ; dynamic_dispatch }
if !Config.footprint then EventLogger.log call_trace in
EventLogger.log call_trace
(***************) (***************)

Loading…
Cancel
Save