Skip to content

Commit

Permalink
et: Fix broken doc signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Nov 15, 2024
1 parent c5651c9 commit a3a7de5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 71 deletions.
8 changes: 0 additions & 8 deletions lib/et/src/et.erl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ Interface module for the Event Trace (ET) application
%%----------------------------------------------------------------------

-doc """
trace_me(DetailLevel, FromTo, Label, Contents) -> hopefully_traced
Invokes `et:trace_me/5` with both `From` and `To` set to `FromTo`.
""".
-doc(#{since => <<"OTP R13B04">>}).
Expand All @@ -151,8 +149,6 @@ trace_me(DetailLevel, FromTo, Label, Contents)
?MODULE:trace_me(DetailLevel, FromTo, FromTo, Label, Contents).

-doc """
trace_me(DetailLevel, From, To, Label, Contents) -> hopefully_traced
A function that is intended to be traced.
This function is intended to be invoked at strategic places in user applications
Expand Down Expand Up @@ -192,8 +188,6 @@ phone_home(DetailLevel, FromTo, Label, Contents) ->
?MODULE:trace_me(DetailLevel, FromTo, FromTo, Label, Contents).

-doc """
phone_home(DetailLevel, From, To, Label, Contents) -> hopefully_traced
These functions sends a signal to the outer space and the caller hopes that
someone is listening. In other words, they invoke `et:trace_me/4` and
`et:trace_me/5` respectively.
Expand All @@ -219,8 +213,6 @@ report_event(DetailLevel, FromTo, Label, Contents) ->
?MODULE:trace_me(DetailLevel, FromTo, FromTo, Label, Contents).

-doc """
report_event(DetailLevel, From, To, Label, Contents) -> hopefully_traced
Deprecated functions which for the time being are kept for backwards
compatibility. Invokes `et:trace_me/4` and `et:trace_me/5` respectively.
""".
Expand Down
52 changes: 7 additions & 45 deletions lib/et/src/et_collector.erl
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ Interface module for the Event Trace (ET) application
%% Reason = term()
%%----------------------------------------------------------------------
-doc """
start_link(Options) -> {ok, CollectorPid} | {error, Reason}
Start a collector process.
The collector collects trace events and keeps them ordered by their timestamp.
Expand Down Expand Up @@ -352,11 +350,9 @@ start_clients(CollectorPid, []) ->
%% CollectorPid = pid()
%%----------------------------------------------------------------------
-doc """
stop(CollectorPid) -> ok
Stop a collector process.
""".
-spec stop(CollectorPid::pid()) -> ok.
-spec stop(pid()) -> ok.
stop(CollectorPid) ->
call(CollectorPid, stop).

Expand Down Expand Up @@ -386,8 +382,6 @@ stop(CollectorPid) ->
%% The options defaults to existing, write and keep.
%%----------------------------------------------------------------------
-doc """
save_event_file(CollectorPid, FileName, Options) -> ok | {error, Reason}
Save the events to a file.
By default the currently stored events (existing) are written to a brand new
Expand Down Expand Up @@ -528,8 +522,8 @@ report(_, Bad) ->
exit({bad_event, Bad}).

-doc(#{equiv => report_event/6}).
-spec report_event(CollectorPid, DetailLevel, FromTo, Label, Contents) -> {ok, Continuation} when
CollectorPid :: pid(),
-spec report_event(Handle, DetailLevel, FromTo, Label, Contents) -> {ok, Continuation} when
Handle :: CollectorPid :: pid() | table_handle(),
DetailLevel :: level(),
FromTo :: actor(),
Label :: term(),
Expand All @@ -539,18 +533,15 @@ report_event(CollectorPid, DetailLevel, FromTo, Label, Contents) ->
report_event(CollectorPid, DetailLevel, FromTo, FromTo, Label, Contents).

-doc """
report_event(Handle, DetailLevel, From, To, Label, Contents) -> {ok,
Continuation} | exit(Reason)
Report an event to the collector.
All events are filtered thru the collector filter, which optionally may
transform or discard the event. The first call should use the pid of the
collector process as report handle, while subsequent calls should use the table
handle.
""".
-spec report_event(CollectorPid, DetailLevel, From, To, Label, Contents) -> {ok, Continuation} when
CollectorPid :: pid(),
-spec report_event(Handle, DetailLevel, From, To, Label, Contents) -> {ok, Continuation} when
Handle :: CollectorPid :: pid() | table_handle(),
DetailLevel :: level(),
From :: actor(),
To :: actor(),
Expand Down Expand Up @@ -582,8 +573,6 @@ report_event(CollectorPid, DetailLevel, From, To, Label, Contents)
%%----------------------------------------------------------------------

-doc """
make_key(Type, Stuff) -> Key
Make a key out of an event record or an old key.
""".
-spec make_key(Handle, Stuff) -> Key when
Expand Down Expand Up @@ -644,8 +633,6 @@ get_table_handle(CollectorPid) when is_pid(CollectorPid) ->
%% Reason = term()
%%----------------------------------------------------------------------
-doc """
get_global_pid() -> CollectorPid | exit(Reason)
Return a the identity of the globally registered collector if there is any.
""".
-spec get_global_pid() -> CollectorPid :: pid().
Expand All @@ -671,8 +658,6 @@ get_global_pid() ->
%% TracePattern = {report_module(), dbg_match_spec_match_spec()}
%%----------------------------------------------------------------------
-doc """
change_pattern(CollectorPid, RawPattern) -> {old_pattern, TracePattern}
Change active trace pattern globally on all trace nodes.
""".
-spec change_pattern(CollectorPid, RawPattern) -> {old_pattern, TracePattern} when
Expand Down Expand Up @@ -709,11 +694,7 @@ change_pattern(CollectorPid, RawPattern) ->
%% Val = term()
%%----------------------------------------------------------------------
-doc """
dict_insert(CollectorPid, Key, Val) -> okdict_insert(CollectorPid, {subscriber,
SubscriberPid}, Void) -> okdict_insert(CollectorPid, {filter, collector},
FilterFun) -> ok
Insert a dictionary entry and send a \{et, \{dict_insert, Key, Val\}\} tuple to
Insert a dictionary entry and send a `{et, {dict_insert, Key, Val}}` tuple to
all registered subscribers.
If the entry is a new subscriber, it will imply that the new subscriber process
Expand Down Expand Up @@ -754,8 +735,6 @@ dict_insert(CollectorPid, Key, Val) ->
%% Val = term()
%%----------------------------------------------------------------------
-doc """
dict_lookup(CollectorPid, Key) -> [Val]
Lookup a dictionary entry and return zero or one value.
""".
-spec dict_lookup(CollectorPid::pid(), Key::term()) -> [Val::term()].
Expand All @@ -781,8 +760,6 @@ dict_lookup(CollectorPid, Key) ->
%% Key = term()
%%----------------------------------------------------------------------
-doc """
dict_delete(CollectorPid, Key) -> ok
Delete a dictionary entry and send a \{et, \{dict_delete, Key\}\} tuple to all
registered subscribers.
Expand All @@ -808,8 +785,6 @@ dict_delete(CollectorPid, Key) ->
%% val() = term()
%%----------------------------------------------------------------------
-doc """
dict_match(CollectorPid, Pattern) -> [Match]
Match some dictionary entries
""".
-spec dict_match(CollectorPid::pid(), {KeyPattern, ValPattern}) -> [Match] when
Expand All @@ -828,8 +803,6 @@ dict_match(CollectorPid, Pattern) ->
%% Msg = term()
%%----------------------------------------------------------------------
-doc """
multicast(\_CollectorPid, Msg) -> ok
Sends a message to all registered subscribers.
""".
-spec multicast(CollectorPid :: pid(), Msg::term()) -> ok.
Expand All @@ -851,9 +824,6 @@ multicast(CollectorPid, Msg) ->
%% Pid = dbg_trace_client_pid()
%%----------------------------------------------------------------------
-doc """
start_trace_client(CollectorPid, Type, Parameters) -> file_loaded |
{trace_client_pid, pid()} | exit(Reason)
Load raw Erlang trace from a file, port or process.
""".
-spec start_trace_client(CollectorPid, Type, Parameter) -> file_loaded | {trace_client_pid, pid()} when
Expand Down Expand Up @@ -920,11 +890,7 @@ monitor_trace_port(CollectorPid, Parameters) ->
%%
%% Short for iterate/5.
%%----------------------------------------------------------------------
-doc """
iterate(Handle, Prev, Limit) -> NewAcc
Short for iterate(Handle, Prev, Limit, undefined, Prev) -> NewAcc
""".
-doc #{ equiv => iterate(Handle, Prev, Limit, undefined, Prev) }.
-spec iterate(Handle, Prev, Limit) -> NewAcc when
Handle :: CollectorPid | table_handle(),
CollectorPid :: pid(),
Expand Down Expand Up @@ -957,8 +923,6 @@ iterate(Handle, Prev, Limit) ->
%% Acc = NewAcc = term()
%%----------------------------------------------------------------------
-doc """
iterate(Handle, Prev, Limit, Fun, Acc) -> NewAcc
Iterate over the currently stored events.
Iterates over the currently stored events and applies a function for each event.
Expand Down Expand Up @@ -1115,8 +1079,6 @@ incr(Val, Incr) ->
%% table_handle() = record(table_handle)
%%----------------------------------------------------------------------
-doc """
clear_table(Handle) -> ok
Clear the event table.
""".
-spec clear_table(Handle) -> ok when
Expand Down
6 changes: 2 additions & 4 deletions lib/et/src/et_selector.erl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
%% integer() - explicit detail level of tracing
%%----------------------------------------------------------------------
-doc """
make_pattern(RawPattern) -> TracePattern
make_pattern(RawPattern)
Makes a trace pattern suitable to feed change_pattern/1
Expand Down Expand Up @@ -115,7 +115,7 @@ make_pattern({Mod, Pattern}) when is_atom(Mod) ->
%% accordingly with erlang:trace_pattern/2.
%%----------------------------------------------------------------------
-doc """
change_pattern(Pattern) -> ok
change_pattern(Pattern)
Activates/deactivates tracing by changing the current trace pattern.
Expand Down Expand Up @@ -219,8 +219,6 @@ error_to_exit({ok, _Res}) ->
%% should be dropped
%%----------------------------------------------------------------------
-doc """
parse_event(Mod, ValidTraceData) -> false | true | {true, Event}
Transforms trace data and makes an event record out of it.
See `erlang:trace/3` for more info about the semantics of the trace data.
Expand Down
16 changes: 2 additions & 14 deletions lib/et/src/et_viewer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@
%% Reason = term()
%%----------------------------------------------------------------------
-doc """
file(FileName) -> {ok, ViewerPid} | {error, Reason}
Start a new event viewer and a corresponding collector and load them with trace
events from a trace file.
""".
Expand All @@ -96,8 +94,6 @@ file(FileName) ->
%%----------------------------------------------------------------------

-doc """
start() -> ok
Simplified start of a sequence chart viewer with global tracing activated.
Convenient to be used from the command line (erl -s et_viewer).
Expand All @@ -110,8 +106,6 @@ start() ->
%% start(Options) -> {ok, ViewerPid} | {error, Reason}
%%----------------------------------------------------------------------
-doc """
start(Options) -> ok
Start of a sequence chart viewer without linking to the parent process.
""".
-spec start(GUIorOptions) -> {ok, Viewer::pid()} | {error, term()} when
Expand Down Expand Up @@ -185,12 +179,10 @@ start(Options, GUI) ->
%% and returns false | true | {true, NewEvent}.
%%----------------------------------------------------------------------
-doc """
start_link(Options) -> {ok, ViewerPid} | {error, Reason}
Start a sequence chart viewer for trace events (messages/actions)
A filter_fun() takes an event record as sole argument and returns false | true |
\{true, NewEvent\}.
A filter_fun() takes an event record as sole argument and returns
`false | true | {true, NewEvent}`.
If the `collector_pid` is `undefined` a new `et_collector` will be started with
the following parameter settings: `parent_pid`, `event_order`, `trace_global`,
Expand Down Expand Up @@ -240,8 +232,6 @@ start_link(Options, GUI) ->
which_gui() -> wx.

-doc """
get_collector_pid(ViewerPid) -> CollectorPid
Returns the identifier of the collector process.
""".
-spec get_collector_pid(ViewerPid::pid()) -> pid().
Expand All @@ -256,8 +246,6 @@ get_collector_pid(ViewerPid) ->
%% ViewerPid = pid()
%%----------------------------------------------------------------------
-doc """
stop(ViewerPid) -> ok
Stops a viewer process.
""".
-spec stop(ViewerPid::pid()) -> ok.
Expand Down

0 comments on commit a3a7de5

Please sign in to comment.