The following code is from the fprof.erl file. It shows where the error message is coming from. But I do not know how to continue searching for the source code of erlang:trace . It can be written c. If the source code for the trace can be found, a secret can be provided.
trace_on(Procs, Tracer, {V, CT}) -> case case CT of cpu_time -> try erlang:trace(all, true, [cpu_timestamp]) of _ -> ok catch error:badarg -> {error, not_supported} %% above error message is shown here end; wallclock -> ok end of ok -> MatchSpec = [{'_', [], [{message, {{cp, {caller}}}}]}], erlang:trace_pattern(on_load, MatchSpec, [local]), erlang:trace_pattern({'_', '_', '_'}, MatchSpec, [local]), lists:foreach( fun (P) -> erlang:trace(P, true, [{tracer, Tracer} | trace_flags(V)]) end, Procs), ok; Error -> Error end.
source share