aboutsummaryrefslogtreecommitdiffstats
path: root/lib/percept/src/percept.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2010-02-13 10:13:46 +0100
committerBjörn Gustavsson <[email protected]>2010-02-16 13:24:55 +0100
commitf2592e6ef6bd6179d45884794d722e8cb551d1aa (patch)
treed945c9bb65badffa4c32074ee2ec124bd8960234 /lib/percept/src/percept.erl
parentc12397f937d450d885ca6ec44d53ef34ff8788f4 (diff)
downloadotp-f2592e6ef6bd6179d45884794d722e8cb551d1aa.tar.gz
otp-f2592e6ef6bd6179d45884794d722e8cb551d1aa.tar.bz2
otp-f2592e6ef6bd6179d45884794d722e8cb551d1aa.zip
percept: Modernize types and specs
Diffstat (limited to 'lib/percept/src/percept.erl')
-rw-r--r--lib/percept/src/percept.erl38
1 files changed, 17 insertions, 21 deletions
diff --git a/lib/percept/src/percept.erl b/lib/percept/src/percept.erl
index af1a920efd..b0d6739478 100644
--- a/lib/percept/src/percept.erl
+++ b/lib/percept/src/percept.erl
@@ -50,7 +50,7 @@
%% @type percept_option() = procs | ports | exclusive
--type(percept_option() :: 'procs' | 'ports' | 'exclusive' | 'scheduler').
+-type percept_option() :: 'procs' | 'ports' | 'exclusive' | 'scheduler'.
%%==========================================================================
%%
@@ -85,8 +85,8 @@ stop(_State) ->
%% profiling
--spec(profile/1 :: (Filename :: string()) ->
- {'ok', port()} | {'already_started', port()}).
+-spec profile(Filename :: file:filename()) ->
+ {'ok', port()} | {'already_started', port()}.
profile(Filename) ->
percept_profile:start(Filename, [procs]).
@@ -94,10 +94,9 @@ profile(Filename) ->
%% @spec profile(Filename::string(), [percept_option()]) -> {ok, Port} | {already_started, Port}
%% @see percept_profile
--spec(profile/2 :: (
- Filename :: string(),
- Options :: [percept_option()]) ->
- {'ok', port()} | {'already_started', port()}).
+-spec profile(Filename :: file:filename(),
+ Options :: [percept_option()]) ->
+ {'ok', port()} | {'already_started', port()}.
profile(Filename, Options) ->
percept_profile:start(Filename, Options).
@@ -105,16 +104,15 @@ profile(Filename, Options) ->
%% @spec profile(Filename::string(), MFA::mfa(), [percept_option()]) -> ok | {already_started, Port} | {error, not_started}
%% @see percept_profile
--spec(profile/3 :: (
- Filename :: string(),
- Entry :: {atom(), atom(), list()},
- Options :: [percept_option()]) ->
- 'ok' | {'already_started', port()} | {'error', 'not_started'}).
+-spec profile(Filename :: file:filename(),
+ Entry :: {atom(), atom(), list()},
+ Options :: [percept_option()]) ->
+ 'ok' | {'already_started', port()} | {'error', 'not_started'}.
profile(Filename, MFA, Options) ->
percept_profile:start(Filename, MFA, Options).
--spec(stop_profile/0 :: () -> 'ok' | {'error', 'not_started'}).
+-spec stop_profile() -> 'ok' | {'error', 'not_started'}.
%% @spec stop_profile() -> ok | {'error', 'not_started'}
%% @see percept_profile
@@ -125,8 +123,8 @@ stop_profile() ->
%% @spec analyze(string()) -> ok | {error, Reason}
%% @doc Analyze file.
--spec(analyze/1 :: (Filename :: string()) ->
- 'ok' | {'error', any()}).
+-spec analyze(Filename :: file:filename()) ->
+ 'ok' | {'error', any()}.
analyze(Filename) ->
case percept_db:start() of
@@ -142,9 +140,8 @@ analyze(Filename) ->
%% Reason = term()
%% @doc Starts webserver.
--spec(start_webserver/0 :: () ->
- {'started', string(), pos_integer()} |
- {'error', any()}).
+-spec start_webserver() ->
+ {'started', string(), pos_integer()} | {'error', any()}.
start_webserver() ->
start_webserver(0).
@@ -156,9 +153,8 @@ start_webserver() ->
%% @doc Starts webserver. If port number is 0, an available port number will
%% be assigned by inets.
--spec(start_webserver/1 :: (Port :: non_neg_integer()) ->
- {'started', string(), pos_integer()} |
- {'error', any()}).
+-spec start_webserver(Port :: non_neg_integer()) ->
+ {'started', string(), pos_integer()} | {'error', any()}.
start_webserver(Port) when is_integer(Port) ->
application:load(percept),