aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test/crashdump_helper.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-11-27 16:55:06 +0100
committerSiri Hansen <[email protected]>2018-11-27 16:55:06 +0100
commitefee45e4381ce1d1fc459e1eb651df8c5b0c03bc (patch)
treebdde717bbb6a7ff9f822cc7ed6655937c50f7488 /lib/observer/test/crashdump_helper.erl
parent4869ba5939c43cddae487ed5da0951b1d6fbac1e (diff)
parentc9c1efe3815a49eb59ef62e8319cd9f6ea6c67d8 (diff)
downloadotp-efee45e4381ce1d1fc459e1eb651df8c5b0c03bc.tar.gz
otp-efee45e4381ce1d1fc459e1eb651df8c5b0c03bc.tar.bz2
otp-efee45e4381ce1d1fc459e1eb651df8c5b0c03bc.zip
Merge branch 'siri/cdv/div-bugfixes/OTP-15391' into maint
* siri/cdv/div-bugfixes/OTP-15391: [cdv] Handle multiple "Yc" lines refering to the same refc binary [cdv] Speed up reading of dump with many processes
Diffstat (limited to 'lib/observer/test/crashdump_helper.erl')
-rw-r--r--lib/observer/test/crashdump_helper.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/observer/test/crashdump_helper.erl b/lib/observer/test/crashdump_helper.erl
index 576d112154..d5d3649525 100644
--- a/lib/observer/test/crashdump_helper.erl
+++ b/lib/observer/test/crashdump_helper.erl
@@ -64,6 +64,7 @@ n1_proc(Creator,_N2,Pid2,Port2,_L) ->
put(ref,Ref),
put(pid,Pid),
put(bin,Bin),
+ put(proc_bins,create_proc_bins()),
put(bins,create_binaries()),
put(sub_bin,SubBin),
put(sub_bins,create_sub_binaries(get(bins))),
@@ -119,6 +120,23 @@ create_sub_binary(Bin, Start, LenSub) ->
<<_:Start/bytes,Sub:Len/bytes,_/bytes>> = Bin,
Sub.
+create_proc_bins() ->
+ Parent = self(),
+ Pid =
+ spawn(
+ fun() ->
+ %% Just reverse the list here, so this binary is not
+ %% confused with the one created in n1_proc/5 above,
+ %% which is used for testing truncation (see
+ %% crashdump_viewer_SUITE:truncate_dump_binary/1)
+ Bin = list_to_binary(lists:reverse(lists:seq(1, 255))),
+ <<A:65/bytes,B:65/bytes,C/bytes>> = Bin,
+ Parent ! {self(),{A,B,C}}
+ end),
+ receive
+ {Pid,ProcBins} -> ProcBins
+ end.
+
%%%
%%% Test dumping of maps. Dumping of maps only from OTP 20.2.
%%%