aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2013-05-23 11:16:04 +0200
committerMicael Karlberg <[email protected]>2013-05-23 11:16:04 +0200
commitdccaf2ca6b85ceaf05ea43262e18af9f63a76b02 (patch)
tree5d347c3ea2234817938131dcf0edb9dbe0c1c93d
parentba6cdcc9a0a477938c99d92a7526b61ec2c70400 (diff)
downloadotp-dccaf2ca6b85ceaf05ea43262e18af9f63a76b02.tar.gz
otp-dccaf2ca6b85ceaf05ea43262e18af9f63a76b02.tar.bz2
otp-dccaf2ca6b85ceaf05ea43262e18af9f63a76b02.zip
[snmp/agent] Add more verbosity printouts to the mnesia mib-storage module
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
index a1f2be9af3..dca44d3c33 100644
--- a/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
+++ b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl
@@ -64,11 +64,13 @@ open(Name, RecName, Fields, Type, Opts) ->
?vtrace("open ~p table ~p for record ~p",
[Type, Name, RecName]),
Action = snmp_misc:get_option(action, Opts, keep),
- Nodes = snmp_misc:get_option(nodes, Opts, [node()]),
+ Nodes = snmp_misc:get_option(nodes, Opts, erlang:nodes()),
case table_exists(Name) of
true when (Action =:= keep) ->
+ ?vtrace("open table ~p - exist (keep)", [Name]),
{ok, #tab{id = Name}};
true when (Action =:= clear) ->
+ ?vtrace("open table ~p - exist (clear)", [Name]),
F = fun() -> mnesia:clear_table(Name) end,
case mnesia:transaction(F) of
{aborted, Reason} ->
@@ -77,14 +79,18 @@ open(Name, RecName, Fields, Type, Opts) ->
{ok, #tab{id = Name}}
end;
false ->
+ ?vtrace("open table ~p - does not exist", [Name]),
Args = [{record_name, RecName},
{attributes, Fields},
{type, Type},
{disc_copies, Nodes}],
case mnesia:create_table(Name, Args) of
{atomic, ok} ->
+ ?vtrace("open table ~p - ok", [Name]),
{ok, #tab{id = Name}};
{aborted, Reason} ->
+ ?vinfo("open table ~p - aborted"
+ "~n Reason: ~p", [Name, Reason]),
{error, {create, Reason}}
end
end.