Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
1540-snmp-Types-and-specs-for-snmp-set_trace-2....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1540-snmp-Types-and-specs-for-snmp-set_trace-2.patch of Package erlang
From 5cee3768c58846843614efb7e8db9b96b618d629 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Wed, 10 Jan 2024 18:58:17 +0100 Subject: [PATCH 20/67] [snmp] Types and specs for snmp:set_trace/2 --- lib/snmp/doc/src/snmp.xml | 16 +--------------- lib/snmp/src/app/snmp.erl | 10 ++++++++++ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/snmp/doc/src/snmp.xml b/lib/snmp/doc/src/snmp.xml index 1b6f1649ac..9fe5d4f02f 100644 --- a/lib/snmp/doc/src/snmp.xml +++ b/lib/snmp/doc/src/snmp.xml @@ -633,22 +633,8 @@ </func> <func> - <name since="">set_trace(Targets, Opts) -> void()</name> + <name name="set_trace" arity="2" clause_i="1" since=""/> <fsummary>Set trace target</fsummary> - <type> - <v>Targets = target() | targets()</v> - <v>target() = module()</v> - <v>module() = atom()</v> - <v>targets() = [target() | {target(), target_options()}]</v> - <v>target_options() = [target_option()]</v> - <v>target_option() = {return_trace, boolean()} | {scope, scope()}</v> - <v>scope() = all_functions | exported_functions | function_name() | {function_name(), function_arity()}</v> - <v>function_name() = atom()</v> - <v>function_arity() = integer() >= 0</v> - <v>Opts = disable | trace_options()</v> - <v>trace_options() = [trace_option()]</v> - <v>trace_option() = {timestamp, boolean()} | target_option()</v> - </type> <desc> <p>This function is used to set up trace on function(s) for the given module or modules. </p> diff --git a/lib/snmp/src/app/snmp.erl b/lib/snmp/src/app/snmp.erl index 1a6a868c84..7c88cd8c2e 100644 --- a/lib/snmp/src/app/snmp.erl +++ b/lib/snmp/src/app/snmp.erl @@ -284,6 +284,16 @@ reset_trace(Targets) when is_list(Targets) -> set_trace(Targets, disable). +-spec set_trace(Targets, TraceOpts) -> void() when + Targets :: module() | [module() | {module(), [TargetOpt]}], + TargetOpt :: {return_trace, boolean()} | {scope, Scope}, + Scope :: all_functions | exported_functions | + FunctionName | {FunctionName, FunctionArity}, + FunctionName :: atom(), + FunctionArity :: non_neg_integer(), + TraceOpts :: disable | [TraceOpt], + TraceOpt :: {timestamp, boolean()} | TargetOpt. + set_trace(Module, disable) when is_atom(Module) -> dbg:ctp(Module); set_trace(Module, Opts) when is_atom(Module) andalso is_list(Opts) -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor