aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test/crashdump_helper.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-11-06 12:06:32 +0100
committerBjörn Gustavsson <[email protected]>2018-11-06 12:06:32 +0100
commitabde22933f5a617376d7db9fd91690e901c996ef (patch)
tree7efe4f3dd9baf5c48cde8b01481c0ef661bbd780 /lib/observer/test/crashdump_helper.erl
parentc2a3104849583a9e1aa5370873457975bef67296 (diff)
parentadffe592c98149ac3b7333cf6e46970a13a57350 (diff)
downloadotp-abde22933f5a617376d7db9fd91690e901c996ef.tar.gz
otp-abde22933f5a617376d7db9fd91690e901c996ef.tar.bz2
otp-abde22933f5a617376d7db9fd91690e901c996ef.zip
Merge branch 'maint'
* maint: Implement a tab for persistent terms in crashdump viewer Add tests of persistent terms for crashdump_viewer Add a persistent term storage Refactor releasing of literals Extend the sharing-preserving routines to optionally copy literals Conflicts: erts/emulator/Makefile.in erts/emulator/beam/erl_process_dump.c erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/init.beam lib/sasl/src/systools_make.erl
Diffstat (limited to 'lib/observer/test/crashdump_helper.erl')
-rw-r--r--lib/observer/test/crashdump_helper.erl27
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/observer/test/crashdump_helper.erl b/lib/observer/test/crashdump_helper.erl
index d8f4e046ae..dd50bddf38 100644
--- a/lib/observer/test/crashdump_helper.erl
+++ b/lib/observer/test/crashdump_helper.erl
@@ -21,7 +21,9 @@
-module(crashdump_helper).
-export([n1_proc/2,remote_proc/2,
dump_maps/0,create_maps/0,
- create_binaries/0,create_sub_binaries/1]).
+ create_binaries/0,create_sub_binaries/1,
+ dump_persistent_terms/0,
+ create_persistent_terms/0]).
-compile(r18).
-include_lib("common_test/include/ct.hrl").
@@ -162,3 +164,26 @@ literal_map() ->
%% Adress1, then the map at Address2.
#{"one"=>1,"two"=>2,"three"=>3,"four"=>4}.
+
+%%%
+%%% Test dumping of persistent terms (from OTP 21.2).
+%%%
+
+dump_persistent_terms() ->
+ Parent = self(),
+ F = fun() ->
+ register(aaaaaaaa_persistent_terms, self()),
+ put(pts, create_persistent_terms()),
+ Parent ! {self(),done},
+ receive _ -> ok end
+ end,
+ Pid = spawn_link(F),
+ receive
+ {Pid,done} ->
+ {ok,Pid}
+ end.
+
+create_persistent_terms() ->
+ persistent_term:put({?MODULE,first}, {pid,42.0}),
+ persistent_term:put({?MODULE,second}, [1,2,3]),
+ persistent_term:get().