Skip to content

Commit

Permalink
Merge pull request #12 from vtjnash/master
Browse files Browse the repository at this point in the history
Use public API to lookup frames
  • Loading branch information
NHDaly authored Sep 6, 2019
2 parents 203b0af + 13d6dc6 commit 6112f40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PProf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6112f40

Please sign in to comment.