diff options
author | John Högberg <[email protected]> | 2018-02-13 09:47:59 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-02-13 09:47:59 +0100 |
commit | 9d660e81152fd7640e12551b09eebae1ebb87c98 (patch) | |
tree | 7b3506124f3144eefe5c59885be8c7bb18df436f /lib/tools | |
parent | 78baf69b8b37b543f419fcd5a606cba2c60abea0 (diff) | |
parent | dfa4d62c263cd3f11338aba891179b08704d9287 (diff) | |
download | otp-9d660e81152fd7640e12551b09eebae1ebb87c98.tar.gz otp-9d660e81152fd7640e12551b09eebae1ebb87c98.tar.bz2 otp-9d660e81152fd7640e12551b09eebae1ebb87c98.zip |
Merge branch 'john/tools/fix-lcnt-server-crash/PR-1711/OTP-14912' into maint
Diffstat (limited to 'lib/tools')
-rw-r--r-- | lib/tools/doc/src/lcnt.xml | 2 | ||||
-rw-r--r-- | lib/tools/src/lcnt.erl | 2 | ||||
-rw-r--r-- | lib/tools/test/lcnt_SUITE.erl | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/tools/doc/src/lcnt.xml b/lib/tools/doc/src/lcnt.xml index 5bdfc60448..0c24375b91 100644 --- a/lib/tools/doc/src/lcnt.xml +++ b/lib/tools/doc/src/lcnt.xml @@ -371,7 +371,7 @@ <v>Serial = integer()</v> </type> <desc> - <p>Creates a process id with creation 0. Example:</p> + <p>Creates a process id with creation 0.</p> </desc> </func> diff --git a/lib/tools/src/lcnt.erl b/lib/tools/src/lcnt.erl index 20b031a7ad..d0152a4915 100644 --- a/lib/tools/src/lcnt.erl +++ b/lib/tools/src/lcnt.erl @@ -944,7 +944,7 @@ print_state_information(#state{locks = Locks} = State) -> print(kv("#tries", s(Stats#stats.tries))), print(kv("#colls", s(Stats#stats.colls))), print(kv("wait time", s(Stats#stats.time) ++ " us" ++ " ( " ++ s(Stats#stats.time/1000000) ++ " s)")), - print(kv("percent of duration", s(Stats#stats.time/State#state.duration*100) ++ " %")), + print(kv("percent of duration", s(percent(Stats#stats.time, State#state.duration)) ++ " %")), ok. diff --git a/lib/tools/test/lcnt_SUITE.erl b/lib/tools/test/lcnt_SUITE.erl index 4a92abb5c8..a79572a742 100644 --- a/lib/tools/test/lcnt_SUITE.erl +++ b/lib/tools/test/lcnt_SUITE.erl @@ -31,6 +31,7 @@ t_locations/1, t_swap_keys/1, t_implicit_start/1, + t_crash_before_collect/1, smoke_lcnt/1]). init_per_testcase(_Case, Config) -> @@ -46,7 +47,7 @@ suite() -> all() -> [t_load, t_conflicts, t_locations, t_swap_keys, t_implicit_start, - smoke_lcnt]. + t_crash_before_collect, smoke_lcnt]. %%---------------------------------------------------------------------- %% Tests @@ -155,6 +156,10 @@ t_swap_keys_file([File|Files]) -> t_implicit_start(Config) when is_list(Config) -> ok = lcnt:conflicts(). +t_crash_before_collect(Config) when is_list(Config) -> + {ok, _} = lcnt:start(), + ok = lcnt:information(). + %% Simple smoke test of actual lock-counting, if running on %% a run-time with lock-counting enabled. smoke_lcnt(Config) -> |