Kaynağa Gözat

ft: 部分优化调整

master
SisMaker 3 yıl önce
ebeveyn
işleme
8e5aeb5cf6
2 değiştirilmiş dosya ile 4 ekleme ve 3 silme
  1. +3
    -1
      src/callgrind/tpCallGrind.erl
  2. +1
    -2
      src/eTpf.erl

+ 3
- 1
src/callgrind/tpCallGrind.erl Dosyayı Görüntüle

@ -1,4 +1,5 @@
-module(tpCallGrind). %%
-include("eTpf.hrl").
-export([
pfs/2
@ -446,7 +447,8 @@ cacheModule({Module, _, _} = MFA, #state{sources = Cache} = State, Src) ->
{Module, Beam, _} = code:get_object_code(Module),
{ok, {Module, Chunks}} = beam_lib:chunks(Beam, [abstract_code]),
[{abstract_code, {raw_abstract_v1, Forms}}] = Chunks,
Funcs = [{{Module, F, A}, LN} || {function, LN, F, A, _} <- Forms],
Funcs = [begin case LN of {Line, _} -> {{Module, F, A}, Line}; _ -> {{Module, F, A}, LN} end end || {function, LN, F, A, _} <- Forms],
NewCache = lists:foldl(fun({Key, LN}, Acc) -> Acc#{Key => {Src, LN}} end, Cache, Funcs),
%% We cannot currently retrieve line number information
%% for list comprehensions and funs. We therefore

+ 1
- 2
src/eTpf.erl Dosyayı Görüntüle

@ -52,7 +52,7 @@ stl() ->
trace(new_processes, [call, arity, return_to, garbage_collection], [{app, eAcs}], tpTracerLog, #{}, #{stackTc => true}).
stf() ->
trace(new_processes, [call, arity, return_to, garbage_collection], [{app, eAcs}], tpTracerFile, #{}, #{stackTc => true}).
trace(new_processes, [call, arity, return_to, garbage_collection], ['_'], tpTracerFile, #{}, #{stackTc => true}).
stop() ->
stop(?eTpfTracerId).
@ -154,7 +154,6 @@ doTrace(PidPortSpec, FlagList, TraceMods, TracerMod, TracerOpts, TraceOpts) ->
begin
%% The module must be loaded before we attempt to trace it.
_ = code:ensure_loaded(M),
io:format("IMY*********************** ~p~n", [M]),
_ = erlang:trace_pattern(OneTraceMFA, MatchSpec, PtFlags)
end || {M, _F, _A} = OneTraceMFA <- TraceMFAs
],

Yükleniyor…
İptal
Kaydet