Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Sep 10, 2024
1 parent 838e16e commit ab19400
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/PProf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ function pprof(data::Union{Nothing, Vector{UInt}} = nothing,
idx -= (Profile.nmeta + 2) # skip all the metas, plus the 2 nulls that end a block.
continue
elseif data[idx] == 0
if has_meta
# This should never happen in has_meta mode
@error "Unexpected 0 in data, please file an issue." idx
continue
end
# Avoid creating empty samples
# ip == 0x0 is the sentinel value for finishing a backtrace (when meta is disabled), therefore finising a sample
# On some platforms, we sometimes get two 0s in a row for some reason...
Expand Down Expand Up @@ -274,10 +279,8 @@ function pprof(data::Union{Nothing, Vector{UInt}} = nothing,
end
file = Base.find_source_file(file)
filename = enter!(file)
# Only keep C functions if from_c=true
#if (from_c || !location_from_c)
funcs[func_id] = Function(func_id, name, system_name, filename, start_line)
#end
# Decode C functions always
funcs[func_id] = Function(func_id, name, system_name, filename, start_line)
end
locs_from_c[ip] = location_from_c
# Only keep C frames if from_c=true
Expand Down

0 comments on commit ab19400

Please sign in to comment.