aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/src/percept_profile.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-02-17 11:13:42 +0000
committerErlang/OTP <[email protected]>2010-02-17 11:13:42 +0000
commit40b76c2e854c9771f8699fd143299ad2d6de4603 (patch)
tree0785b7428656150c1ee6d19345dee941355ab4f6 /lib/runtime_tools/src/percept_profile.erl
parent4a33e37e8c1b4f60a6890dccae438cd8fbbb05ef (diff)
parenta8bf1fe3b9f5f69354403231a3c47489d9015977 (diff)
downloadotp-40b76c2e854c9771f8699fd143299ad2d6de4603.tar.gz
otp-40b76c2e854c9771f8699fd143299ad2d6de4603.tar.bz2
otp-40b76c2e854c9771f8699fd143299ad2d6de4603.zip
Merge branch 'ks/cleanups' into ccase/r13b04_dev
* ks/cleanups: percept: Clean up as suggested by tidier percept: Modernize types and specs parsetools: Don't use 'try...of' when 'try' will do parsetools: Use %% for comments at the beginning of a line parsetools: Replace lists:keysearch/3 with lists:keyfind/3 parsetools: Modernize types and specs parsetools: Replace TABs with spaces runtime_tools: Modernize specs sasl: Eliminate tuple used as fun sasl: Add missing modules to app file asn1: Clean up as suggested by tidier os_mon: Modernize types and specs wx: Clean up as suggested by tidier OTP-8455 ks/cleanups
Diffstat (limited to 'lib/runtime_tools/src/percept_profile.erl')
-rw-r--r--lib/runtime_tools/src/percept_profile.erl35
1 files changed, 16 insertions, 19 deletions
diff --git a/lib/runtime_tools/src/percept_profile.erl b/lib/runtime_tools/src/percept_profile.erl
index b333dee0cf..cdc7a0fca1 100644
--- a/lib/runtime_tools/src/percept_profile.erl
+++ b/lib/runtime_tools/src/percept_profile.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -41,7 +41,7 @@
%% @type percept_option() = procs | ports | exclusive
--type(percept_option() :: 'procs' | 'ports' | 'exclusive' | 'scheduler').
+-type percept_option() :: 'procs' | 'ports' | 'exclusive' | 'scheduler'.
%%==========================================================================
%%
@@ -52,8 +52,8 @@
%% @spec start(Filename::string()) -> {ok, Port} | {already_started, Port}
%% @equiv start(Filename, [procs])
--spec(start/1 :: (Filename :: string()) ->
- {'ok', port()} | {'already_started', port()}).
+-spec start(Filename :: file:filename()) ->
+ {'ok', port()} | {'already_started', port()}.
start(Filename) ->
profile_to_file(Filename, [procs]).
@@ -64,10 +64,9 @@ start(Filename) ->
%% All events are stored in the file given by Filename.
%% An explicit call to stop/0 is needed to stop profiling.
--spec(start/2 :: (
- Filename :: string(),
- Options :: [percept_option()]) ->
- {'ok', port()} | {'already_started', port()}).
+-spec start(Filename :: file:filename(),
+ Options :: [percept_option()]) ->
+ {'ok', port()} | {'already_started', port()}.
start(Filename, Options) ->
profile_to_file(Filename, Options).
@@ -79,11 +78,10 @@ start(Filename, Options) ->
%% No explicit call to stop/0 is needed, the profiling stops when
%% the entry function returns.
--spec(start/3 :: (
- Filename :: string(),
- Entry :: {atom(), atom(), list()},
- Options :: [percept_option()]) ->
- 'ok' | {'already_started', port()} | {'error', 'not_started'}).
+-spec start(Filename :: file:filename(),
+ Entry :: {atom(), atom(), list()},
+ Options :: [percept_option()]) ->
+ 'ok' | {'already_started', port()} | {'error', 'not_started'}.
start(Filename, {Module, Function, Args}, Options) ->
case whereis(percept_port) of
@@ -107,11 +105,11 @@ deliver_all_trace() ->
receive {Tracer, ok} -> ok end,
erlang:trace(Tracee, false, [procs]),
ok.
--spec(stop/0 :: () -> 'ok' | {'error', 'not_started'}).
%% @spec stop() -> ok | {'error', 'not_started'}
%% @doc Stops profiling.
+-spec stop() -> 'ok' | {'error', 'not_started'}.
stop() ->
erlang:system_profile(undefined, [runnable_ports, runnable_procs]),
@@ -192,5 +190,4 @@ parse_profile_options([Opt|Opts], {TOpts, POpts}) ->
});
_ ->
parse_profile_options(Opts, {TOpts, POpts})
-
end.