diff options
author | John Högberg <[email protected]> | 2019-08-16 09:42:58 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-08-16 09:42:58 +0200 |
commit | 062c4d68a6d18b399714c477d329093dec10aedf (patch) | |
tree | 43e8e8b722fcd9e8a3412e2bd8662ac4e6ab7fb0 | |
parent | 29852da8ef813ece12137e6477abed838c4d56c6 (diff) | |
parent | f93b97cc5c6bee800f4b671cc4bb7ee6250c9c94 (diff) | |
download | otp-062c4d68a6d18b399714c477d329093dec10aedf.tar.gz otp-062c4d68a6d18b399714c477d329093dec10aedf.tar.bz2 otp-062c4d68a6d18b399714c477d329093dec10aedf.zip |
Merge branch 'john/erts/process_info-binary-heap-fragments/OTP-15978' into maint
* john/erts/process_info-binary-heap-fragments/OTP-15978:
erts: Scan heap fragments for off-heap binaries
-rw-r--r-- | erts/emulator/beam/erl_bif_info.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c index 0339589b79..4d8c3eb9dd 100644 --- a/erts/emulator/beam/erl_bif_info.c +++ b/erts/emulator/beam/erl_bif_info.c @@ -162,10 +162,10 @@ static Eterm current_stacktrace(ErtsHeapFactory *hfact, Process* rp, Uint reserve_size); static Eterm -bld_bin_list(Uint **hpp, Uint *szp, ErlOffHeap* oh) +bld_bin_list(Uint **hpp, Uint *szp, ErlOffHeap* oh, Eterm tail) { struct erl_off_heap_header* ohh; - Eterm res = NIL; + Eterm res = tail; Eterm tuple; for (ohh = oh->first; ohh; ohh = ohh->next) { @@ -1864,11 +1864,25 @@ process_info_aux(Process *c_p, break; case ERTS_PI_IX_BINARY: { - Uint sz = 0; - (void) bld_bin_list(NULL, &sz, &MSO(rp)); + ErlHeapFragment *hfrag; + Uint sz; + + res = NIL; + sz = 0; + + (void)bld_bin_list(NULL, &sz, &MSO(rp), NIL); + for (hfrag = rp->mbuf; hfrag != NULL; hfrag = hfrag->next) { + (void)bld_bin_list(NULL, &sz, &hfrag->off_heap, NIL); + } + hp = erts_produce_heap(hfact, sz, reserve_size); - res = bld_bin_list(&hp, NULL, &MSO(rp)); - break; + + res = bld_bin_list(&hp, NULL, &MSO(rp), NIL); + for (hfrag = rp->mbuf; hfrag != NULL; hfrag = hfrag->next) { + res = bld_bin_list(&hp, NULL, &hfrag->off_heap, res); + } + + break; } case ERTS_PI_IX_SEQUENTIAL_TRACE_TOKEN: { |