From cbea681feb52dad9316a29dbd1a8b0c400362123 Mon Sep 17 00:00:00 2001 From: Kenneth Lundin Date: Wed, 2 Mar 2011 16:56:55 +0100 Subject: Add timer:sleep(100) after each 10 modules trace pattern and remove dialyzer warnings When setting trace pattern for many modules the system will quite unresponsive and thus we have added a timer:sleep(100) after every 10 modules to set trace patterns for. Code has also been change in order to get rid of dialyzer warnings. I.e removal of dead code. --- lib/runtime_tools/src/inviso_rt.erl | 70 ++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 40 deletions(-) (limited to 'lib/runtime_tools') diff --git a/lib/runtime_tools/src/inviso_rt.erl b/lib/runtime_tools/src/inviso_rt.erl index dfab70b42e..ac7ac2a584 100644 --- a/lib/runtime_tools/src/inviso_rt.erl +++ b/lib/runtime_tools/src/inviso_rt.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1422,7 +1422,17 @@ do_set_trace_patterns(Args,Flags) -> do_set_trace_patterns_2([{M,F,Arity,MS}|Rest],Flags,Replies) -> % Option-less. do_set_trace_patterns_2([{M,F,Arity,MS,[]}|Rest],Flags,Replies); -do_set_trace_patterns_2([{M,F,Arity,MS,Opts}|Rest],Flags,Replies) when is_atom(M) -> +do_set_trace_patterns_2(Mlist = [{M,F,Arity,MS,Opts}|Rest],Flags,Replies) when is_atom(M) -> + case length(Mlist) rem 10 of + 0 -> + timer:sleep(100); + _ -> + ok + end, + %% sleep 100 ms for every 10:th element in the list to let other + %% processes run since this is a potentially + %% heavy operation that might result in an unresponsive Erlang VM for + %% several seconds otherwise case load_module_on_option(M,Opts) of true -> % Already present, loaded or no option! case catch erlang:trace_pattern({M,F,Arity},MS,Flags) of @@ -1438,30 +1448,11 @@ do_set_trace_patterns_2([{M,F,Arity,MS,Opts}|Rest],Flags,Replies) when is_atom(M do_set_trace_patterns_2(Rest,Flags,[0|Replies]) end; do_set_trace_patterns_2([{M,F,Arity,MS,Opts}|Rest],Flags,Replies) when is_list(M) -> - case check_pattern_parameters(void,F,Arity,MS) of % We don't want to repeat bad params. - ok -> - case inviso_rt_lib:expand_regexp(M,Opts) of % Get a list of real modulnames. - Mods when is_list(Mods) -> - MoreReplies= - do_set_trace_patterns_2(lists:map(fun(Mod)-> - {Mod,F,Arity,MS,Opts} - end, - Mods), - Flags, - Replies), - do_set_trace_patterns_2(Rest,Flags,MoreReplies); - {error,Reason} -> - do_set_trace_patterns_2(Rest,Flags,[{error,Reason}|Replies]) - end; - error -> % Bad pattern parameters. - do_set_trace_patterns_2(Rest, - Flags, - [{error,{bad_trace_args,{M,F,Arity,MS}}}|Replies]) - end; + do_set_trace_patterns_2([{{void,M},F,Arity,MS,Opts}|Rest],Flags,Replies); do_set_trace_patterns_2([{{Dir,M},F,Arity,MS,Opts}|Rest],Flags,Replies) when is_list(Dir),is_list(M) -> - case check_pattern_parameters(void,F,Arity,MS) of % We don't want to repeat bad params. - ok -> + case check_pattern_parameters('_',F,Arity,MS) of % We don't want to repeat bad params. + true -> case inviso_rt_lib:expand_regexp(Dir,M,Opts) of % Get a list of real modulnames. Mods when is_list(Mods) -> MoreReplies= @@ -1475,7 +1466,7 @@ do_set_trace_patterns_2([{{Dir,M},F,Arity,MS,Opts}|Rest],Flags,Replies) {error,Reason} -> do_set_trace_patterns_2(Rest,Flags,[{error,Reason}|Replies]) end; - error -> % Bad pattern parameters. + false -> % Bad pattern parameters. do_set_trace_patterns_2(Rest, Flags, [{error,{bad_trace_args,{M,F,Arity,MS}}}|Replies]) @@ -2174,21 +2165,20 @@ check_flags_2([Faulty|_],_Flags) -> {error,{bad_flag,Faulty}}. %% the function is to avoid to get multiple error return values in the return %% list for a pattern used together with a regexp expanded module name. check_pattern_parameters(Mod,Func,Arity,MS) -> - if - (Mod=='_') and (Func=='_') and (Arity=='_') and - (is_list(MS) or (MS==true) or (MS==false)) -> - ok; - (is_atom(Mod) and (Mod/='_')) and (Func=='_') and (Arity=='_') and - (is_list(MS) or (MS==true) or (MS==false)) -> - ok; - (is_atom(Mod) and (Mod/='_')) and - (is_atom(Func) and (Func/='_')) and - ((Arity=='_') or is_integer(Arity)) and - (is_list(MS) or (MS==true) or (MS==false)) -> - ok; - true -> - error - end. + MSresult = check_MS(MS), + MFAresult = check_MFA(Mod,Func,Arity), + MFAresult and MSresult. + +check_MS(MS) when is_list(MS) -> true; +check_MS(true) -> true; +check_MS(false) -> true. + +check_MFA('_','_','_') -> true; +check_MFA(Mod,'_','_') when is_atom(Mod) -> true; +check_MFA(Mod,'_',A) when is_atom(Mod), is_integer(A) -> false; +check_MFA(Mod,F,'_') when is_atom(Mod), is_atom(F) -> true; +check_MFA(Mod,F,A) when is_atom(Mod), is_atom(F), is_integer(A) -> true. + %% ----------------------------------------------------------------------------- %% Help function finding out if Mod is loaded, and if not, if it can successfully -- cgit v1.2.3 From d53be747c945d5e86997e1944446795b271dacb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 11 Mar 2011 17:34:22 +0100 Subject: Update copyright years --- lib/runtime_tools/c_src/trace_file_drv.c | 2 +- lib/runtime_tools/doc/src/notes_history.xml | 2 +- lib/runtime_tools/doc/src/part_notes_history.xml | 2 +- lib/runtime_tools/doc/src/runtime_tools_app.xml | 2 +- lib/runtime_tools/test/dbg_SUITE.erl | 2 +- lib/runtime_tools/test/erts_alloc_config_SUITE.erl | 2 +- lib/runtime_tools/test/inviso_SUITE.erl | 2 +- lib/runtime_tools/test/runtime_tools_SUITE.erl | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/runtime_tools') diff --git a/lib/runtime_tools/c_src/trace_file_drv.c b/lib/runtime_tools/c_src/trace_file_drv.c index cd54f36af0..668f6f4af3 100644 --- a/lib/runtime_tools/c_src/trace_file_drv.c +++ b/lib/runtime_tools/c_src/trace_file_drv.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1999-2009. All Rights Reserved. + * Copyright Ericsson AB 1999-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/runtime_tools/doc/src/notes_history.xml b/lib/runtime_tools/doc/src/notes_history.xml index 587d935e0a..8fe27f619c 100644 --- a/lib/runtime_tools/doc/src/notes_history.xml +++ b/lib/runtime_tools/doc/src/notes_history.xml @@ -5,7 +5,7 @@
2006 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/runtime_tools/doc/src/part_notes_history.xml b/lib/runtime_tools/doc/src/part_notes_history.xml index cdd727780c..2ce1a5de05 100644 --- a/lib/runtime_tools/doc/src/part_notes_history.xml +++ b/lib/runtime_tools/doc/src/part_notes_history.xml @@ -5,7 +5,7 @@
2006 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/runtime_tools/doc/src/runtime_tools_app.xml b/lib/runtime_tools/doc/src/runtime_tools_app.xml index e31c8cb5f7..1fd61b84d8 100644 --- a/lib/runtime_tools/doc/src/runtime_tools_app.xml +++ b/lib/runtime_tools/doc/src/runtime_tools_app.xml @@ -5,7 +5,7 @@
1999 - 2007 + 2011 Ericsson AB, All Rights Reserved diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl index 8e01e75aba..bd908c1f3a 100644 --- a/lib/runtime_tools/test/dbg_SUITE.erl +++ b/lib/runtime_tools/test/dbg_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl index d4957c060e..8ea04e1767 100644 --- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl +++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/runtime_tools/test/inviso_SUITE.erl b/lib/runtime_tools/test/inviso_SUITE.erl index 817ebfbbba..3ae8d34dd6 100644 --- a/lib/runtime_tools/test/inviso_SUITE.erl +++ b/lib/runtime_tools/test/inviso_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl index 4d46d75b62..b26f3dd881 100644 --- a/lib/runtime_tools/test/runtime_tools_SUITE.erl +++ b/lib/runtime_tools/test/runtime_tools_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in -- cgit v1.2.3 From 91b2e57ea0e3ab794d4b57a12ef10205383525a5 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 14 Mar 2011 18:18:42 +0100 Subject: Prepare release --- lib/runtime_tools/doc/src/notes.xml | 17 +++++++++++++++++ lib/runtime_tools/vsn.mk | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/runtime_tools') diff --git a/lib/runtime_tools/doc/src/notes.xml b/lib/runtime_tools/doc/src/notes.xml index 92629c18e5..b27a3a0996 100644 --- a/lib/runtime_tools/doc/src/notes.xml +++ b/lib/runtime_tools/doc/src/notes.xml @@ -31,6 +31,23 @@

This document describes the changes made to the Runtime_Tools application.

+
Runtime_Tools 1.8.5 + +
Improvements and New Features + + +

+ When a big number of trace patterns are set by inviso the + Erlang VM could get unresponsive for several seconds. + This is now corrected.

+

+ Own Id: OTP-9048 Aux Id: seq11480

+
+
+
+ +
+
Runtime_Tools 1.8.4.1
Fixed Bugs and Malfunctions diff --git a/lib/runtime_tools/vsn.mk b/lib/runtime_tools/vsn.mk index 8be4ae613b..6ed98f697e 100644 --- a/lib/runtime_tools/vsn.mk +++ b/lib/runtime_tools/vsn.mk @@ -1 +1 @@ -RUNTIME_TOOLS_VSN = 1.8.4.1 +RUNTIME_TOOLS_VSN = 1.8.5 -- cgit v1.2.3