Skip to content

Commit

Permalink
Merge pull request #106 from garazdawi/master
Browse files Browse the repository at this point in the history
Include erts_mmap in snapshot to help debug VM issues
  • Loading branch information
ferd authored Aug 31, 2023
2 parents 9efec26 + 3403b1b commit 954cf71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
image: erlang:${{matrix.otp_vsn}}
strategy:
matrix:
otp_vsn: ['18.3', '19.3', '20.3', '21.3', '22.3', '23.3', '24.0', '25.0']
otp_vsn: ['18.3', '19.3', '20.3', '21.3', '22.3', '23.3', '24.3', '25.3', '26.0.2']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions src/recon.erl
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ source(Module) ->
Path = code:which(Module),
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(Path, [abstract_code]),
erl_prettypr:format(erl_syntax:form_list(AC)).
-dialyzer({nowarn_function, source/1}).

%%% Ports Info %%%

Expand Down
14 changes: 9 additions & 5 deletions src/recon_alloc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,13 @@ sbcs_to_mbcs(Keyword) ->
allocators() ->
UtilAllocators = erlang:system_info(alloc_util_allocators),
Allocators = [sys_alloc,mseg_alloc|UtilAllocators],
[{{A,N}, format_alloc(A, Props)} ||
A <- Allocators,
Allocs <- [erlang:system_info({allocator,A})],
Allocs =/= false,
{_,N,Props} <- Allocs].
try [{{erts_mmap,0},erlang:system_info({allocator,erts_mmap})}]
catch error:badarg -> [] end ++
[{{A,N}, format_alloc(A, Props)} ||
A <- Allocators,
Allocs <- [erlang:system_info({allocator,A})],
Allocs =/= false,
{_,N,Props} <- Allocs].

format_alloc(Alloc, Props) ->
%% {versions,_,_} is implicitly deleted in order to allow the use of the
Expand Down Expand Up @@ -638,6 +640,8 @@ conv_mem(Mem,Factor) ->

conv_alloc([{{sys_alloc,_I},_Props} = Alloc|R], Factor) ->
[Alloc|conv_alloc(R,Factor)];
conv_alloc([{{erts_mmap,_I},_Props} = Alloc|R], Factor) ->
[Alloc|conv_alloc(R,Factor)];
conv_alloc([{{mseg_alloc,_I} = AI,Props}|R], Factor) ->
MemKind = orddict:fetch(memkind,Props),
Status = orddict:fetch(status,MemKind),
Expand Down

0 comments on commit 954cf71

Please sign in to comment.