first of all
4> erlang:fun_info(fun foo:baz/2).
[{module,foo},{name,baz},{arity,2},{env,[]},{type,external}]
I found erlang:fun_info(fun m:f/a) seem always return module and name with fun m:f/a
use goto define to trace
example:
my_rpc:call(Node, m, f, A)
define macro to warp it
-define(RPC_CALL(Node, Fun, A),
my_rpc:call(Node, erlang:fun_info(F, module), erlang:fun_info(F, name), A)).
then, we can trace by fun m:f/3
?RPC_CALL(Node, fun m:f/3, A)
but is not precompiled
-module(test).
-compile([nowarn_export_all, export_all]).
-define(FUNC(F), erlang:fun_info(F, name)).
a() -> ?FUNC(fun erlang:max/2).
erlc -S test.erl
{function, a, 0, 2}.
{label,1}.
{line,[{location,"test.erl",7}]}.
{func_info,{atom,test},{atom,a},0}.
{label,2}.
{move,{atom,name},{x,1}}.
{move,{literal,fun erlang:max/2},{x,0}}.
{call_ext_only,2,{extfunc,erlang,fun_info,2}}.
is call_ext_only now