aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2017-12-04 10:29:26 +0100
committerJohn Högberg <[email protected]>2017-12-04 13:40:29 +0100
commitfb99e17d04bddfcb43f54388c93302ea32d60b4a (patch)
tree5198090b4b6d195b7f718ef1df35cbd42851c756 /erts/emulator/test
parent2302ea8ca97b8a9075e9234d15430c47d3a115c8 (diff)
downloadotp-fb99e17d04bddfcb43f54388c93302ea32d60b4a.tar.gz
otp-fb99e17d04bddfcb43f54388c93302ea32d60b4a.tar.bz2
otp-fb99e17d04bddfcb43f54388c93302ea32d60b4a.zip
Fix process name resolution in lcnt results
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/lcnt_SUITE.erl28
1 files changed, 26 insertions, 2 deletions
diff --git a/erts/emulator/test/lcnt_SUITE.erl b/erts/emulator/test/lcnt_SUITE.erl
index 504b9b54cf..4e52c2813c 100644
--- a/erts/emulator/test/lcnt_SUITE.erl
+++ b/erts/emulator/test/lcnt_SUITE.erl
@@ -28,14 +28,16 @@
init_per_testcase/2, end_per_testcase/2]).
-export(
- [toggle_lock_counting/1, error_on_invalid_category/1, preserve_locks/1]).
+ [toggle_lock_counting/1, error_on_invalid_category/1, preserve_locks/1,
+ registered_processes/1, registered_db_tables/1]).
suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap, {seconds, 10}}].
all() ->
- [toggle_lock_counting, error_on_invalid_category, preserve_locks].
+ [toggle_lock_counting, error_on_invalid_category, preserve_locks,
+ registered_processes, registered_db_tables].
init_per_suite(Config) ->
case erlang:system_info(lock_counting) of
@@ -154,3 +156,25 @@ preserve_locks(Config) when is_list(Config) ->
error_on_invalid_category(Config) when is_list(Config) ->
{error, badarg, q_invalid} = erts_debug:lcnt_control(mask, [q_invalid]),
ok.
+
+registered_processes(Config) when is_list(Config) ->
+ %% There ought to be at least one registered process (init/code_server)
+ erts_debug:lcnt_control(mask, [process]),
+ [_, {locks, ProcLocks}] = erts_debug:lcnt_collect(),
+ true = lists:any(
+ fun
+ ({proc_main, RegName, _, _}) when is_atom(RegName) -> true;
+ (_Lock) -> false
+ end, ProcLocks),
+ ok.
+
+registered_db_tables(Config) when is_list(Config) ->
+ %% There ought to be at least one registered table (code)
+ erts_debug:lcnt_control(mask, [db]),
+ [_, {locks, DbLocks}] = erts_debug:lcnt_collect(),
+ true = lists:any(
+ fun
+ ({db_tab, RegName, _, _}) when is_atom(RegName) -> true;
+ (_Lock) -> false
+ end, DbLocks),
+ ok.