diff options
author | Kostis Sagonas <[email protected]> | 2010-02-07 16:00:28 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-02-16 13:24:55 +0100 |
commit | 2b451b05c7e0df3ed2873bba4baba392c55ad047 (patch) | |
tree | 82c465475916f929ec2dba1188760f51b81894a0 /lib | |
parent | c3946543672ea737e5f81f1de400011b9128a555 (diff) | |
download | otp-2b451b05c7e0df3ed2873bba4baba392c55ad047.tar.gz otp-2b451b05c7e0df3ed2873bba4baba392c55ad047.tar.bz2 otp-2b451b05c7e0df3ed2873bba4baba392c55ad047.zip |
runtime_tools: Modernize specs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/runtime_tools/src/percept_profile.erl | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/runtime_tools/src/percept_profile.erl b/lib/runtime_tools/src/percept_profile.erl index b333dee0cf..5d36b6bd0c 100644 --- a/lib/runtime_tools/src/percept_profile.erl +++ b/lib/runtime_tools/src/percept_profile.erl @@ -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. |