diff options
author | John Högberg <[email protected]> | 2018-02-13 09:55:47 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-02-13 09:55:47 +0100 |
commit | 68f53774b1340f07cf11caee773ff00d94904006 (patch) | |
tree | b1868784c4ccea81a6d2c1a49af23ddaa663dde0 /lib/tools/src | |
parent | 5e7286acceec0811fd95898c7337921ac91c97b4 (diff) | |
parent | 9d660e81152fd7640e12551b09eebae1ebb87c98 (diff) | |
download | otp-68f53774b1340f07cf11caee773ff00d94904006.tar.gz otp-68f53774b1340f07cf11caee773ff00d94904006.tar.bz2 otp-68f53774b1340f07cf11caee773ff00d94904006.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/tools/src')
-rw-r--r-- | lib/tools/src/lcnt.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/tools/src/lcnt.erl b/lib/tools/src/lcnt.erl index 139b3d8a4a..d0152a4915 100644 --- a/lib/tools/src/lcnt.erl +++ b/lib/tools/src/lcnt.erl @@ -218,9 +218,11 @@ raw() -> call(raw). set(Option, Value) -> call({set, Option, Value}). set({Option, Value}) -> call({set, Option, Value}). save(Filename) -> call({save, Filename}). -load(Filename) -> ok = start_internal(), call({load, Filename}). +load(Filename) -> call({load, Filename}). -call(Msg) -> gen_server:call(?MODULE, Msg, infinity). +call(Msg) -> + ok = start_internal(), + gen_server:call(?MODULE, Msg, infinity). %% -------------------------------------------------------------------- %% %% @@ -237,7 +239,6 @@ apply(Fun) when is_function(Fun) -> lcnt:apply(Fun, []). apply(Fun, As) when is_function(Fun) -> - ok = start_internal(), Opt = lcnt:rt_opt({copy_save, true}), lcnt:clear(), Res = erlang:apply(Fun, As), @@ -943,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. |