瀏覽代碼

ft: 代码修改

master
SisMaker 3 年之前
父節點
當前提交
8e8db171b7
共有 2 個文件被更改,包括 6 次插入7 次删除
  1. +0
    -1
      c_src/tracer/tpTracerNif.c
  2. +6
    -6
      src/messages/tpMsgSD.erl

+ 0
- 1
c_src/tracer/tpTracerNif.c 查看文件

@ -170,7 +170,6 @@ static ERL_NIF_TERM enabled_garbage_collection(ErlNifEnv *env, int argc, const E
// trace(TraceTag, TracerState, Tracee, TraceTerm, Opts)
static ERL_NIF_TERM trace(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
// IMY-todo
// enif_fprintf(stdout, "IMY************trace:");
// for (int i = 0; i <= argc - 1; i++) {
// if (i != 1) {

+ 6
- 6
src/messages/tpMsgSD.erl 查看文件

@ -118,22 +118,22 @@ formatEvent({Type, From, _, {'$gen_call', {From, Ref}, Msg}, To}, State) ->
NumCalls = get(num_calls) + 1,
put(num_calls, NumCalls),
put(Ref, NumCalls),
eFmt:formatBin(<<" \"~w~s\" ~s \"~w~s\" [label=\"gen:call #~w ~9999P\"];~n">>, [From, label(From, State), case Type of send ->
"->"; _ -> "-->" end, To, label(To, State), NumCalls, Msg, 8]);
eFmt:formatBin(<<" \"~w~s\" ~s \"~w~s\" [label=\"gen:call #~w ~9999P\"];~n">>, [From, label(From, State),
case Type of send -> "->"; _ -> "-->" end, To, label(To, State), NumCalls, Msg, 8]);
formatEvent(Event = {Type, From, _, {Ref, Msg}, To}, State) ->
case get(Ref) of
undefined ->
defFormatEvent(Event, State);
NumCall ->
eFmt:formatBin(<<" \"~w~s\" ~s \"~w~s\" [label=\"#~w ~9999P\"];~n">>, [From, label(From, State), case Type of send ->
"->"; _ -> "-->" end, To, label(To, State), NumCall, Msg, 8])
eFmt:formatBin(<<" \"~w~s\" ~s \"~w~s\" [label=\"#~w ~9999P\"];~n">>, [From, label(From, State),
case Type of send -> "->"; _ -> "-->" end, To, label(To, State), NumCall, Msg, 8])
end;
formatEvent(Event, State) ->
defFormatEvent(Event, State).
defFormatEvent({Type, From, _, Msg, To}, State) ->
eFmt:formatBin(<<" \"~w~s\" ~s \"~w~s\" [label=\"~9999P\"];~n">>, [From, label(From, State), case Type of send ->
"->"; _ -> "-->" end, To, label(To, State), Msg, 8]).
eFmt:formatBin(<<" \"~w~s\" ~s \"~w~s\" [label=\"~9999P\"];~n">>, [From, label(From, State),
case Type of send -> "->"; _ -> "-->" end, To, label(To, State), Msg, 8]).
label(P, #state{meta = Meta}) ->
case maps:get(P, Meta, #{}) of

Loading…
取消
儲存