Skip to content

Commit d337dfc

Browse files
author
andytill
committed
Use rt_config instead of a new ets table for tracing configuration.
1 parent 4e1da92 commit d337dfc

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/riak_test_escript.erl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,8 @@ parse_command_line_tests(ParsedArgs) ->
214214
%% this is a little ugly, the process that creates the ets table to store
215215
%% the tracing state cannot shutdown or the table will be gc'ed, so create
216216
%% a dummy proc that doens't die
217-
proc_lib:spawn(
218-
fun() ->
219-
rt_redbug:new(),
220-
rt_redbug:set_tracing_applied(proplists:is_defined(apply_traces, ParsedArgs)),
221-
timer:sleep(infinity)
222-
end),
217+
rt_redbug:new(),
218+
rt_redbug:set_tracing_applied(proplists:is_defined(apply_traces, ParsedArgs)),
223219
%% Parse Command Line Tests
224220
{CodePaths, SpecificTests} =
225221
lists:foldl(fun extract_test_names/2,

src/rt_redbug.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333

3434
%% Create a new ets to store globally whether we're tracing or not.
3535
new() ->
36-
rt_trace_tab = ets:new(rt_trace_tab, [named_table]).
36+
ok.
3737

3838
set_tracing_applied(TracingApplied) when is_boolean(TracingApplied) ->
3939
lager:info("Setting apply tracing to ~p", [TracingApplied]),
40-
ets:insert(rt_trace_tab, {apply_traces,TracingApplied}).
40+
rt_config:set(apply_traces, TracingApplied).
4141

4242
is_tracing_applied() ->
43-
(catch ets:lookup_element(rt_trace_tab, apply_traces, 2)) == true.
43+
rt_config:get(apply_traces).
4444

4545
%% Apply traces to one or more nodes using redbug tracing and syntax.
4646
%%

0 commit comments

Comments
 (0)