From 13d6dc67a0c139572cbd7a5e432af7fdf3cd3b42 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Fri, 6 Sep 2019 16:42:01 -0400 Subject: [PATCH] Use public API to lookup frames --- src/PProf.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PProf.jl b/src/PProf.jl index 1a2ac77..264c8f7 100644 --- a/src/PProf.jl +++ b/src/PProf.jl @@ -56,7 +56,7 @@ function _enter!(dict::OrderedDict{T, Int64}, key::T) where T end end -using Base.StackTraces: lookup, StackFrame +using Base.StackTraces: StackFrame # TODO: # - Mappings @@ -101,6 +101,7 @@ function pprof(data::Union{Nothing, Vector{UInt}} = nothing, if data === nothing data = copy(Profile.fetch()) end + lookup = Profile.getdict(data) if period === nothing period = ccall(:jl_profile_delay_nsec, UInt64, ()) end @@ -181,7 +182,7 @@ function pprof(data::Union{Nothing, Vector{UInt}} = nothing, # Decode the IP into information about this stack frame (or frames given inlining) location = Location(;id = ip, address = ip, line=[]) location_from_c = true - for frame in lookup(ip) + for frame in lookup[ip] # ip 0 is reserved frame.pointer == 0 && continue # if any of the frames is not from_c the entire location is not from_c