File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -211,10 +211,6 @@ parse_command_line_tests(ParsedArgs) ->
211211 [] -> [undefined ];
212212 UpgradeList -> UpgradeList
213213 end ,
214- % % this is a little ugly, the process that creates the ets table to store
215- % % the tracing state cannot shutdown or the table will be gc'ed, so create
216- % % a dummy proc that doens't die
217- rt_redbug :new (),
218214 rt_redbug :set_tracing_applied (proplists :is_defined (apply_traces , ParsedArgs )),
219215 % % Parse Command Line Tests
220216 {CodePaths , SpecificTests } =
Original file line number Diff line number Diff line change 2626-module (rt_redbug ).
2727
2828-export ([is_tracing_applied /0 ]).
29- -export ([new /0 ]).
3029-export ([set_tracing_applied /1 ]).
3130-export ([stop /1 ]).
3231-export ([trace /2 , trace /3 ]).
3332
34- % % Create a new ets to store globally whether we're tracing or not.
35- new () ->
36- ok .
37-
3833set_tracing_applied (TracingApplied ) when is_boolean (TracingApplied ) ->
39- lager :info (" Setting apply tracing to ~p " , [TracingApplied ]),
40- rt_config :set (apply_traces , TracingApplied ).
34+ % % If this flag is set on the command line, but not in the config file
35+ % % then switch it on.
36+ Enabled = case rt_config :get (apply_traces , undefined ) of
37+ undefined -> TracingApplied ;
38+ ConfigValue -> ConfigValue
39+ end ,
40+ lager :info (" Setting apply tracing to ~p " , [Enabled ]),
41+ rt_config :set (apply_traces , Enabled ).
4142
4243is_tracing_applied () ->
43- rt_config :get (apply_traces ).
44+ rt_config :get (apply_traces , false ).
4445
4546% % Apply traces to one or more nodes using redbug tracing and syntax.
4647% %
You can’t perform that action at this time.
0 commit comments