aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src/fprof.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-30 10:59:59 +0100
committerBjörn Gustavsson <[email protected]>2011-11-30 10:59:59 +0100
commita4029940e309518f5500fc2c403ccdf62f9fa4e4 (patch)
tree7bc28a603eeac3070debe8c55bec8c0e80767a4c /lib/tools/src/fprof.erl
parentca03aa3d8a97e5d63c1055c19d2bd5a037acc28f (diff)
parent99615c70dcfddc01b70b51e30dbfa7f476cb733a (diff)
downloadotp-a4029940e309518f5500fc2c403ccdf62f9fa4e4.tar.gz
otp-a4029940e309518f5500fc2c403ccdf62f9fa4e4.tar.bz2
otp-a4029940e309518f5500fc2c403ccdf62f9fa4e4.zip
Merge branch 'bjorn/deprecate-tuple-funs/OTP-9649'
* bjorn/deprecate-tuple-funs/OTP-9649: erts: Warn the first time a tuple fun is called otp_mibs: Eliminate use of tuple fun os_mon: Eliminate use of tuple fun asn1: Eliminate use of tuple fun parsetools: Eliminate use of tuple fun mnesia tests: Eliminate use of tuple fun snmp: Eliminate use of tuple fun wrap_log_reader_SUITE: Eliminate use of tuple fun big_SUITE: Eliminate use of tuple fun file_SUITE: Eliminate use of tuple fun fprof: Eliminate use of tuple fun xref_compiler: Eliminate use of tuple fun shell: Eliminate use of tuple funs erl_eval: Eliminate use of tuple funs user_sup: Eliminate use of tuple fun
Diffstat (limited to 'lib/tools/src/fprof.erl')
-rw-r--r--lib/tools/src/fprof.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/tools/src/fprof.erl b/lib/tools/src/fprof.erl
index 155965a65a..1d85a55bd7 100644
--- a/lib/tools/src/fprof.erl
+++ b/lib/tools/src/fprof.erl
@@ -87,8 +87,10 @@ dbg(_, _, _) ->
-apply({M, F} = Function, Args)
+apply({M, F}, Args)
when is_atom(M), is_atom(F), is_list(Args) ->
+ Arity = length(Args),
+ Function = fun M:F/Arity,
apply_1(Function, Args, []);
apply(Fun, Args)
when is_function(Fun), is_list(Args) ->
@@ -98,8 +100,10 @@ apply(A, B) ->
apply(M, F, Args) when is_atom(M), is_atom(F), is_list(Args) ->
apply_1({M, F}, Args, []);
-apply({M, F} = Function, Args, Options)
+apply({M, F}, Args, Options)
when is_atom(M), is_atom(F), is_list(Args), is_list(Options) ->
+ Arity = length(Args),
+ Function = fun M:F/Arity,
apply_1(Function, Args, Options);
apply(Fun, Args, Options)
when is_function(Fun), is_list(Args), is_list(Options) ->
@@ -109,7 +113,9 @@ apply(A, B, C) ->
apply(Module, Function, Args, Options)
when is_atom(Module), is_atom(Function), is_list(Args), is_list(Options) ->
- apply_1({Module, Function}, Args, Options);
+ Arity = length(Args),
+ Fun = fun Module:Function/Arity,
+ apply_1(Fun, Args, Options);
apply(A, B, C, D) ->
erlang:error(badarg, [A, B, C, D]).