Skip to content

Commit

Permalink
WIP - Support for reentrant, concurrent snoopi_deep profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
NHDaly committed Oct 20, 2022
1 parent b4bf95b commit 3f564d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,20 @@ end # module Timings

__start_measuring_typeinf() = @atomic Timings.__measuring_typeinf.count += 1
__stop_measuring_typeinf() = @atomic Timings.__measuring_typeinf.count -= 1
__measure_typeinf() = @atomic Timings.__measuring_typeinf.count
__measure_typeinf() = @atomic(Timings.__measuring_typeinf.count) > 0
# DEPRECATED:
__set_measure_typeinf(onoff::Bool) = onoff ? __start_measuring_typeinf() : __stop_measuring_typeinf()

# Wrapper around _typeinf that optionally records the exclusive time for each invocation.
function typeinf(interp::AbstractInterpreter, frame::InferenceState)
if __measure_typeinf__[]
if __measure_typeinf()
Core.println( "MEASURING TYPEINF")
Timings.enter_new_timer(frame)
v = _typeinf(interp, frame)
Timings.exit_current_timer(frame)
return v
else
Core.println( "NOT MEASURING TYPEINF")
return _typeinf(interp, frame)
end
end
Expand Down

0 comments on commit 3f564d5

Please sign in to comment.